Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AudioWorklet-based multichannel peakmeter visualization (Read 3433 times) previous topic - next topic - Topic derived from Re: AudioWorklet-base...
0 Members and 1 Guest are viewing this topic.

AudioWorklet-based multichannel peakmeter visualization

I made an another project (spun off from filter bank spectrum analyzer project) utilizing AudioWorklet for multi-channel peakmeter, which is a sequel to previous AnalyserNode-based one, which only supports stereo

X
X
X

Features:
  • Number of peakmeter bars is automatically set according to source audio's number of discrete channels
  • Comes with Mid/Side channel representations and can be displayed in tandem with L/R channels
  • Configurable RMS averaging length and three averaging domains to choose from
  • Also comes with infinite (cumulative) average meter, which works similarly to integrated measurement of LUFS but without K-weighting nor scaling to LUFS
  • Channel labels (and its corresponding M/S representations) are displayed accurately on anything other than standard stereo (at least for mono, 2.1 stereo, quadraphonic, 5.1 and 7.1 surround sound, and of course 17.1 surround sound)
  • Linear and nth root amplitude scales are supported in-addition to logarithmic (dB) scaling (yes, I'm aware that some peakmeters in DAWs have nonlinear but not exactly logarithmic amplitude scaling)
  • Potential clipping (+0dBFS samples, some browsers like Firefox don't clip on +0dBFS samples) is indicated by main bar(s) flashing red, though you can turn this off by unchecking "Show potential clipping (above 0dBFS) as red bars" checkbox button if you don't mind about +0dBFS samples

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #1
Small update: Added a separator line between discrete channels and its M/S representations of channel pairs, which can look like this:
X

BTW, when there is center and LFE channels present, it will show the discrete center channels (including LFE on 5.1 and 7.1 surround sound) even on M/S mode since they're not part of channel pairs

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #2
New update: Main bar (either peak or exponential average) can now be hidden to only show RMS or infinite (cumulative) average levels

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #3
You're so tiresome!!

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #4
You're so tiresome!!
It could be arguable that I might accidentally "scared" @Crossover off his foobar2000 component development, which becomes tiresome since there are no updates from him nor for his components (foo_enhanced_spectrum_analyzer and foo_loudness_peakmeter) since then, which means version 2.x.x.x (2.0.0.0 or whatever) of his components never come out soon, which is again tiresome

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #5
sorry I was OOTL, isn't this what foobar2000 can do out of the box since ≥years ago? is there novelty?
a fan of AutoEq + Meier Crossfeed

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #6
sorry I was OOTL, isn't this what foobar2000 can do out of the box since ≥years ago?
Definitely yes but this project combines the peakmeter and "VU" meter into one like foo_uie_peakmeter and Peakmeter Spectrum component

is there novelty?
While there is an option to display additional Mid/Side representations (I'm sure you heard about Mid/Side processing in music production context) as well as infinite (cumulative) average bars, which is a crude approximation of integrated LUFS, nothing truly new is there

 

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #7
Does it use HW acceleration for display, to make it more fluid?
TAPE LOADING ERROR

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #8
Does it use HW acceleration for display, to make it more fluid?
On this project or web app, it uses CanvasRenderingContext2D, which is hardware-accelerated by default, which is why my own spectrum analyzer and spectrogram project as well as filter bank analyzer one runs faster than foo_enhanced_spectrum_analyzer in foobar2000


Re: AudioWorklet-based multichannel peakmeter visualization

Reply #10
I thought you'd be dabbling with pqyt's webview component to do all this inside a fb2k panel with fb2k audio data?
I've used my own project on CodePen for my needs of analyzing audio in realtime (to produce animated graphs) with algorithms I've implemented but I haven't tried webview component thing yet to "port" some of my Web Audio API stuffs to foobar2000 audio player

But the thing is, Web Audio API doesn't provide channel mask or something like that describes channel layout (to distinguish quadraphonic from 3.1 stereo, and 2.1 stereo from 3.0 ones), so I have to guess based on what foobar2000 is giving the channel layout for multichannel WAV files generated from Audacity (which doesn't provide channel mask nor any other form of channel layout metadata for multichannel WAV files exported with "Advanced Mixing Options" AFAIK) or from other sources like this one lacking any channel layout metadata at all

Which means implementing Mid/Side mode is complicated on multichannel formats (more than 2 channels or stereo) because I have to account for different channel configurations and making sure M/S matrix works correctly on each pair on multichannel audio (5.1 or 7.1 surround sound) and ignore center and LFEs (though it could become eligible for M/S conversion if there are left and right pairs of multiple LFE channels), exacerbated by Web Audio API's lack of channel layout data

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #11
while I'm waiting for Loudness Peakmeter 2.0.0.0 (foo_loudness_peakmeter 2.0.0.0) component (which I've use it for my foobar2000 setup) to be released, I've added M/S channel arrangement mode (multichannel sources only, like 5.1 and 7.1 surround sound and quadraphonic music), which can be either planar (FM, BM, FS, BS) or interleaved (FM, FS, BM, BS)

BTW, I think it is better to update my own projects (and to the extent, doing other stuffs like editing wiki pages) rather than continuously posting FRs at @Crossover components, even on dedicated FR threads for both upcoming Enhanced Spectrum analyzer 2.x.x.x (foo_enhanced_spectrum_analyzer 2.x.x.x) and Loudness Peakmeter 2.x.x.x (foo_loudness_peakmeter 2.x.x.x) respectively

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #12
Because I'm impatient for @Crossover returning and updating foo_loudness_peakmeter to something like version 2.0.0.0 or whatever, I've added a LUFS section like this:
X

With the LUFS bar colors changing depending on its current LUFS levels (magenta > blue > turquoise > green > yellow > red, much like in Audiosurf game in regards to colors depending on current intensity)

Also, I've made the separation gap (for M/S and LUFS parts) adjustable

Please note that the LUFS bars isn't calibrated for 5.1 and 7.1 surround sound at the moment and it is currently equally-weighted on all channels (including LFE) Now it have LUFS calibration mode you can choose between four modes (standard, same w/ LFE, sum, and finally the same as "sum" but with 1/numChannels factor) for proper visualization of LUFS on multichannel audio

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #13
Speaking of LUFS part of this project I've just added (while I'm still waiting for @Crossover to be active again and update his foobar2000 components like foo_loudness_peakmeter), I've just added the loudness range (LRA) measurement and can be displayed either alone or alongside three LUFS bars (momentary, short-term, and integrated)

Note: This measurement I've implemented lacks absolute gating of -70 LUFS, but it still have -20dB relative gating threshold so it might deviate from foo_loudness_peakmeter component and loudness metering VSTs like Youlean Loudness Meter a little bit and have limited time range (set by specified "short-term recall length") as well as the accuracy of LRA calculation is influenced by "hop length" parameter (default: 576 samples)

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #14
New feature: LRA calculation can be disabled in an another way (uncheck a checkbox button named "Enable LRA measurement" to disable LRA to save CPU resources if you don't need LRA measurements) other than setting short-term loudness recall length to 0 seconds, and also, max setting for short-term recall length has also been increased to 60 seconds and the default setting changed to 30 seconds

BTW, channel weighting for LUFS measurements are also changed to match @Crossover's foo_loudness_peakmeter (at least for 5.1 surround sound as LUFS metering in this project doesn't ignore extra channels not present in 5.1 systems, especially in the case of 7.1 surround and above) with rear channels reading ~1.5dB higher (4th root of 2)

Also, the organization of settings part (which uses dat.GUI to quickly change parameters) of this visualizer has been improved; peak/RMS meter and LUFS metering related settings are now in its respective folders

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #15
Also, I've updated this project again but this time, to add channel interpretation settings in the case of surround sound as well as an optional trim of less than 3 seconds short-term LUFS in terms of LRA calculation and also, you can now hide a peak/RMS metering if you're only interested on LUFS measurements

BTW, I've expanded compatibility of multichannel audio (at least when using default "Speakers" mode for channel interpretation setting) to cover 4.1 quadraphonic music and 6.1 surround sound respectively despite I don't have a surround sound system necessary for home theater stuffs

Note on Mid/Side (and combined L/R and M/S) mode: Channel pairs with missing left or right channels won't form a M/S pair (or in other words, ignoring channel pairs with missing L or R channel)

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #16
Peakmeter and LUFS metering (and to a certain extent, LRA) can now be reset independently, and changing the LUFS metering settings that requires a reset no longer reset the peakmeter and vice versa and also, organization improvement in settings GUI; time smoothing and RMS settings folder are now moved to peakmeter settings folder as it only applies to peak/RMS measurements

BTW, I forget to mention that a channel weighting mode parameter for LUFS measurements are already changed from "LUFS calibration mode" to "LUFS channel weighting mode" as it is correct to say it "channel weighting" rather than "LUFS calibration"

Now here's the question for anyone (with test materials or something like that), is my LUFS metering implementation on this project "accurate" as in compliance with ITU-R BS.1770 and EBU R128 standards for loudness measurements? If not, what "inaccuracies" you just pointed out?

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #17
BTW, while I still waiting for anyone (including foobar2000 component developers) to provide their own opinions about my own LUFS metering implementation (regarding the compliance with EBU R128 and ITU-R BS.1770 standards) in this project, here's the summary of the update I've made to this multichannel peakmeter project when come to LUFS metering:
  • NEW: Relative gating for integrated LUFS, this is to be more compliant with loudness metering standards but it isn't complete without -70dB absolute gating
  • NEW: "Fancy" coloring on LUFS bars can now be disabled; opting for either a same color gradient as foobar2000's built-in peakmeter visualization or a solid color (actually, it is a solid color but colored blue if we display both LUFS and LRA at the same time) over Audiosurf-style color-changing bars
  • NEW: Alternate way to set LUFS target (coloring for LUFS bars when "fancy color" mode is enabled, or in case of LUFS+LRA, opacity of these bars), opting for a minimum/maximum range rather than just a target where the color of bars is green when its current LUFS value is close to a specified value
  • IMPROVEMENT: Organization of the settings GUI; parameters related to LUFS target range and LRA now have its own folders (LUFS target and LRA) respectively
  • CHANGED: When using LUFS+LRA display mode (regardless of whether or not "fancy" coloring is used), the bar's opacity change depending on its current loudness value for each measurement, influenced by LUFS target range settings
  • FIX: Positioning of the dB labels when only the LUFS meter is shown when "Show two dB labels instead of one" is disabled

Note on relative gating of integrated LUFS (when enabled for compliance with loudness standards when comes to loudness normalization in something like Spotify): It is done by ignoring samples (after K-weighting filter) that go below a relative threshold (and thus not count towards overall loudness) for integrated part of three LUFS bars, and that relative threshold is calculated in block-by-block basis (accuracy is influenced by hop-size parameter, which defaults to 576 samples, which is the same as sample length of Winamp's visualization system as well as the length of MDCT frames in an MP3 file) whereas integrated LUFS is computed in sample-by-sample basis for smoother visualization

BTW, the 17.1 surround sound (aka. the max number of channels that can be used on WAVEFORMATEXTENSIBLE) is also called 11.1.6 Dolby Atmos format (11 main channels, 1 subwoofer, and 6 height channels)

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #18
but it isn't complete without -70dB absolute gating
To complete my implementation of EBU R128 loudness (LUFS) metering standards into my own peakmeter visualization project, I've added an option to use absolute gating for both integrated loudness and LRA, enabled by default (alongside with relative gating) and I also made relative gating for loudness range (LRA) measurement optional

Re: AudioWorklet-based multichannel peakmeter visualization

Reply #19
small changes I've forget to post:
  • made K-weighting optional for LUFS metering, not recommended to be disabled as a decision to made it an opt-out feature is just for fun :D
  • patched up the regression introduced in a change that made "fancy" coloring optional for loudness peakmeter bars; the color of main bar now use color gradient (instead of solid blue color) again when only the peakmeter (no RMS or infinite average) is shown