Forums > MaxMSP

crossfading between 4 audio files

May 21, 2012 | 3:24 pm

Hi all, I’m having trouble thinking on how I might implement a crossfade between four different audio files – so that I could use a slider from 1 – 127 and as I scroll across sound one fades in and as I continue sound 2 fades in but sound 1 fades out as this happens continuing upto sound 4 at the far end being the only sound heard… I hope that’s clear.
I have tried using a number of crossfading examples from the forum but all deal with the idea of panning but in reverse: 2 inputs and I need four… can anyone help?
J


May 21, 2012 | 3:26 pm

My confused attempt:

– Pasted Max Patch, click to expand. –

May 21, 2012 | 3:44 pm

the only problem about this is the GUI – if you starting thinking within the limits of a 2-dimensional GUI object, you have lost.

to crossfade between each of 4 channels you need a symetric pyramid – the rest is nothing more than an addition of the results of linear fades between the 4 points of the pyramid.

how to make a usable GUI interface for that? no idea.

-110


May 21, 2012 | 3:59 pm

Yeah, I can envision that and it makes a good deal more sense than the 2d… surely it must be possible!


May 21, 2012 | 4:21 pm

Ah, solved – nodes is the key!


May 21, 2012 | 4:22 pm

Have a look at the fun tab of the nodes help file. It’s quite straight forward to adapt it to fade between sound files.


May 21, 2012 | 4:39 pm

Hi all,

Nodes gives a quite elegant solution for a 2D-interface. You can also think about multichannel panning laws like vbap, which in this case do exactly what you want, assuming that the speakers are on a circle.

But I guess that Jason was initially looking for a 1D-solution, for example if all speakers are on a line, controlled by a 1D parameter only. In this case here is an example of solution:

– Pasted Max Patch, click to expand. –

The key is the use of "min" and "abs" in the expressions, so that all coefficients are constrained between 0 and 1. The square root aims at providing a constant power to the phantom source (-3dB law).

Alexis


May 21, 2012 | 4:54 pm

yeah, nodes is 2d … a fade between 1 and 2 will be something else than a fade between 1. and 3.


May 21, 2012 | 5:08 pm

Another solution…?

– Pasted Max Patch, click to expand. –

May 21, 2012 | 5:11 pm

These are great, Thanks guys.
J


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