delayr
Reads from an automatically established digital delay line.
Syntax
Initialization
idlt -- requested delay time in seconds, rounded to the nearest whole sample. The buffer must hold at least ksmps samples. Its size is limited by available memory and uses floatsize bytes per sample.
iskip (optional, default=0) -- when zero, clear the buffer and reset its position at initialization. A nonzero value preserves an existing buffer and its position during reinitialization, ignoring changes to idlt. The first initialization still allocates a buffer.
indx (optional output) -- an i-rate index for selecting this reader with a delay tap. See Selecting a delay line.
Performance
delayr reads from an automatically established digital delay line, in which the signal retrieved has been resident for idlt seconds. This unit must be paired with and precede an accompanying delayw unit. Any other Csound statements can intervene.
Examples
Selecting a delay line
The optional second output lets a tap select an earlier delayr even after another reader has appeared. Pass it as the optional final argument to deltap, deltapi, deltapn, deltap3, deltapx or deltapxw.
Tap indices select among readers that have initialized but have not yet paired with a delayw. The default index 0 selects the newest reader. Positive indices count back from it, so 1 selects the previous reader. Negative indices count from the oldest reader, with -1 selecting the oldest and -2 the next. An out-of-range index causes an initialization error.
delayr returns a negative index. That index records its position among the pending readers, rather than a permanent buffer identifier. Initializing a delayw removes the oldest reader from that list and changes the remaining negative indices. Initialize taps that use the returned indices before any intervening delayw. Each tap keeps its chosen reader during performance.
The example below opens two delay lines, then selects each with its returned index. Both taps come before the writers. The first delayw writes to the first delayr, and the second writes to the second. The index only selects a tap's reader and does not change writer order.
It uses the file delayr-index.csd.
Feedback delay
Here is an example of the delayr opcode. It uses the file delayr.csd.