schedwhenInstrument Control:Invocationschedwhenschedwhen
Adds a new score event.
Description
Adds a new score event.
Syntaxschedwhen ktrigger, kinsnum, kwhen, kdur [, ip4] [, ip5] [...]schedwhen ktrigger, "insname", kwhen, kdur [, ip4] [, ip5] [...]Initializationip4, ip5, ... -- Equivalent to p4, p5, etc., in a score i statement.
Performancekinsnum -- instrument number. Equivalent to p1 in a score i statement.
insname -- A string (in double-quotes) representing a named instrument.
ktrigger -- trigger value for new event
kwhen -- start time of the new event. Equivalent to p2 in a score i statement.
kdur -- duration of event. Equivalent to p3 in a score i statement.
schedwhen adds a new score event. The event is only scheduled when the k-rate value ktrigger is first non-zero. The arguments, including options, are the same as in a score. The kwhen time (p2) is measured from the time of this event.
If the duration is zero or negative the new event is of MIDI type, and inherits the release sub-event from the scheduling instruction.
Note that the schedwhen opcode can't accept string p-fields. If you need to pass strings when instantiating an instrument, use the scoreline or scoreline_i opcode.Examples
Here is an example of the schedwhen opcode. It uses the file schedwhen.csd.
Example of the schedwhen opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoInstrument InvocationCreditsAuthor: &namejohn;University of Bath/Codemist Ltd.Bath, UKNovember 1998New in Csound version 3.491Based on work by &namegabriel;