Use Non-Frames Version Previous Page Next Page
Signal Modifiers: Delay

deltapx, deltapxw


  ar      deltapx    adel, iwsize

          deltapxw   asig, adel, iwsize	


Description

These units read from (deltapx) and write to (deltapxw) a <strong>delayr/delayw delay line using higher quality interpolation than other delay units.

Initialization

iwsize – interpolation window size in samples. Allowable values are integer multiplies of 4 in the range 4 to 1024. When iwsize = 4, cubic interpolation is used. Increasing iwsize improves sound quality at the expense of CPU usage, and minimum delay time (See Example 1, below).

Note: Window sizes for opcodes other than deltapx are:

Performance

adel – delay time in seconds

asig – input signal to be delayed

deltapxw adds the input signal to the delay line at adel seconds. This opcode can be mixed with delay line read units (deltap, deltapn, deltapi, deltap3, and deltapx) in any order. The actual delay time is the difference between the read and write times.

Examples

Example 1. For calculation of delay times:


  a1      delayr     idlr

          deltapxw   a2, adl1, iws1

  a3      deltapx    adl2, iws2

          deltapxw   a4, adl3, iws3

          delayw     a5

Calculation of minimum and maximum delay times for Example 1 are as follows:

Delay line length:
  idlr >= 1/kr

Write before read:
  adl1 >= (iws1/2)/sr

Write before read, allowing shorter delays:
  adl1 <= idlr - (1 + iws1/2)/sr

Read times:
  adl2 >= 1/kr + (iws2/2)/sr
  adl2 <= idlr - (1 + iws2/2)/sr
  adl2 >= adl1 + (iws1 + iws2) / (2*sr)
  adl2 >= 1/kr + adl3 + (iws2 + iws3) / (2*sr)

Write after read:
  adl3 >= (iws3/2)/sr

Write after read, allowing feedback:
  adl3 <= idlr - (1 + iws3/2)/sr

Example 2


  a1      phasor     300.0

  a1      =          a1 - 0.5

  a_      delayr     1.0

  adel    phasor     4.0

  adel    =          sin (2.0 * 3.14159265 * adel) * 0.01 + 0.2

          deltapxw   a1, adel, 32

  adel    phasor     2.0

  adel    =          sin (2.0 * 3.14159265 * adel) * 0.01 + 0.2

          deltapxw   a1, adel, 32

  adel    =          0.3

  a2      deltapx    adel, 32

  a1      =          0

          delayw     a1



          out        a2 * 20000.0

Author

Istvan Varga
August 2001
New in Csound 4.13


Use Non-Frames Version Previous Page Next Page
Signal Modifiers: Delay