delay
Prev | Orchestra Opcodes and Operators | Next

## delay

delay — Delays an input signal by some time interval.

## Description

A signal can be read from or written into a delay path, or it can be automatically delayed by some time interval.

## Syntax

    ares delay asig, idlt [, iskip]

## Initialization

idlt -- requested delay time in seconds. This can be as large as available memory will permit. The space required for n seconds of delay is 4n * sr bytes. It is allocated at the time the instrument is first initialized, and returned to the pool at the end of a score section.

iskip (optional, default=0) -- initial disposition of delay-loop data space (see reson). The default value is 0.

## Performance

asig -- audio signal

delay is a composite of delayr and delayw, both reading from and writing into its own storage area. It can thus accomplish signal time-shift, although modified feedback is not possible. There is no minimum delay period.

## Examples

Here is an example of the delay opcode. It uses the files delay.orc and delay.sco.

Example 94. Example of the delay opcode.

    /* delay.orc */
    ; 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

      ; Delay the beep by .1 seconds.
      idlt = 0.1
      adel delay abeep, idlt

      ; Send the beep to the left speaker and
      ; the delayed beep to the right speaker.
      outs abeep, adel
    endin
    /* delay.orc */

    /* delay.sco */
    ; 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
    /* delay.sco */

## See Also

delay1, delayr, delayw

## Credits

Example written by Kevin Conder.

Prev | Up | Next
dconv | Home | delay1