pink.filters

atone

(atone afn cutoff)
A hi-pass filter whose transfer functions are the complements of the tone function (based on Csound's atone opcode). 

For further information, see: http://csound.github.io/docs/manual/atone.html

biquad-bpf

(biquad-bpf afn center-freq Q)
tdf2 Biquad-based bandpass filter. 

afn - audio function signal to filter
center-freq - frequency in Hz for band pass center 
Q - q of filter

biquad-highshelf

(biquad-highshelf afn cutoff-freq Q db-gain)
tdf2 Biquad-based highshelf filter. 

afn - audio function signal to filter
cutoff-freq - frequency in Hz for cutoff 
Q - q of filter
db-gain - gain in db for boost or cut

biquad-hpf

(biquad-hpf afn cutoff-freq Q)
tdf2 Biquad-based highpass filter. 

afn - audio function signal to filter
cutoff-freq - frequency in Hz for cutoff
Q - q of filter

biquad-lowshelf

(biquad-lowshelf afn cutoff-freq Q db-gain)
tdf2 Biquad-based lowshelf filter. 

afn - audio function signal to filter
cutoff-freq - frequency in Hz for cutoff 
Q - q of filter
db-gain - gain in db for boost or cut

biquad-lpf

(biquad-lpf afn cutoff-freq Q)
tdf2 Biquad-based lowpass filter. 

afn - audio function signal to filter
cutoff-freq - frequency in Hz for cutoff
Q - q of filter

biquad-notch

(biquad-notch afn center-freq Q)
tdf2 Biquad-based notch filter. 

afn - audio function signal to filter
center-freq - frequency in Hz for notch center 
Q - q of filter

biquad-peaking

(biquad-peaking afn cutoff-freq Q db-gain)
tdf2 Biquad-based peaking filter. 

afn - audio function signal to filter
cutoff-freq - frequency in Hz for peak cutoff 
Q - q of filter
db-gain - gain in db for boost or cut

butter-filter

macro

(butter-filter cut asig out indx a1 a2 a3 a4 a5 a6 a7)

butterb-filter

macro

(butterb-filter cf bw asig out indx a1 a2 a3 a4 a5 a6 a7)

butterbp

(butterbp afn center-freq bandwidth)

butterbr

(butterbr afn center-freq bandwidth)

butterhp

(butterhp afn cutoff)

butterlp

(butterlp afn cutoff)

comb

(comb afn reverb-time loop-time)
Feedback Comb filter using fractional delay-line. reverb-time is time in
seconds to decay 60db. loop-time is the length of the delay in seconds, which
creates peaks at loop-time * sr/2, from 0 to sr/2 (Nyquist). loop-time is a
static value, but reverb-time can be static or dynamic. 

(NOTE: Only static reverb-time supported at the moment...)

combinv

(combinv afn reverb-time loop-time)
Feedforward Comb filter using fractional delay-line. reverb-time is time in
seconds to decay 60db. loop-time is the length of the delay in seconds, which
creates peaks at loop-time * sr/2, from 0 to sr/2 (Nyquist). loop-time is a
static value, but reverb-time can be static or dynamic. 

(NOTE: Only static reverb-time supported at the moment...)

diode-ladder

(diode-ladder afn cutoff k)(diode-ladder afn cutoff k non-linear-processing saturation)
24db/oct low-pass diode ladder filter (found in EMS VCS3 and Roland TB-303).

Based on code by Will Pirkle, presented in:

http://www.willpirkle.com/Downloads/AN-6DiodeLadderFilter.pdf

[ARGS]

afn - audio function input
cutoff - frequency of cutoff
k - filter resonance (self-oscillation occurs at k=17)
non-linear-processing - type of non-linear processing
(0 - none, 1 - normalized, 2 - non-normalized)
saturation - used with non-linear-processing

k35-hpf

(k35-hpf afn cut Q)(k35-hpf afn cut Q non-linear-processing saturation)
6db/oct high-pass filter based on Korg 35 module
(found in MS-10 and MS-20).

Based on code by Will Pirkle, presented in:

http://www.willpirkle.com/Downloads/AN-7Korg35HPF_V2.pdf

[ARGS]

afn - audio function input
cutoff - frequency of cutoff
Q - filter Q [0, 10.0] (k35-hpf will clamp to boundaries)

k35-lpf

(k35-lpf afn cut Q)(k35-lpf afn cut Q non-linear-processing saturation)
12db/oct low-pass filter based on Korg 35 module
(found in MS-10 and MS-20).

Based on code by Will Pirkle, presented in:

http://www.willpirkle.com/Downloads/AN-5Korg35_V3.pdf

[ARGS]

afn - audio function input
cutoff - frequency of cutoff
Q - filter Q [1, 10.0] (k35-lpf will clamp to boundaries)

lpf18

(lpf18 afn cutoff resonance distortion)
Josep Comajuncosas' 18dB/oct resonant 3-pole LPF with tanh dist.
Coded in C by John ffitch, 2000 Dec 17, for Csound 
Translated to Clojure by Steven Yi.

http://csound.github.io/docs/manual/lpf18.html

moogladder

(moogladder afn cutoff resonance)
Moogladder is a digital implementation of the Moog ladder filter based on
the work of Antti Huovilainen, described in the paper "Non-Linear Digital
Implementation of the Moog Ladder Filter" (Proceedings of DaFX04, Univ of
Napoli). This implementation is probably a more accurate digital
representation of the original analogue filter.  

Translation of Csound moogladder opcode, written by Victor Lazzarini.

http://csound.github.io/docs/manual/moogladder.html

one-pole

(one-pole afn p)
One-pole filter (aka "leaky integrator").

p = pole location = feedback coefficient
Difference equation: y(n) = x(n) + p * y(n-1)
Reference: https://ccrma.stanford.edu/~jos/filters/One_Pole.html

Based on code from Faust's filter.lib by Julius O. Smith

one-zero

(one-zero afn z)
One-zero filter.

z = location of zero along real axis in z-plane
Difference equation: y(n) = x(n) - z * x(n-1)
Reference: https://ccrma.stanford.edu/~jos/filters/One_Zero.html

Based on code from Faust's filter.lib by Julius O. Smith

port

(port afn half-time)
Apply portamento to step-wise signal via low-pass filtering.

statevar

(statevar afn freq res)(statevar afn freq res oversampling)
Statevar is a digital implementation of the analogue state-variable
filter. This filter has four simultaneous outputs: high-pass, low-pass,
band-pass and band-reject. This filter uses oversampling for sharper
resonance (default: 3 times oversampling). It includes a resonance limiter
that prevents the filter from getting unstable.

Translation of Csound statevar opcode, written by Victor Lazzarini.

http://csound.github.io/docs/manual/statevar.html

tdf2-macro

macro

(tdf2-macro afn fc q db-gain coef-calcs)
Transposed Direct Form II version of biquad filter. 

Based on C++ version by Nigel Redmon:
http://www.earlevel.com/main/2012/11/26/biquad-c-source-code/

Macro form used for biquad-x filters.  Handles updating of coefficients only
when Fc, Q, or db-gain has changed.

THERMAL

tone

(tone afn cutoff)
A first-order recursive low-pass filter with variable frequency response. (based on Csound's tone opcode). 

For further information, see: http://csound.github.io/docs/manual/tone.html

zdf-1pole

(zdf-1pole afn cutoff)(zdf-1pole afn cutoff mode)
Zero-delay feedback, 1-pole filter. 

Optional mode argument may be:

0 - low-pass, default
1 - high-pass 
2 - allpass.

zdf-2pole

(zdf-2pole afn cutoff Q)(zdf-2pole afn cutoff Q mode)
Zero-delay feedback, 2-pole filter.

Optional mode argument may be:

0 - low-pass, default
1 - high-pass 
2 - band-pass
3 - unity-gain band-pass
4 - notch 
5 - allpass 
6 - peak

zdf-ladder

(zdf-ladder afn cutoff Q)
Zero-delay feedback Moog Ladder filter (4-pole 24db/oct)

afn - mono audio function to filter 
cutoff - frequency to cutoff 
Q - controls Q values for filter in range 0.5-25.0. At 25.0,
  filter will self-oscillate.

Based on code by Will Pirkle, presented in:

http://www.willpirkle.com/Downloads/AN-4VirtualAnalogFilters.2.0.pdf
 
and in his book 'Designing software synthesizer plug-ins in C++ : for
RackAFX, VST3, and Audio Units'

ZDF using Trapezoidal integrator by Vadim Zavalishin, presented in 'The Art
of VA Filter Design' (https://www.native-instruments.com/fileadmin/ni_media/
downloads/pdf/VAFilterDesign_1.1.1.pdf)