zdf_ladder
Prev | Orchestra Opcodes and Operators | Next

## zdf_ladder

zdf_ladder — Zero-delay feedback implementation of 4 pole ladder filter.

## Description

Zero-delay feedback implementation of a 4 pole (24 dB/oct) low-pass filter based on the Moog ladder filter.

## Syntax

    asig zdf_ladder ain, xcf, xQ [, istor]

## Initialization

istor --initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.

## Performance

asig -- output signal.

asig -- input signal.

xcf -- filter cutoff frequency (i-, k-, or a-rate).

xQ -- filter Q value (i-, k-, or a-rate). Range 0.5-25.0. Self-oscillation occurs at 25.0.

## Examples

Here is an example of the zdf_ladder opcode. It uses the file zdf_ladder.csd.

Example 1167. Example of the zdf_ladder opcode.

    <CsoundSynthesizer>
    <CsOptions>
    -o dac
    </CsOptions>
    <CsInstruments>

    sr	=	48000
    ksmps	=	1
    nchnls	=	2
    0dbfs	=	1

    instr 1
      asig = random:a(-1.0, 1.0)
      asig = zdf_ladder(asig, expon(220, p3, 5000), p4)
      outc(asig, asig)
    endin

    instr 2
      asig = vco2(0.5, 220)
      asig = zdf_ladder(asig, expon(220, p3, 5000), p4)
      outc(asig, asig)
    endin

    instr 3
      asig = vco2(0.5, p4)
      asig = zdf_ladder(asig, expon(5000, p3, 200), 0.5 + p5* 24)
      asig *= madsr(0.05, 0, 1, 0.25)
      outc(asig, asig)
    endin

    instr play_instr3
      schedule(3, 0, 0.25, mtof(48 + (p4 % 2) * 12), p4 / 16)

      if(p4 < 16) then
        schedule("play_instr3", 0.25, 0.25, p4 + 1)
      else
        event_i("e", 0.5,0)
      endif
      turnoff
    endin

    </CsInstruments>
    <CsScore>
    i1 0 2 0.5
    i1 + . 1
    i1 + . 4
    i1 + . 10
    i1 + . 18
    i1 + . 24.5
    i2 12 2 0.5
    i2 + . 1
    i2 + . 4
    i2 + . 10
    i2 + . 18
    i2 + . 24.5

    s
    i "play_instr3" 0 0.25 0
    f0 60
    </CsScore>
    </CsoundSynthesizer>

## References

This filter is based on the work of Will Pirkle that employs Vadim Zavalishin's work with bilinear tranforms to create topology-preserving transform (TPT) implementations of analog filters.

1. Pirkle, Will. Designing Software Synthesizer Plug-ins in C++: For RackAFX, VST3, and Audio Units. CRC Press, 2014.

2. Pirkle, Will. AN-4: Virtual Analog (VA) Filter Implementation. 2013.

3. Zavalishin, Vadim. "The Art of VA filter design." Native Instruments, 2012.

## Credits

Author: Steven Yi
April 2017

New in Csound 6.09.0

Prev | Up | Next
zdf_2pole_mode | Home | zfilter2