I’m learning to use the web audio api to synthesize and process sound. I see there’s a BiquadFilterNode class I can use, but it only allows to specify one of the filter types defined ("lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass") and control it through the meta parameters of such filters: Q, gain and center-frequency.
Is there a way to specify the actual coefficients of the digital filter? In other words, for a filter of the form:
b_0 + b_1*z^(-1) + b_2*z^(-2)
H(z) = -----------------------------
1 + a_1*z^(-1) + a_2*z^(-2)
can I somehow directly specify the values of b_0, b_1, b_2, a_1, a_2?
I ask because although the predefined filter types are very handy, they don’t necessarily cover all the use cases. By specifying the coefficients it would be possible to implement first-order filters, parametric sections, etc.
It’s not currently possible, but is a simple API to add.
At the least, it’s clear we need to add support for 1st-order filters.