schedulek

schedulek — Adds a new score event.

Description

Adds a new score event.

Syntax

schedulek knsnum, kwhen, kdur [, kp4] [, kp5] [...]
schedulek "insname", kwhen,
    kdur [, kp4] [, kp5] [...]
schedule kPar[]

Performance

knsnum -- instrument number. Equivalent to p1 in a score i statement. knsnum must be a number greater than the number of the calling instrument.

insname -- A string (in double-quotes) representing a named instrument.

kwhen -- start time of the new event. Equivalent to p2 in a score i statement. kwhen must be nonnegative. If kwhen is zero, insum must be greater than or equal to the p1 of the current instrument.

kdur -- duration of event. Equivalent to p3 in a score i statement. .

kPar[] -- event parameters as a k-rate array. .

kp4, kp5, ... -- Equivalent to p4, p5, etc., in a score i statement. The opcode also accepts strings as arguments for p4-pN.

schedulek adds a new score event. 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.

Examples

Here is an example of the schedulek opcode. It uses the file schedulek.csd.

Example 953. Example of the schedule opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac      ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o schedulek.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; By Stefano Cucchi 2024
sr = 44100	
ksmps = 32	
nchnls = 2		
0dbfs  = 1		

instr 1

kfreqnote randomh 0.1, 6.3, 2
kTrigger  metro   kfreqnote 
if kTrigger == 1 then ;

schedulek 10, 0, 0.1 ;call the instrument
endif

endin

instr 10

a1 oscili 0.2, 440, 2
outs a1, a1

endin

</CsInstruments>
<CsScore>
f 2 0 4096 10 1 0.9 0.8 0.7 0.6

i 1 0 10
e
</CsScore>
</CsoundSynthesizer> 


A musical example featuring the schedulek opcode: Schedulek_Heintz.csd by Joachim Heintz.

See also

Instrument Invocation

Credits

Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
January 2020