Forums > MaxMSP

line~ fade in and fade out?

January 2, 2011 | 4:48 pm

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


January 2, 2011 | 5:03 pm

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. –

January 2, 2011 | 5:10 pm

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. –

January 2, 2011 | 7:49 pm

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


January 2, 2011 | 8:41 pm

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


Viewing 5 posts - 1 through 5 (of 5 total)