CC-BY-SA www.triceratupuz.altervista.org triceratupuz@libero.it -iadc -odac -m3 -d
Voices
V1 minfrq1 thres
maxfrq1
V2 minfrq2 thres
maxfrq2
V3 minfrq3 thres
maxfrq3
V4 minfrq4 thres
maxfrq4
V5 minfrq5 thres
maxfrq5
Master
directOut
voicesOut
sr = 48000 ksmps = 32 nchnls = 2 0dbfs = 1 zakinit 4, 23; a, k giSine ftgenonce 0, 0, 4096 * 4, 10, 1 instr 1; controllers k_inVolume init 0 k_inVolume_ chnget "inVolume" if k_inVolume_ != 0 then k_inVolume = k_inVolume_ endif zkw k_inVolume, 0 k_minfrq1 init 0 k_minfrq1_ chnget "minfrq1" if k_minfrq1_ != 0 then k_minfrq1 = k_minfrq1_ endif zkw k_minfrq1, 1 k_maxfrq1 init 0 k_maxfrq1_ chnget "maxfrq1" if k_maxfrq1_ != 0 then k_maxfrq1 = k_maxfrq1_ endif zkw k_maxfrq1, 2 k_thres1 init 0 k_thres1_ chnget "thres1" if k_thres1_ != 0 then k_thres1 = k_thres1_ endif zkw k_thres1, 3 k_minfrq2 init 0 k_minfrq2_ chnget "minfrq2" if k_minfrq2_ != 0 then k_minfrq2 = k_minfrq2_ endif zkw k_minfrq2, 5 k_maxfrq2 init 0 k_maxfrq2_ chnget "maxfrq2" if k_maxfrq2_ != 0 then k_maxfrq2 = k_maxfrq2_ endif zkw k_maxfrq2, 6 k_thres2 init 0 k_thres2_ chnget "thres2" if k_thres2_ != 0 then k_thres2 = k_thres2_ endif zkw k_thres2, 7 k_minfrq3 init 0 k_minfrq3_ chnget "minfrq3" if k_minfrq3_ != 0 then k_minfrq3 = k_minfrq3_ endif zkw k_minfrq3, 9 k_maxfrq3 init 0 k_maxfrq3_ chnget "maxfrq3" if k_maxfrq3_ != 0 then k_maxfrq3 = k_maxfrq3_ endif zkw k_maxfrq3, 10 k_thres3 init 0 k_thres3_ chnget "thres3" if k_thres3_ != 0 then k_thres3 = k_thres3_ endif zkw k_thres3, 11 k_minfrq4 init 0 k_minfrq4_ chnget "minfrq4" if k_minfrq4_ != 0 then k_minfrq4 = k_minfrq4_ endif zkw k_minfrq4, 13 k_maxfrq4 init 0 k_maxfrq4_ chnget "maxfrq4" if k_maxfrq4_ != 0 then k_maxfrq4 = k_maxfrq4_ endif zkw k_maxfrq4, 14 k_thres4 init 0 k_thres4_ chnget "thres4" if k_thres4_ != 0 then k_thres4 = k_thres4_ endif zkw k_thres4, 15 k_minfrq5 init 0 k_minfrq5_ chnget "minfrq5" if k_minfrq5_ != 0 then k_minfrq5 = k_minfrq5_ endif zkw k_minfrq5, 17 k_maxfrq5 init 0 k_maxfrq5_ chnget "maxfrq5" if k_maxfrq5_ != 0 then k_maxfrq5 = k_maxfrq5_ endif zkw k_maxfrq5, 18 k_thres5 init 0 k_thres5_ chnget "thres5" if k_thres5_ != 0 then k_thres5 = k_thres5_ endif zkw k_thres5, 19 k_mastervd init 0 k_mastervd_ chnget "mastervd" if k_mastervd_ != 0 then k_mastervd = k_mastervd_ endif zkw k_mastervd, 21 k_masterv init 0 k_masterv_ chnget "masterv" if k_masterv_ != 0 then k_masterv = k_masterv_ endif zkw k_masterv, 22 ;input instrument event_i "i", 2, 0, -1 ;voice controllers event_i "i", 10.1, 0, -1, 0 event_i "i", 10.2, 0, -1, 1 event_i "i", 10.3, 0, -1, 2 event_i "i", 10.4, 0, -1, 3 event_i "i", 10.5, 0, -1, 4 ;out instrument event_i "i", 1000, 0, -1, 17 endin instr 2; input instrument ainl, ainr ins kinV zkr 0 ;ainsig = (ainl + ainr) * kinV zawm (ainl + ainr) * kinV, 0 zawm ainl + ainr, 1 endin instr 10; centroids ainsound zar 0 ;p4 index inumpar init 4 k_minfrq zkr p4 * inumpar + 1 k_maxfrq zkr p4 * inumpar + 2 kthres zkr p4 * inumpar + 3 kminf = cpsmidinn(127 * k_minfrq) kmaxf = cpsmidinn(127 * k_maxfrq) afilt buthp ainsound, kminf afilt buthp afilt, kminf afilt buthp afilt, kminf afilt butlp afilt, kmaxf afilt butlp afilt, kmaxf afilt butlp afilt, kmaxf kamp rms afilt ktrig trigger kamp, kthres, 2 kfreq centroid afilt, ktrig, 16384 if kfreq < kminf then kfreq = kfreq * 2 endif if kfreq > kmaxf then kfreq = kfreq * 0.5 endif kmidi = int(69 + 12 * logbtwo(kfreq / 440)) kfreqint = cpsmidinn(kmidi) kfreqP port kfreqint, 0.05 kampP port kamp, 0.05 kampPs port kamp, 0.11 amod oscil kfreqP * (0.5 + kampPs), kfreqP * 3 * (1.15 - kampPs), giSine acarr oscil kampP * 0.7, kfreqP + amod, giSine afilt lpf18 acarr, 100 + (1 - kampP) * 10000, 0.5, 0.2 + 0.2 * kampP imaxt init 8 ktim init 0 ktimepast init 0 ktimenow timeinstk kfeed init 0.4 if ktrig ==1 then ktim = ktimenow - ktimepast if ktim > imaxt then ktim = imaxt endif ktimepast = ktimenow endif ktimP portk ktim, ktim * 0.5 aspare delayr imaxt adelf deltap ktimP delayw afilt + adelf * kfeed kampan = 0.2 * (1 - kampP) kside = (rnd(1) > 0.5 ? kampan : -1.0 * kampan) afl, afr pan2 afilt, 0.5 + kside adl, adr pan2 adelf, 0.5 - kside zawm afl + adl, 2 zawm afr + adr, 3 endin instr 1000; output ainsig zar 1 all zar 2 alr zar 3 kvold zkr 21 kvoldP port kvold, 0.05 kvol zkr 22 kvolP port kvol, 0.05 krms rms 0.5 * (all + alr) allr, alrr reverbsc all * kvolP + 0.5 * ainsig * kvoldP, alr * kvolP + 0.5 * ainsig * kvoldP, 0.01 + 0.77 * (1 - krms), 11000 outs allr, alrr ; record output Sfilen sprintf "/mnt/sdcard/tpz_rec_%d.wav", 0 fout Sfilen, 14, allr, alrr; or 16 ;Clean channels zacl 0, 3 zkcl 0, 22 endin i 1 0 3600