A newer version of Max is available. Click here to access the latest version of this document.

groove~

Variable-rate looping sample playback

Description

groove~ is a variable-rate, looping, sample-playback object which references the audio information stored in a buffer~ object carrying the same name.

Arguments

Name Type Opt Description
buffer-name symbol Obligatory. Names the buffer~ object containing the sample to be used by groove~ for playback.
number-of-outputs int opt A second argument may specify the number of output channels: 1, 2, or 4. The default number of channels is 1. If the buffer~ being played has fewer channels than the number of groove~ output channels, the extra channels output a zero signal. If the buffer~ has more channels, channels are mixed.

Messages

int sample-playback-position (milliseconds) [int]
In all inlets: Converted to float.
float sample-playback-position (milliseconds) [float]
In left inlet: Sets the sample playback position in milliseconds. 0 sets the playback position to the beginning.
In middle inlet: Sets the sample playback start position in milliseconds.
In right lnlet: Sets the sample playback start position in milliseconds.
list list of timing values [list]
In middle and right inlets: A list composed of three integers specifying bars, beats, and units may be used to specify loop start and end points when the groove~ object is set to follow a named transport (set using the transport attribute).
anything list of timing values [list]
In middle and right inlets: Equivalent to list.
(mouse) Double-clicking on a groove~ object opens the sample display window of the buffer~ object associated with the groove~ object.
loop behavioral-flag (0 or 1) [int]
The word loop, followed by 1, turns on looping. loop 0 turns off looping. By default, looping is off.
loopinterp behavioral-flag (0 or 1) [int]
The word loopinterp, followed by 1, enables interpolation about start and end points for a loop. loop 0 turns off loop interpolation. By default, loop interpolation is off.
set behavioral-flag (0 or 1) [int]
The word set, followed by a symbol, switches the buffer~ object containing the sample to be used by groove~ for playback.
reset Clears the start and end loop points.
setloop start and end-points (milliseconds) [list]
The word setloop, followed by two numbers, sets the start and end loop points in milliseconds.
signal In left inlet: Defines the sample increment for playback of a sound from a buffer~. A sample increment of 0 stops playback. A sample increment of 1 plays the sample at normal speed. A sample increment of -1 plays the sample backwards at normal speed. A sample increment of 2 plays the sample at twice the normal speed. A sample increment of .5 plays the sample at half the normal speed. The sample increment can change over time for vibrato or other types of speed effects. The groove~ object uses the buffer~ sampling rate to determine playback speed.

If a loop start and end have been defined for groove~ and looping is turned on, when the sample playback reaches the loop end the sample position is set to the loop start and playback continues at the current sample increment.

In middle inlet: Sets the starting point of the loop in milliseconds.

In right inlet: Sets the end point of the loop in milliseconds.
startloop Causes groove~ to begin sample playback at the starting point of the loop. If no loop has been defined, groove~ begins playing at the beginning.
stop The word stop will cause groove~ to stop playback until the next int, float, or startloop message is received.

Attributes

Name Type g/s Description
loopend atom Sets the loop end point. The end point time can be specified in any of the Max time formats.
loopstart atom Sets the loop start point. The start point time can be specified in any of the Max time formats.
transport symbol Sets the name of a transport object with which to associate. By default, the global transport is used. When the groove object is associated with a transport, loop points are specified using 3-item lists which correspond to time in bars, beats, and units.

Information for box attributes common to all objects

Output

signal: Out left outlet: Sample output. If groove~ has two or four output channels, the left outlet plays the left channel of the sample.

Out middle outlets: Sample output. If groove~ has two or four output channels, the middle outlets play the channels other than the left channel.

Out right outlet: Sync output. During the loop portion of the sample, this outlet outputs a signal that goes from 0 when the loop starts to 1 when the loop ends.

Examples

See Also

Name Description
2d.wave~ Two-dimensional wavetable
buffer~ Store audio samples
play~ Position-based sample playback
record~ Record sound into a buffer
transport Control a master clock and report time values.
MSP Tutorial 14: Playback with Loops MSP Tutorial 14: Playback with Loops
MSP Tutorial 20: MIDI Sampler Control MSP Tutorial 20: MIDI Sampler Control