line~ fade in and fade out?

Jan 2, 2011 at 4:48pm

line~ fade in and fade out?

Hi I am having a bit of trouble getting my head around how to properly write the arguments to line~ in order to control fades. I am trying to create a bpatcher to use to trigger lots of samples from my computer keyboard. Here is what I have so far. What I am hoping to do is have any sample I trigger fade in over 30ms and fade out over 500ms, but I can’t quite figure out how to do that. I am hoping to keep it simple using line~ and buffer~ if possible.

– Pasted Max Patch, click to expand. –

Any advice would be greatly appreciated.
Pete

#54203
Jan 2, 2011 at 5:03pm

The line~ object you have is controlling playback by specifying which sample to read from a particular time value to play~. The amplitude of the samples coming from play~ is always exactly the same as the referenced file.

What you need is an additional line~ object, but this time connected to a *~ object to control amplitude. See the patch below:

– Pasted Max Patch, click to expand. –
#195098
Jan 2, 2011 at 5:10pm

You can use another line~ object to control the amplitude (the multiplier of the *~) object.
See MSP Tutorial 2, and the example below.

– Pasted Max Patch, click to expand. –
#195099
Jan 2, 2011 at 7:49pm

Thanks so much for your replies, that works perfectly. I am just starting to get the hang of max :P. Sorry for the basic questions. I am sure I will have a few more over the next few days.

Cheers
Pete

#195100
Jan 2, 2011 at 8:41pm

Dood
we have all posted ‘basic’ questions – it’s all relative

#195101

You must be logged in to reply to this topic.