Position-based sample playback (multichannel)


Use the play~ object as a playback interface for a buffer~. that plays back samples based on an offset within the buffer. It is typically used with the line~ object, but can be used with any signal that generates a changing position value in milliseconds. The groove~ object provides another option for sample playback.
When the play~ object is created as all of its signal signal outlets are combined into a single multichannel outlet. The behavior of is otherwise identical to play~.


buffer-name [symbol]

The first argument names the buffer~ object whose sample memory is used by play~ for playback.

number-of-output-channels [int]


Specifies the number of output channels. The default number of channels is one. If the buffer~ being played has fewer channels than the number of play~ output channels, the extra channels output a zero signal. If the buffer~ has more channels, channels are mixed.


interptime [float]

Sets the crossfade time for loop interpolation. If the value given is greater than the total loop duration, the total loop duration is used. The default crossfade duration is 50 milliseconds.

loop [int]

In loop mode, when playback reaches the end time (see start message) it continues again from the start time. Loop mode is off by default.

loopinterp [int]

Enables interpolation around the start and end points for a loop. By default, loop interpolation is off.

Common Box Attributes

Multichannel Group Attributes




start/stop-playback [int]
In left inlet: 1 (or non-zero value) begins playback of the currently set buffer~ object, and 0 stops playback.


Double-clicking on buffer~ opens a display window where you can view the contents of the buffer~. object that the play~ object references.


In left inlet: Sending the message pause causes the playback to pause at its current playback position. Playback can be restarted with the resume message.


In left inlet: If playback was paused, playback resumes from the paused point in the audio buffer.



buffer-name [symbol]
The word set, followed by the name of a buffer~ object, uses that buffer~ for playback.


In left inlet: The position (in milliseconds) into the sample memory of a buffer~ object from which to play. If the signal is increasing over time, play~ will play the sample forward. If it is decreasing, play~ will play the sample backward. If it remains the same, play~ outputs the same sample repeatedly, which is equivalent to a DC offset of the sample value.

The direction and speed of playback of a play~ object can be set using integer messages provided to the play~ object at signal rate. Typically, this is done using a line~ object.

Integer messages come in pairs - an initial integer that specifies the position in the buffer (in milliseconds) at which to start, followed by a second pair of numbers that specify the ending position in the buffer and the time (in milliseconds) over which the playback will occur. These messages are often sent as messages separated by a comma. Here are some examples:

0, 2000 2000- Starting at the beginning of the buffer, play 2 seconds of audio at normal speed
500, 0 500- Play the first half second of a buffer backwards at normal speed.
0, 1000 500- Play the first second of a buffer at double speed (i.e. transpose it up an octave)



start-time [list]
end-time [list]
duration [list]
In left inlet: The word start, followed by a start time in milliseconds, moves to the specified position in the current buffer~ and begins playing. After the start time, an optional end time can be specified, which will set a point for playback to stop. A third optional value can be provided to set the playback duration from the start point to the end point. When used without arguments, start will begin at the beginning of the buffer~ and play to the end (equivalent to using the integer value 1 to start playback). The start time may be greater than the end time, in order to play a segment of the buffer in reverse.


In left inlet: The stop message causes the playback to stop at its current playback position. (This is equivalent to sending the integer value 0 to stop playback).

Multichannel Group Messages



Sample output read from a buffer~. If play~ has two or four output channels, the left outlet's signal contains the left channel of the sample, and the other outlets' signals contain the samples from the additional channels.

See Also

Name Description
MSP Sampling Tutorial 1: Recording and Playback MSP Sampling Tutorial 1: Recording and Playback