delayw writes asig into the delay area established by the preceding delayr unit. Viewed as a pair, these two units permit the formation of modified feedback loops, etc. However, there is a lower bound on the value of idlt, which must be at least 1 control period (or 1/kr).
Here is an example of the delayw opcode. It uses the files delayw.orc and delayw.sco.
Example 1. Example of the delayw opcode.
/* delayw.orc */
/* Written by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2
; Instrument #1 -- Delayed beeps.
instr 1
; Make a basic sound.
abeep vco 20000, 440, 1
; Set up a delay line.
idlt = 0.1
adel delayr idlt
; Write the beep to the delay line.
delayw abeep
; Send the beep to the left speaker and
; the delayed beep to the right speaker.
outs abeep, adel
endin
/* delayw.orc */
/* delayw.sco */
/* Written by Kevin Conder */
; Table #1, a sine wave.
f 1 0 16384 10 1
; Keep the score running for 2 seconds.
f 0 2
; Play Instrument #1.
i 1 0.0 0.2
i 1 0.5 0.2
e
/* delayw.sco */