sfplay~

Simple demonstration of flanging

The technique of flanging in computer music refers to a changing delay time applied to a sound, usually by modulating the delay time with a low-frequency oscillator (LFO). The continuously changing delay time causes a subtle—or not-so-subtle—change in the pitch of the sound. When the flanged sound is mixed with the original sound, the two sounds interfere in continuously changing ways, creating a charactistic modulated filtering effect.

MIDI mapping to amplitude

Mapping one range of values to another needed range of values is a crucial technique in computer music. In this example, we want to map MIDI data values that range from 0 to 127 into a useful range for controlling the amplitude—and thus the loudness—of a sound in MSP.

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.

Play a sound file with vibrato

To impose a vibrato (a periodic fluctuation of frequency) on the playback of a sound file, you can use a low-frequency oscillator (a cycle~ object) to modulate the playback speed of the file. The right inlet of the sfplay~ object controls the playback speed with a rate factor. A value of 1 is normal speed (the default), 2.0 is double speed, 0.5 is half speed, etc. The speed can be supplied as a constant number (float) or with a continuous signal.

Trigger sample with metro

This program triggers a sound repeatedly, and changes the sound's playback rate with each repetition. The sound file is so short that there's really no need to turn it off with a 0, so we just start it with a 1. The playback rate is calculated so as to cause a random transposition from -12 to +12 equal-tempered semitones, using the twelfth root of 2; the number of semitones (x) of transposition is determined by setting the rate to "2 to the x/12 power". You can put the patch into Presentation mode, which will present a cleaner user interface.