OPCODE GUIDE: INSTRUMENT CONTROL
SCORE PARAMETER ACCESS
p(x) gets the value of a specified p-field. (So, 'p(5)' and 'p5' both return the value of the fifth parameter in a certain score line, but in the former case you can insert a variable to specify the p-field.
pindex does actually the same, but as an opcode instead of an expression.
pset sets p-field values in case there is no value from a scoreline.
passign assigns a range of p-fields to i-variables.pcount returns the number of p-fields belonging to a note event.
TIME AND TEMPO
Time Readingsetscorepos sets the playback position of the current score performance to a given position.
tempo allows the performance speed of Csound scored events to be controlled from within an orchestra.
miditempo returns the current tempo at k-rate, of either the midi file (if available) or the score.
tempoval reads the current value of the tempo.
ihold forces a finite-duration note to become a 'held' note.
Time Signal Generators
metro outputs a metronome-like control signal (1 value impulses separated by zeroes). Rate of impulses can be specified as impulses per secondmpulse generates an impulse for one sample of user definable amplitude, followed by a user-definable time gap.
CONDITIONS AND LOOPS
changed reports whether any of its k-rate variable inputs has changed.
trigger informs whether a k-rate signal crosses a certain threshold, either in an upward direction, in a downward direction or both.
if branches conditionally at initialisation or during performance time.loop_lt, loop_le, loop_gt and loop_ge perform loops either at i-time or at k-rate.
init initializes a k- or a-variable (assigns a value to a k- or a-variable which is valid at i-time).
igoto jumps to a label at i-time.
kgoto jumps to a label at k-rate.reinit / rigoto / rireturn forces a certain section of code to be reinitialised (i.e. i-rate variables will be refreshed).
scoreline_i / scoreline: Generate an instrument at i-time (scoreline_i) or at k-time (scoreline). Like event_i/event, but you can send to more than one instrument but unlike event_i/event you can send strings. On the other hand, you must usually pre-format your scoreline-string using sprintf.
schedkwhen triggers an instrument event at k-time if a certain condition is given.
timedseq is an event-sequencer in which time can be controlled by a time-pointer. Sequence data is stored in a function table or text file.
Instances And Allocation
active returns the number of active instances of an instrument.
maxalloc limits the number of allocations (instances) of an instrument.prealloc creates space for instruments but does not run them.
Turning On And Off
turnon activates an instrument for an indefinite time.
mute mutes/unmutes new instances of a given instrument.
remove removes the definition of an instrument as long as it is not in use.exitnow causes Csound to exit as fast as possible and with no cleaning up.
nstrnum returns the number of a named instrument.
SIGNAL EXCHANGE AND MIXING
chnset writes a value (i, k, S or a) to a software channel (which is identified by a string as its name).
chnget gets the value of a named software channel.
chnmix writes audio data to an named audio channel, mixing to the previous output.chnclear clears an audio channel of the named software bus to zero.
zakinit initialised zak space for the storage of zak variables.