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 -- low-pass output signal.
ain -- input signal.
xcf -- filter cutoff frequency (i-, k-, or a-rate).
xk -- filter feedback value k (i-, k-, or a-rate) that controls resonance. Range 0.0-17.0 . Self-oscillation occurs at 17.0.
knlp (optional, default=0) -- Non-linear processing method. 0 = no processing, 1 = higher-quality NLP, 2 = lower-quality NLP (faster). Method 1 uses (1.0 / tanh(ksaturation)) * tanh(ksaturation * input). Method 2 uses tanh(ksaturation * input). Enabling NLP may increase the overall output of filter above unity and should be compensated for outside of the filter.
ksaturation (optional, default=1) -- saturation amount to use for non-linear processing. Values > 1 increase the steepness of the NLP curve.
Examples
Here is an example of the diodeladder opcode. It uses the file diodeladder.csd.
<CsoundSynthesizer><CsOptions>-o dac
</CsOptions><CsInstruments>sr=44100ksmps=16nchnls=20dbfs=1gi_sineftgen0,0,65537,10,1gkcutinit6000instrmodulationgkcut=lfo(4000,0.1)+6000endininstrbassiamp=ampdbfs(-12)ipch=cps2pch(p4,12)asig=vco2(0.5,ipch,0)acut=expon:a(i(gkcut),p3,200)aout=diode_ladder(asig,acut,8,1,4)aout*=expseg:a(1.0,p3-0.05,1.0,0.05,0.001)aout=limit(aout,-1.0,1.0)outc(aout,aout)endingipat[]init8gipat[0]=6.00gipat[1]=7.00gipat[2]=6.00gipat[3]=7.00gipat[4]=5.07gipat[5]=6.07gipat[6]=5.08gipat[7]=6.08instrplayerindx=p4;; play instrumentif(gipat[indx]>0)thenschedule("bass",0,0.2,gipat[indx])endif;; temporal recursionschedule("player",0.2,0.1,(indx+1)%lenarray(gipat))endinschedule("modulation",0,-1)schedule("player",0,0.1,0)event_i("e",0,0.1*128)</CsInstruments><CsScore></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.
Pirkle, Will. Designing Software Synthesizer Plug-ins in C++: For RackAFX, VST3, and Audio Units. CRC Press, 2014.
Pirkle, Will. AN-6: Virtual Analog (VA) DiodeLadder Filter. 2013.
Zavalishin, Vadim. "The Art of VA filter design." Native Instruments, 2012.