How to modulate events with an LFO?

Joseph Nagy's icon

I have an LFO working modulating the frequency of a cycle~, so I understand how this works with signals. But how do you go about modulating events with an LFO? For example, the frequency of a filterdesign object.

nouserid's icon

here's one way

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

Joseph Nagy's icon

Thanks for pointing snapshot out, I didn't know about this one. But this adds latency and audio is incredibly choppy when modulating something with a huge number range such as filter cutoff.

Roman Thilenius's icon

you can use the non-audio line obejct to make yourself a non audio "phasor", and then almost do the same things with it like you did before.

but you sound like you need audio rate.

so control the filter with audio rate, and use the snapshot object only for triggering the filtergraph display.

nouserid's icon

darn, wish i could help but I don't have any experience using filterdesign. i've been using svf~ mostly for filtering which can be controlled with a signal. i'm sure somebody else will know what's up though

Joseph Nagy's icon

How would I control the filter with an audio signal if it only takes events though?

Peter Ostry's icon

Not sure if I understand you right, but you can transform an (audio)signal to numbers with [number~] or [snapshot~] or similar objects. Often quite easy through a simple [meter~] object or [live.meter~].

But in many cases you need some smoothing also, there are [average~], [slide~] and [rampsmooth~] for example, which you may want to use before you convert to numbers. Kind of envelope following to avoid 'flickering' values.

Once you got a usable smooth signal, you can scale it to the appropriate range and convert it to the parameter values you need. Or to MIDI.

The crux is not the number-work but rather the smoothing before, especially if you need to keep some dynamics. [scope~] is a good helper while testing smoothing methods.

Roman Thilenius's icon

How would I control the filter with an audio signal if it only takes events though?

every audio filter takes signals. (i assume you control biquad or cascade with your fitergraph or filterdesign object.)

Joseph Nagy's icon

Ok sorry for misunderstanding here. There's still a lot of objects I don't know of. svf~ does what I want, being able to take an audio signal for frequency control. I still don't understand how I would do this with something like biquad~ without converting audio to events.

Roman Thilenius's icon

this filter stuff is all but straight forward, and the decision when to use audio and when messages is difficult for everyone.
however, going from an audio LFO via messages to an audio filter should probably be avoided.

biquad does it too (taking audio), just not filterdesign/filtergraph

if you want fast and exact modulation of a biquad filter, you´d drive it either with custom DSP or with filtercoeff~ (which is, unfortunately, almost nowhere crosslinked from the other objects´pages in the online reference.)

https://docs.cycling74.com/max7/maxobject/filtercoeff~

it is like filtergraph~ but takes audio. if you look at the example picture there is already a simple LFO connected to the frequency.

filterdesign is ( i believe) more targeted at filters which you are not going to modulate.


Joseph Nagy's icon

Ah okay I got it, thanks for showing me the filtercoeff~ as well. I got this to work perfectly with my LFO. Thanks for the explanation guys!