dial

Set minimum and maximum of two dials

This example shows how you can have two dials be “aware” of each other’s value, to constrain their minimum and maximum output. If you want to have two dials (or any user interface objects) that show a minimum value and a maximum value, but don’t want the minimum to exceed the maximum, you can use the value of the Min dial to constrain the minimum of the Max dial, and use the value of the Max dial to contrain the maximum of the Min dial.

Half speed and double speed

For specifying the rate of an audio file or the rate of a video file, the number 1 is used for normal rate, and we may want to be able to increase or decrease the rate by a certain ratio. For example we may want to double or halve the rate, setting it to either 2 times normal or 1/2 of normal.

Linear mapping of ranges

To translate numbers that occupy a particular range into an equivalent set of numbers in a different range, one common and useful technique is "linear mapping". The term "mapping" refers to making conceptual connections between elements of one domain and elements of another, and "linear" mapping refers to using a mapping function that is a straight line––that is, such that numbers in one domain are mapped to an exactly equivalent position in the new domain. This is a very common and useful operation in media programming.

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.