play
Starts an instrument immediately and returns its instance.
Syntax
Initialization
definition is an InstrDef, such as a named instrument or a definition returned by create. The optional numeric arguments supply p4, p5 and the following p-fields.
voice refers to the new instance. play creates and initializes it during the caller's initialization, with p2 set to 0 and p3 set to -1. There is no start-time or duration argument.
Csound adds the instance to the end of its performance list, regardless of its instrument number. The returned reference is ready for use when play returns. Csound performs the instance automatically, so do not also call perf on it.
Use setp to change its p-fields, pause to pause and resume it, or turnoff to stop it. Arrange delete in the owning instrument for cleanup when that instrument ends. Use schedule when a note needs a start time and duration.
Examples
The controller starts a tone, pauses it for half a second and resumes it at a higher pitch. Its delete call cleans up the voice when the controller ends. It uses instance-controls.csd.
See also
create, schedule, pause, setp, turnoff, delete, Instrument definitions, instances and opcode objects
Credits
Author Victor Lazzarini.
New in Csound 7.