Saved from music-dsp.org. A great example of why macros [0] are a less
efficient technique for encapsulation/abstraction than UDO's are [1].
Also, thanks Istvan; for UDO's. :D
Incidentally, what license issues exist with this type of thing ? I
mean I'd really like to add the GutoPitchTracker UDO as well as this
one to the repository, but I don't want to step on anyone's toes...
advice please on how to properly cite the sources to uphold their
respective author's licenses ?
TIA,
-David
[0]
sr = 48000
kr = 48000
ksmps = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;"analog" filter library
;filters designed by Josep M Comajuncosas
;dec / 2000
;18dB/oct resonant 3 pole LPF with tanh() dist.
;orchestra-only version (no tables)
;comments to gelida@intercom.es
;-- Saved from music-dsp.org and converted to
;-- unified CSD format by David Akbari
;-- May 2006
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#define lpf303(input'output'fco'res'dist)#
kfcn = $fco./(sr/2)
kp = ((-2.7528*kfcn + 3.0429)*kfcn + 1.718)*kfcn - 0.9984
ap upsamp kp
kp1=kp+1
kscl = ((-2.7079*kp1 + 10.963)*kp1 - 14.934)*kp1 + 8.4974
;kscl = -1.6519*log(kp+1) + 2.2173
kres = $res.*kscl
ay1 init 0
ay2 init 0
aoutput init 0
$input. = $input. - kres*tanh(aoutput)
ax1 delay1 $input.,1
ay1 = ($input.+ ax1) * (ap+1)/2 - ap*ay1
ay11 delay1 ay1,1
ay2 = (ay1 + ay11) * (ap+1)/2 - ap*ay2
ay31 delay1 ay2,1
aoutput = (ay2 + ay31) * (ap+1)/2 - ap*aoutput
$output.=aoutput
;$output.=tanh(aoutput*(1+($dist.*(1.5+2*kres*(1-kfcn)))))
#
/*--- ---*/
instr 1
;VCO controls
kamp init 1
kcps init 105
;VCF controls
kfco randi 15000, 1.03, .34
kfco = abs(kfco)
kres randi 1, .98, .63
kres = abs(kres)
kdist randi 3, 1.24,.65
kdist= abs(kdist)
;VCO -> VCF
avco vco kamp,kcps,1,0,1,1;saw
$lpf303(avco'aout'kfco'kres'kdist)
;OUTPUT
out aout*10000
endin
/*--- ---*/
f1 0 8193 10 1
i1 0 10
i1 11 30
e
[1]
sr = 48000
ksmps = 100
nchnls = 2
;0dbfs = 1
/* your file here */
#define FILE # "/home/daveakbari/loops/mix.wav" #
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;"analog" filter library
;filters designed by Josep M Comajuncosas
;dec / 2000
;18dB/oct resonant 3 pole LPF with tanh() dist.
;orchestra-only version (no tables)
;comments to gelida@intercom.es
;-- UDOization by David Akbari - May 2006
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
opcode lpf303, a, akkk
setksmps 1
ain, kfco, kres, kdist xin
kfcn = kfco/(sr/2)
kp = ((-2.7528*kfcn + 3.0429)*kfcn + 1.718)*kfcn - 0.9984
ap upsamp kp
kp1=kp+1
kscl = ((-2.7079*kp1 + 10.963)*kp1 - 14.934)*kp1 + 8.4974
;kscl = -1.6519*log(kp+1) + 2.2173
kres = kres*kscl
ay1 init 0
ay2 init 0
aoutput init 0
ainput = ain - kres*tanh(aoutput)
ax1 delay1 ainput, 1
ay1 = (ainput + ax1) * (ap+1)/2 - ap*ay1
ay11 delay1 ay1,1
ay2 = (ay1 + ay11) * (ap+1)/2 - ap*ay2
ay31 delay1 ay2,1
aoutput = (ay2 + ay31) * (ap+1)/2 - ap*aoutput
;aoutput = tanh(aoutput*(1+(kdist*(1.5+2*kres*(1-kfcn)))))
xout aoutput
endop
/*--- ---*/
instr 1
;VCO controls
kamp init 1
kcps init 105
;VCF controls
kfco randi 15000, 1.03, .34
kfco = abs(kfco)
kres randi 1, .98, .63
kres = abs(kres)
kdist randi 3, 1.24,.65
kdist= abs(kdist)
;VCO -> VCF
;avco vco kamp,kcps,1,0,1,1;saw
avco1, avco2 diskin2 $FILE., 1, 0, 1
aoutl lpf303 avco1, kfco, kres, kdist
aoutr lpf303 avco2, kfco, kres, kdist
;OUTPUT
outs aoutl, aoutr
endin
/*--- ---*/
f1 0 8193 10 1
i1 0 3600
e