Crossfade between two different audio files from a buffer?

danscofi's icon

Hello,

I've been searching and searching and can't manage to get this to work. I have a buffer with three audio files in it. If one is playing one of the others gets a bang, the one playing needs to crossfade with the new one. I have attempted to use the line~ object but to no avail. Any help is greatly appreciated. Patch is posted below.

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

thanks,
Dan

Florent Ghys's icon
Max Patch
Copy patch and select New From Clipboard in Max.

hey
you don't have one buffer, you have one polybuffer which contains several buffers
you should have three different play~ objects if you want to read three sounds at the same time
something like that could work if you have short samples

you should definitely check out the help file of polybuffer under the tab "sampler"
and the help of poly~
best

Stephane Morisse's icon

Also, I don't see the way you bang a second sound when one is playing. Is that what the [change] object is used to ?

Stephane Morisse's icon

Smart auto-crossfade system Florent !

Florent Ghys's icon

oh no it's not smart at all... try it with long sounds and you'll see what's wrong with it!

danscofi's icon

thanks guys! this really helps.

Stephane Morisse's icon

@Florent : I know that if you send a bang as soon as one sound is playing(which is what the original poster intends to do), you're going to play it for 1000 ms, even if it's shorter - so I would say this is more embarassing than with long samples considering Danscofi wants to crossfade between sounds. Is that what you mean ? Maybe a solution could be to delay the bang accroding to each sample duration ?

Florent Ghys's icon
Max Patch
Copy patch and select New From Clipboard in Max.

no, the issue with my patcher was that I was sending [1, 0 500] to all the other-than the current line~ objects
one possible way to deal with that would be to keep track of the previous "player" played
something like that might work

LSka's icon

You don't need to send (1, 0 500) to line~, (0 500) is sufficient, so if they are at 0, they remain to 0.

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

I tried and it seems to work