Using buttons to toggle between audio sources

Ryan Prokaza's icon

I'm very new to max, so this may seem a silly question:

I've created a fm synth and want it to play mono and major and minor chords, obviously not at the same time. So how can you switch between them via a toggle or buttons?

I feel i maybe missing an object or two that i haven't come across yet.

Igneous Rock's icon

In tutorial 5 (https://docs.cycling74.com/max5/tutorials/msp-tut/mspchapter05.html) the [selector~] object is introduced. It's the signal equivalent of the [switch] object.

Christopher Dobrian's icon

Although the [selector~] solution shown in MSP Tutorial 5 is okay, it can cause a click when switching from one inlet to another. It's better to do a quick crossfade between the two sounds.

On the page http://music.arts.uci.edu/dobrian/IAP2006/examples.htm scroll down to the examples called "A-B audio crossfade 1", "xfade~ (a useful subpatch)", and "A-B audio crossfade 2 (using the xfade~ subpatch)".