line~ fade in and fade out?

pete.oconnell's icon

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.

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

Any advice would be greatly appreciated.
Pete

David Butler's icon

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.

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

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

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

pete.oconnell's icon

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

brendan mccloskey's icon

Dood
we have all posted 'basic' questions - it's all relative