sflist~

Audio cue chooser

This examples shows a way to choose automatically from a list of preestablished sound cues, with a crossfade between cues rather than a sudden switch.

To do this we have two stereo sfplay~ objects, both of which refer to the same list of sound cues in an sflist~ object, named "cuelist". Instead of sending open and preload messages to each sfplay~ object, you can send those same messages to a single sflist~, and then the sfplay~ objects refer to that object by its name.

Six samples at six pitches at six tempi

In order for this patch to work properly, you'll need to first download the attached .zip archive of six short soundfiles, uncompress it, and put the sound files in the Max search path.

You'll also need to download the patch from the example Subpatch for paying sound cues from sflist~. Save it with the name "playsamples.maxpat" in the Max file search path.

Other Attachments: 

Sync Multiple sfplay~

The examples above show two different ways that you can trigger sound files while keeping in sync with a particular beat when the durations of the sound files are not perfect multiples of the beat duration, hence triggering the next sound file at the ending point of the current sound file results in the next sound file being started off the beat.

List audio cue points

To set a list of cue points in an audio file and have them played in order, use either sfplay~ (with a set of cues established by preload messages to sfplay~ or to sflist~) or buffer~ (with start messages to play~, the parameters of which are stored in a coll).

Polyphony requires multiple objects

Any given MSP patch cord represents a single channel of audio. If you want to generate or process multiple sounds or channels, you need to treat each sound or channel separately. For example, each sfplay~ object can have multiple loaded sound cues so that it's ready to play any one of several files, but it can only play one sound file at any given instant. And if it's a stereo file you need to treat each channel separately for mixing, processing, etc. This patch demonstrates that.