okay, for three or more filters there are several options how you might want to morph. between all? or only linear, with or without a connection between the first and the last?
when you want morph between the actual parameters of [biquad~], you could use a lowpass instead of a hipass by setting its volume to 0. and inverting the gain input. but of course this is not the same, it gives a totally different transform.
Easiest way: use 3 function objects as lookup tables. Set the domains to 127 ms long, then draw the appropriate shapes for each. Send the 0-127 value in the inlet and you'll get the interpolated y value out the left outlet.
Way easier than doing the math... (and if you need curves, switch function to curve mode!)
the problem is that the calculation for the coeffs is different for each filter type.
if you have a highpass at 50 Hz and a lowpass at 2500 Hz and you interpolate between the coefficent list, that wont sound much like a linear fade.
i think you would prefer to interpolate between frequency, reonance, gain, and filter type - where the "interpolation" between the type is something you have to build your own. at the same time this part, the morph between two types, can be replaced just fine by mixing two types.
biquad-highpass biquad-bandpass biquad-lowpass (all with the same frequency, gain, and q setting)
[*~ 0.] [*~ 0.] [*~ 0.]
then control the mixer with your crossfader (i failed to see your question about it)
it is for 3 sources basically nothing more than 2 for 2 sources.
for 2 sources:
| [* -1.]
| [+ 1.]
[* 0.] [* 0.] (into right inlets, left inlets are for the 2 filter ouputs)
for 3 sources:
| [- 1.]
| [+ 1.], | [+ 1.]
| || | (2nd and 3rd both go into the middle [* 0.])
[* 0.] [* 0.] [* 0.]
you will find that the values of the outer ones will hang a bit when moving the knob faster.
but i think it is bad enough to read it like this from the forums. ;)
Glad you checked out my Morph Filter Device, sorry about the messy code. Was quite a quick build and haven't had time to clean up or comment it yet.
I achieved the filter morphing by using several [filtercoeff~] and one [biquad~] for the actual filtering.
I wanted to morph between five filters so made 5 [filtercoeff~] objects each with controls to change the cutoff, gain, resonance and filtertype.
The [filtercoeff~] object generates 5 signal outputs which are the 5 signal inputs for [biquad~].
I used 5 [scale~] objects, one for each of [biquad~]'s inputs, to scale between the signal outputs of [filtercoeff~].
I was hoping doing it all at signal rate would make it sound quite smooth and fast. I have another version of the device with built in LFOs. The signal rate LFOs output can go straight into the [scale~] objects which sounds pretty awesome, heh.
sorry, just had a look at the patch again, looks like i did something more complex than i thought. i used more [scale~] objects, one [scale~] for each pair of [filtercoeff~] you want to morph between, and 5 [selector~] objects, one for each coefficient input of [biquad~]. the [selector~] objects make sure only one signal from each set of [scale~] objects is going through to [biquad~] at a time. so only two filter shapes are morphing between each other, even though there's five [filtercoeff~].
it's been a long day and i'm struggling to describe it, heh. i'll try and cut out a small part of the patch to show it working between just two filters, but it does sound like the Morph Filter does what you're after.
ah well looking at Stefan's patch it uses exactly the same method as i did, except i did it all with signal rate objects.
Stefan's patch describes the principal perfectly. If you have 3 different filters to morph between you create 3 objects which design the filter coeffs, so [filtergraph~] or [filtercoeff~]. you then create a set of 5 scaling objects, one scale for each coeff, for each filter morph. so for 3 filters you need 2 sets of 5 scale objects. one set of 5 scales for the morph between the first two filters, and another set of 5 scales for the morph between the second and third filter. my Morph Filter has 5 filters so i needed 4 sets of 5 scaling objects.
you then run the outputs of the scaling objects into a selector or join.
Well, the filtergraph is just a sophisticated way to calculate the five parameters for biquad. Look at the help file for biquad an maybe some literature about digital filters. All you have to interpolate are the biquad values. The filtergraph can also display the resulting frequency shape if its in display mode...
The filter types do not exist for biquad, they only help you to calculate the parameters within filtergraph...
The unjoin will simply cut up the list from filter graph into five floats. These floats then are interpolated with scale (five for each range (0.-1. & 1.-2.)... One could also try to achive this with a vexpr...