mc.playlist~

Play sound files with multichannel output

Description

Use mc.playlist~ to organize sound files and play them back using multichannel outputs. Each file's waveform is shown in a clip where you can select a portion of the file for playback. Drag clips within an mc.playlist~ to re-order them, or drag clips to other mc.playlist~ objects by using the dotted handle on the clip's left edge.

Examples

Arguments

None.

Attributes

accentcolor [4 floats]

Controls Off Color

allowreorder [int] (default: 2)

The allowreorder attribute controls whether the user is allowed to drag clips to re-order them.

Possible values:

0 = 'Off' ( Disable reordering )
1 = 'On' ( Enable reordering )
2 = 'Automatic' ( Enable reordering for multiple clips )

bgcolor [4 floats]

Background Color

channelcount [int] (default: 2)

The channelcount sets the number of audio channels used for playback. mc.playlist~ will output a multichannel signal with the number of channels set to channelcount irrespective of whether the specified number of channels exist in the audio file it is playing. Additional channels, if any, are set to zero. Any change in the number of output channels in the output multichannel signal will not take effect until the audio is restarted.

clipheight [float] (default: 30.)

The clipheight attribute sets the height of each clip. The actual clip height may change when dragging new clips into the playlist~ according to the value of the expansion mode.

color [4 floats]

Waveform/Controls Color

elementcolor [4 floats]

Clip Divider Color

expansion [symbol] (default: squeeze)

The expansion attribute controls the way mc.playlist~ resizes existing clips when new clips are added to the list.

Possible values:

'squeeze' ( Maintain the size of the box and reduce the height of all clips to make room. )
'static' ( Maintain both the size of the box and the height of all clips. mc.playlist~ will add a scroll as needed. )

loopreport [int] (default: 0)

Loop Report

reportprogress [int] (default: 0)

Report Progress

selectioncolor [4 floats]

Selection Color

showname [int] (default: 1)

Show File Name

style [symbol] (default: )

Sets the style to be applied to the object. Styles can be set using the Format palette.

textcolor [4 floats]

Text Color

waveformdisplay [int] (default: 1)

Display style for sound file waveforms that represent each clip.

Possible values:

0 = 'Bi-Polar' ( Display positive and negative waveform amplitude values )
1 = 'Rectified' ( Display the waveform with only positive amplitude )

Common Box Attributes

annotation [symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background [int] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color [4 floats]

Sets the color for the object box outline.

fontface [int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic

Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname [symbol]

Sets the object's font.

fontsize [float]

Sets the object's font size (in points).

Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

hint [symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick [int] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation [int] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 0. 0. 0. 0.)

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect [4 floats]

g/s(set)

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size [2 floats]

g/s(set)

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor [float]

Sets the color for the object's text in RGBA format.

textjustification [int]

Text Justification

Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname [symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

Messages

int

Arguments

clip [int]
0 stops soundfile playback. A number greater than zero begins playback of the clip with that index. Indices begin counting at 1.

append

Arguments

soundfile [symbol]
clip-number [int]
Add a new soundfile to the list. The first (optional) argument specifies the soundfile name. Second (optional) argument specifies the slot number for the clip (starting at 1). If no arguments are listed, clicking the append message in a locked patcher will open a dialog box where you can choose a file to append.

basictuning

Arguments

frequency [number]
Sets a tuning standard based on a frequency for A for pitch correction operations (440 = default, range is 400 - 500)

clear

The clear message removes all clips. To remove a single clip, use the remove message or right-click on the desired clip, then choose "Remove" from the contextual menu.

(drag)

The mc.playlist~ object accepts drags of audio files or clips from other playlist~ objects; depending on where you release the drag you can replace a clip or insert a file between two clips.

followglobaltempo

Arguments

follow state [int]
followglobaltempo 1 or 0 sets the followglobaltempo attribute of the sfplay~ object within mc.playlist. When enabled, soundfile playback will use a ratio between the original tempo and the current transport tempo and adapt to tempo changes.

formant

Arguments

amount [float]
The word formant, followed by floating point value, sets the format attribute of the sfplay~ object with mc.playlist~, which sets the amount of formant scaling when pitchshifting is performed.

formantcorrection

Arguments

amount [int]
The word formantcorrection, followed by 1 or 0, sets the formantcorrection attribute of the sfplay~ object with mc.playlist~, which will enable or disable formant correction when pitch correction is performed.

getcontent

Output current clip list as a dictionary

loop

Arguments

clip [int]
loop [int]
The loop message turns looping on or off for a clip. The first argument is a clip index (starting at 1). The second argument is 1 to turn on looping or 0 to turn it off.

mode

Arguments

type [int]
The word mode followed by a number sets the mode attribute of the sfplay~ object within mc.playlist. For more information on these modes refer to the sfplay~ object.

(mouse)

Use the mouse to play your sample, stop it, loop it and to select parts of it for playback.

next

The next message plays the next clip in the list.

originallength

Arguments

length [float]
The word originallength followed by a number sets the originallength attribute of the sfplay~ object within mc.playlist, which sets the original length of the audio file in beats. This value is used by the followglobaltempo feature of sfplay~ to calculate playback rate in relation to the global transport. Changing the originallength vale will recalculate the originaltempo value.

originallengthms

Arguments

length [float]
The word originallengthms followed by a number sets the originallengthms attribute of the sfplay~ object within mc.playlist, which sets the original length of the audio file in milliseconds. This value is used by the followglobaltempo feature of sfplay~ to calculate playback rate in relation to the global transport. Changing the originallengthms vale will recalculate the originaltempo value.

originaltempo

Arguments

tempo [float]
The word originaltempo, followed by a number, sets the originaltempo attribute of the sfplay~ object within mc.playlist, which sets the original tempo of the the audio file. This value is used by followglobaltempo to calculate playback rate in relation to the global transport. Changing the originaltempo will recalculate the originallength value.

pause

Pause playback of the current clip at the current position.

pitchcorrection

Arguments

on/off [int]
The word pitchcorrection followed by a 1 or 0 enable or disables the pitchcorrection attribute of the sfplay~ object within mc.playlist, enabling or disabling formant-corrected chromatic intonation correction. For more extensive real-time intonation correction, use the retune~ object.

pitchshift

Arguments

factor [float]
The word pitchshift followed by a number sets the pitchshift attribute of the sfplay~ object within mc.playlist. The pitch shifting factor is based on the original pitch (for example, a factor of 2 doubles the pitch while 0.5 halves it).

pitchshiftcent

Arguments

cents [int]
The word pitchshiftcent followed by a value in cents sets the pitchshiftcent attribute of the sfplay~ object within mc.playlist. This specifies pitch shifting as positive or negative cent values (i.e. 100 = semitone up, -1200 = octave down). Cents may be specified as ints or floats.

play

The word play is ignored by the mc.playlist~ object.

quality

Arguments

quality [int]
The word quality followed by a number sets the quality attribute of the sfplay~ object within mc.playlist, which sets the quality of time stretching output. For more information refer to the sfplay~ object.

refresh

The word refresh redraws the object and outputs its current content as a dictionary (as does getcontent).

remove

Arguments

clip-number [int]
The word remove, followed by a clip number starting at 1, removes that clip from the list.

resume

Resumes playback from the current position if playback has been paused.

selection

Arguments

clip [int]
start [float]
end [float]
Select playback endpoints for a clip using a normalized range (0.0 is the beginning, 1.0 is the end). First argument specifies which clip (starting at 1). Second argument is the start point for the clip. Third argument is the end point for the clip.

signal

Signal connections to mc.playlist~ are ignored.

slurtime

Arguments

time [float]
The word slurtime followed by a number, sets the value of the slurtime attribute of the sfplay~ object within mc.playlist. The slur time is the time it takes for the correction to reach the full correction amount. Typically, notes are a bit unstable at the beginning, because the attack phase of a sound has a higher amount of noise, and because singers gradually adjust their tuning after the onset of the note. The slur time makes the pitch correction sound natural because it models this effect. Higher values will yield a slower adaptation time and it will take longer for the correction to produce the corrected pitch. However, longer slur times will also preserve vibrato better.

speed

Arguments

clip [int]
speed [float]
Set playback speed for a clip. First argument specifies which clip (starting at 1). Second argument is the rate (1.0 = original speed, 0.5 = half-speed, etc).

timestretch

Arguments

on/off [int]
The word timestretch followed by 1 or 0 enables or disables the timestretch attribute of the sfplay~ object within mc.playlist, which turns time stretched playback on or off.

Output

dictionary

The right outlet sends a dictionary summary of the current content in response to the getcontent message.

list

The mouse message is sent together with normalized mouse coordinates and the mouse button state.

list

The second from right outlet sends the message start followed by a clip index and name when a clip starts playing and done followed by a clip index and name when a clip stops playing.

signal

mc.playlist~ outputs a multichannel signal with a number of channels specified by the channelcount attribute.

The third outlet provides a single-channel sync signal. The integer part of the signal value is the index of the clip that is playing. The fractional part is the instantaneous position within that clip.

See Also

Name Description
playlist~ Play sound files
jit.playlist Play video files
sfplay~ Play audio file from disk
waveform~ buffer~ viewer and editor
MC Audio Sources MC Audio Sources
MC MC