Filter envelope with biquad?

Ed Majcher's icon

Can anyone give me some hints on how to add an envelope to a biquad filter, or more specifically, a biquad fronted by a filtergraph object?

I suspect it is not possible, but if anyone has any hints (I am not asking for someone to create the patch for me, just a noob looking for the start of the trail).

Thanks

Ed

Luke Hall's icon

Are you trying to use an envelope to control the centre frequency (or gain or Q) of your filter? If so you can use [function] sent to [line~] then to [filtercoeff~] into [biquad]. Below is a very simple example. I hope it helps.

lh

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

Roth's icon

If you want to envelope a specific parameter, go with the method described above. This may be what you are after I think, but if it isn't, something else you can do is use the pattr objects to cross-fade between filtergraphs. Check out this thread:

Ed Majcher's icon

Hey guys, thanks for the quick replies (I feel guilty I didn't respond quickly because of work stealing my max/msp time).

Both examples were very helpful and got me thinking enough that I felt comfortable I could do what I wanted but then as I started plodding along coding it, I realized I was completely wrong and my approach would never work.

What I was planning on doing was creating a filter that had an envelope, but an envelope initiated by a midi note, not something acting on a constant signal. I was looking for something along the lines of the adsr, in the sense that I needed something that would be sample accurate so it could act when a signal is greater then 0, modify the cutoff or Q of the filtergraph (which acting as the input to a biquad). After pouring over the filter graph and biquad docs (and everything in the max documentation I could think of) I am starting to think it is not possible because I cannot figure out how to plug the adsr into the filtergraph and/or biquad.

Any thoughts? (I have attempted to search the archives but I couldn't find anything or there is just too much information to scan).

Roth's icon

Can't figure it out is one thing, but since Max is a programming environment, "impossible" shouldn't be in your vocabulary :)

I made a little non-functional example to illustrate what you could do. Just replace the [sig~] objects with your envelope generator. [+~] objects can be used instead of the [*~] objects depending if you want to shift or scale the values from the [filtergraph].

Good luck!

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

Tj Shredder's icon

emajcher schrieb:
> What I was planning on doing was creating a filter that had an
> envelope, but an envelope initiated by a midi note, not something
> acting on a constant signal. I was looking for something along the
> lines of the adsr, in the sense that I needed something that would be
> sample accurate so it could act when a signal is greater then 0,
> modify the cutoff or Q of the filtergraph (which acting as the input
> to a biquad). After pouring over the filter graph and biquad docs
> (and everything in the max documentation I could think of) I am
> starting to think it is not possible because I cannot figure out how
> to plug the adsr into the filtergraph and/or biquad.

Don't give up, I can assure you its possible. If you insist on audio
domain control (I don't see the need) you need to use filtercoeff~ for
controlling the cascade~. You might want to control the frequency
exponetially with the aid of mtof~...
As amplitude envelopes always start and go to zero, you might consider
an offset as well, as your filter envelope needs a different range...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Ed Majcher's icon

ok, long overdue on a response here, but i was busy with programming silly web applications to pay the bills. i think i got it, so i thought i would post my solution for the sake of posterity (and to prove i didn't give up).

i know the patch isn't perfect, you can get hanging notes from the sustain getting superseded by another note, but that is a detail, the real goal was an envelope controlled filter via biquad. i ended up abandoning the ADSR object and going straight from a function. in the end ... i am not 100% sure why it works since i don't understand how the filter envelope will get triggered at the appropriate time in sync with the amp envelope instead of before or after it. this is my one problem with max, the concept of when events get triggered.

anyway ...

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

Ed

lear's icon

hope it helps!!

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

desiredfish's icon

A suggestion:

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

hope you like it,
you can also control the

desiredfish's icon

the Q i mean sorry.