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

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.