modulting filtergraph~'s cutoff freq with function

nit's icon

i tried modulating filteraph~'s cutoff frequency with the function object but during the modulation i hear ticking artifacts in the sound. i tried using a line object between the function output and filtergraph's cutoff freq input but i have to set it really high wich makes it response way to slow.
is there a better way?

here is an example of what i made for doing this:

Max Patch
Copy patch and select New From Clipboard in Max.

jml's icon

Hi nit,

Here's a solution that uses audio rate modulation of the frequency parameter by incorporating the filtercoeff~ object.
Note that I haven't set up your constants.

Max Patch
Copy patch and select New From Clipboard in Max.

nit's icon

thanks, it seems this will work perfectly.

Alexandre's icon

Hi,
i think the first problem in your patch, nit, is that you use a number~ instead of snapshot~ (i fell number~ can't output value more often than 50 ms) Then snapshot~ should output one value at each vector.

Here the both ways using filtergraph or filtercoeff, will make different results when different vectors sizes are used. with big vector sizes of 1024 (for signal and I/O), it sounds better with filtergraph than filtercoeff, i shown the reason why in that topic : https://cycling74.com/forums/index.php?t=msg&th=40632

But hum, when i put vector sizes of 128 (for signal and I/O), it's better with filtercoeff... Strange, normally it should be the same, as filtercoeff, in its default mode, only output signal values at each vector. (see the other topic)

There is some issue with max messages that not so precise after going thru filtergraff, i think... Even with "Scheduler in audio interrupt" ON. Then in the 3rd example using filtercoeff~->snapshot~, we don't have this problem, it's going exactly like filtercoeff when "Scheduler in audio interrupt" is ON.

Last thing, if you need the best precision(or want that the result doesn't depend anymore about the vector size), the only way is to use the "resamp 1" message on filtercoeff, with very fast moves, you'll notice the difference. (see the other topic)

nit's icon

Thank you very much for this explanation.

I've always overlooked the part of the snapshot~ help file with the 'samples' message to be honest. I never knew you even could specify its internal clock down to 1 sample.