Controllable pitch envelope
I’m new to Max and am trying to do something which on the face of it seems like it should be fairly simple and a common request yet I’m struggling to get it to work how I want. I have tried looking through forum posts and t’internet but can’t spot how to do it. Please help : )
In short, I’m trying to use an envelope to control the frequency of an oscillator but I’d like to be able to use either number boxes, knobs or sliders to change to envelope parameters. What I have managed to get to work is using function – however, this method means I need to draw in the envelope.
I’ve also managed to use line~ object prior to the oscilator and a message box sending “#1, #2 #3 #4 #5” into line~ where #1 = initial frequency, #2 frequency to drop/rise to #3 time #4frequency #5time. This works as expected however, I can’t work out how to dynamically change those numbers...
Is the correct way to go about this task to:
1) Try using $1 $2 etc. type messages to change the message being sent to line~
2) Try sending data another way into line~
3) Try sending values to a function object so I can dynamically control it
4) Use an object like adsr~
5) Some other method?
Any help appreciated. I’m sure this should be easier than it seems…
You've pretty much answered your own question. Any of those will work.
I'd probably keep the envelope normalized between 0 and 1, and then scale it (with *~) and offset it (with +~) to get the desired frequency range. Note there is a difference between a frequency glissando and a pitch glissando. Here's an example, using adsr~.
Hi Christopher
Thanks so much...I'd thought I couldn't use adsr~ but good to see I can.
I've had another stab at using the line~ approach also in the attached file - basically this is with a view to creating a simple envelope for a kick drum so sure it's common. Would the approach I've used for line~ be the most practical do you think or am I missing an easier way to do it?
Cheers
Geoff
I'm not sure what you're trying to achieve with the control of the frequency of cycle~, so I can't comment on that, but control of amplitude with line~ and *~ is pretty straightforward: the amplitude envelope of a kick drum "gets loud real fast, goes silent pretty fast." There's a wide variety of possible kick drum sounds, of course, but a basic drum 'n' bass kick sound could be as simple as just a low bass sinusoid with a rapid decay, with a little lowpass-filtered noise added in the attack.
Thanks Christopher - what i had meant re. the line~ controlling feedback was how i could achieve the best way of modifying the parameters of that object. Your line objects are being controlled with message boxes. In the patch i created (see my file) i'm using a combination of number boxes feeding a pack object to feed a message box which subsequently inputs into line~.
This seems like perhaps an overly complicated way of being able to control the parameters of line~ so I was really looking for some feedback on a better way?
Thanks again, really appreciate.
Geoff
The line~ object expects pairs: go to value y in time x (ms). You can concatenate as many of those pairs as you want, as in: go to y1 in x1 ms, then go to y2 in x2 ms, then go to y3 in x3 ms, etc., to make a function composed of line segments. So the message to line~ can be a list of 2 items, or 4, or 6, etc.
How you provide that message to line~ is up to you. For example, you could have a coll object containing a variety of messages.
That's superb, thank you! I guess in Max there is always a different way to do something ; )