perf
Execute a performance pass on an instrument or opcode.
Syntax
Performance
p4, ... -- instrument parameters (k-rate, or a-rate, which is truncated to a scalar)
err -- error code (0 if successful)
arg1, ... -- opcode arguments
var,... -- opcode outputs
These forms execute one performance pass of an instrument instance or opcode object.
For an Instr made with create, call init before perf so its initialization takes place at a known point. If the instance has not been initialized, perf attempts to initialize it on its first call using the same p-field arguments.
Do not call perf on an instance that Csound already performs through play, schedule or splice. That would perform it twice. A paused instance skips its performance code. Keep the instance in a compatible performance context, with the same sample rate as its caller.
Initialize an opcode object before calling perf if that opcode has an initialization routine. Use run to combine initialization and performance in one call, including for an Opcode[].
Optionally, parameters(pfields) are passed to an instrument perf() and are picked up at perf-time. They are normally
k-sig variables but can also be a-sigs in which case the vector is truncated to the first element.
For the opcode perf(), inputs and outputs are checked and should match the opcode object signature.
Examples
The following example shows the perf opcode in the context of instrument and opcode objects,
See also
create, init, pause, delete, Instrument definitions, instances and opcode objects