Reference | Common methods


Start a process


The play message is of common use in sc. Different objects respond to it in various ways, but the simple meaning is: start a process. It is usually implemented by objects in contributed libraries as well.

play usually returns the playing object which might not be the same as the one the message was sent to.

opposite: stop

Clocks, Routines, Streams and Patterns

For a full list of which classes that implements play, see Methods: play (stream)

returns: the clock

See Clock: *play (clock)

returns: the routine

See Routine: -play (clock)

returns: the stream

the stream will loop until it returns nil

See FuncStream: -play (clock) / (clock)

returns: the stream

See Stream: -play and Task: -play (clock, protoEvent)

returns: an EventStreamPlayer

See Pattern: -play

Playing single Synths from SynthDefs on the server

The following play messages both cause a SynthDef to be written, send it to the server and start a synth with it there.

NOTE: Some UGens are added in this process.

Also note that they should not be used in quickly running automated processes, as there are more efficient alternatives ( see SynthDefs versus Synths ) (target, outbus, fadeTime, addAction, args)

returns: a Synth

outbuson what bus to play (default: 0)
fadeTimein what time to fade out when released (default: 0.02)
addActionwhere to add the node (\addToHead by default)
argscontrols to set when starting the synth

See Function: -play (target, args, addAction)

returns: a Synth

Note that you need an out ugen to hear the result. Examples of how to write to the busses in the helpfiles: Out / ReplaceOut / XOut / OffsetOut

Nevertheless, synths can also run without any writing activity: (see e.g. SendTrig)

Some operations provide an out ugen internally: see for example, which plays out to a bus number provided in the argument passed to .play

See SynthDef: -play

NOTE: is synonymous, for backwards compatibility with sc2