I’m looking to implement a 3 Band EQ mimicking a standard DJ Mixer.
Unfortunately I’m not having much luck. I know it involves creating BiquadFilter nodes and connecting them to a gain node. Unfortunately I’m not getting anywhere near the desired results.
The only success I’m having so far is just the gainNode to control the volume of the track.
Any assistance would be greatly appreciated.
Thanks,
Stan
I’ll go ahead and elaborate on my answer on idbehold’s question:
I would say that you probably want to use filters with type 5 (peaking), which lets all frequencies through and only amplifies/reduce at the frequency at which you’ve set the respective filter.frequency.value. That lets you connect the filters in series so you don’t need separate audio paths. You could also consider using a low-shelf filter as the first filter, and a hi-shelf filter as the third, which is rather common in 3-band equalizers.
If you go with the peaking filters in series, you don’t need a separate gain node for each frequency, you just set the filter.gain.value for the specific filters.
The code would look something like this:
You can then adjust each band with their respective Q, frequency and gain values (check https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#BiquadFilterNode to see which params works with which filter type), for example:
EDIT:
To add a separate gain, just do
and then either do
or
depending on whether you want it post or pre the EQ. You control the gain by doing