schedule

schedule --  Adds a new score event.

Description

Adds a new score event.

Syntax

schedule insnum, iwhen, idur [, ip4] [, ip5] [...]

Initialization

insnum -- instrument number. Equivalent to p1 in a score i statement.

iwhen -- start time of the new event. Equivalent to p2 in a score i statement.

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

ip4, ip5, ... -- Equivalent to p4, p5, etc., in a score i statement.

Performance

ktrigger -- trigger value for new event

schedule adds a new score event. The arguments, including options, are the same as in a score. The iwhen 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 schedule opcode. It uses the files schedule.orc and schedule.sco.

Example 1. Example of the schedule opcode.

/* schedule.orc */
/* Written by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1 - oscillator with a high note.
instr 1
  ; Play Instrument #2 at the same time.
  schedule 2, 0, p3

  ; Play a high note.
  a1 oscils 10000, 880, 1
  out a1
endin

; Instrument #2 - oscillator with a low note.
instr 2
  ; Play a low note.
  a1 oscils 10000, 220, 1
  out a1
endin
/* schedule.orc */
        
/* schedule.sco */
/* Written by Kevin Conder */
; Table #1, a sine wave.
f 1 0 16384 10 1

; Play Instrument #1 for half a second.
i 1 0 0.5
; Play Instrument #1 for half a second.
i 1 1 0.5
e
/* schedule.sco */
        

See Also

schedwhen

Credits

Author: John ffitch

Location: University of Bath/Codemist Ltd. Bath, UK

Published: November, 1998 (New in Csound version 3.491)

Based on work by Gabriel Maldonado