diff options
Diffstat (limited to 'BUG10/instruments.udo')
-rw-r--r-- | BUG10/instruments.udo | 238 |
1 files changed, 238 insertions, 0 deletions
diff --git a/BUG10/instruments.udo b/BUG10/instruments.udo new file mode 100644 index 0000000..dcb4ba3 --- /dev/null +++ b/BUG10/instruments.udo @@ -0,0 +1,238 @@ +#ifndef UDO_INSTRUMENTS +#define UDO_INSTRUMENTS ## +/* + Debugger - Unfixed Bugs : BUG #4 + + Sound generators + Names should correspond to those used in BID file, prepended with play_ +*/ + + +#include "wavetables.udo" +#include "bussing.udo" +#include "bid.udo" + +instr play_bass1 + ifreq = cpsmidinn(table(1, gibid_chordfn) - 24) + kindex1 line 4, p3, 1 + kindex2 line 5, p3, 1 + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + aL foscil 1, ifreq, 8, 1.5, kindex1, gifnSine + aR foscil 1, ifreq, 8, 1.5, kindex2, gifnSine + aL *= kamp * 0.88 + aR *= kamp * 0.88 + bus_mix("master", aL, aR) +endin + +instr play_hit1 + kfreq line cpsmidinn(table(2, gibid_chordfn) - 24), p3, cpsmidinn(table(1, gibid_chordfn) - 24) + kindex1 line 4, p3, 1 + kindex2 line 5, p3, 1 + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + aL1 foscil 1, kfreq, 1, 1.5, kindex1, gifnSquare + aR1 foscil 1, kfreq, 1, 1.5, kindex2, gifnSquare + aL2 foscil 1, kfreq, 2, 2.5, kindex2, gifnSine + aR2 foscil 1, kfreq, 2, 2.5, kindex1, gifnSine + aL = (aL1 + aL2) * kamp * 0.88 + aR = (aL1 + aL2) * kamp * 0.88 + aL distort aL, 0.6, gifnSine + aR distort aR, 0.6, gifnSine + + knoiseenv line 3, p3, 0.1 + aLn unirand knoiseenv + aRn unirand knoiseenv + aLn butterlp aLn, 5000 + aRn butterlp aRn, 5000 + aL = aLn * aL * 0.1 + aR = aRn * aR * 0.1 + bus_mix("master", aL, aR) +endin + +instr play_melb1 + ifreq = cpsmidinn(table(1, gibid_chordfn)) * 1 + p3 = 0.03 + kindex1 line random(1, 4), p3, random(1, 5) + kindex2 line random(1, 4), p3, random(1, 5) + kamp linseg 0, p3*0.5, 1, p3*0.4, 1, p3*0.1, 0 + aL foscil 1, ifreq, 2, random(1, 4), kindex1, gifnSine + aR foscil 1, ifreq, 2, random(1, 4), kindex2, gifnSine + aL *= kamp * 0.2 + aR *= kamp * 0.2 + bus_mix("master", aL, aR) +endin + + +instr play_hat1 + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.05 + kfreq line 300, p3, 100 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, kfreq, gifnSquare, -1 + asqr2 oscil 1, kfreq*1.4471, gifnSaw, -1 + asqr3 oscil 1, kfreq*1.6170, gifnSaw, -1 + asqr4 oscil 1, kfreq*1.9265, gifnSaw, -1 + asqr5 oscil 1, kfreq*2.5028, gifnSine, -1 + asqr6 oscil 1, kfreq*2.6637, gifnSaw, -1 + a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808 butterhp a808, 4270 + a808 butterhp a808, 4270 + aout = a808 * aenv * iamp * 2 + bus_mix("master", aout, aout) +endin + +instr play_hat2 + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.12 + idel1 = random(0.005, 0.01) + idel2 = random(0.005, 0.01) + xtratim(max(idel1, idel2)) + + kfreq line 400, p3, 100 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, kfreq, gifnSquare, -1 + asqr2 oscil 1, kfreq*1.4471, gifnSine, -1 + asqr3 oscil 1, kfreq*1.5170, gifnSquare, -1 + asqr4 oscil 1, kfreq*1.7265, gifnSquare, -1 + asqr5 oscil 1, kfreq*2.2028, gifnSaw, -1 + asqr6 oscil 1, kfreq*2.4637, gifnSaw, -1 + a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808 butterhp a808, 3270 + a808 butterhp a808, 3270 + aout = a808 * aenv * iamp * 1.1 + aL delay aout, idel1 + aR delay aout, idel2 + bus_mix("master", aL, aR) +endin + + + +instr play_kick ; 808 style kick + iamp = bid_getparameter(p4, p5, 2) + + idist = 0.4 ;= (i(gksection) == 1) ? 0.55 : 0.35 + xtratim 0.1 + krelease release + ktune init 0 + kmul transeg 0.2, p3*0.5, -15, 0.01, p3*0.5, 0, 0 + kbend transeg 0.5, 1.2, -4, 0, 1, 0, 0 + asig gbuzz 0.5, 50*octave(ktune)*semitone(kbend), 20, 1, kmul, gifnCosine + aenv transeg 1, p3-0.004, -6, 0 + gkpump = k(aenv) + aatt linseg 0, 0.004, 1 + asig = asig*aenv*aatt + aenv linseg 1, 0.07, 0 + acps expsega 400, 0.07, 0.001, 1, 0.001 + aimp oscili aenv, acps*octave(ktune*0.25) + amix = ((asig*0.7)+(aimp*0.35))*2*iamp + gkpump = min(rms(amix) * 7, 1) + aout1 pareq amix, 100, 0.01, 0.7 + aout1 distort aout1, idist, gifnSine + aout1 pareq aout1, 50, 2, 0.4 + ;aout1 pareq aout1, 190, 0.7, 0.6 + aout1 pareq aout1, 4900, 2, 0.7 + aout1 *= 2 + bus_mix("master", aout1, aout1) +endin + +instr play_kick2 + iamp = bid_getparameter(p4, p5, 2) + xtratim 0.1 + krelease release + ktune init 1 + ifn = gibid_chordgroups[1][1] ; gibid_chordfn + ifreq = cpsmidinn(tab_i(1, ifn) - 18) * 0.1 + kmul transeg 0.2, p3*0.5, -15, 0.01, p3*0.5, 0, 0 + kbend transeg 0.5, 1.2, -4, 0, 1, 0, 0 + asig gbuzz 0.5, ifreq, 20, 1, kmul, gifnCosine + aenv transeg 1, p3-0.004, -6, 0 + aatt linseg 0, 0.004, 1 + asig = asig*aenv*aatt + aenv linseg 1, 0.07, 0 + acps expsega 400, 0.07, 0.001, 1, 0.001 + aimp oscili aenv, acps*octave(ktune*0.25) + amix = ((asig*0.7)+(aimp*0.35))*2*iamp + aout1 pareq amix, 100, 0.01, 0.6 + aout1 distort aout1, 0.6, gifnSquare + aout1 pareq aout1, 100, 0.8, 0.3 + aout1 butterhp aout1, 30 + aout1 *= 3.6 + ;aout1 *= 1-gkpump + bus_mix("master", aout1, aout1) +endin + + +instr play_shaker + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.02 + kamp line 1, p3, 0 + aL shaker 1, 2000, 8, 0.499, 2, 0 + aR shaker 1, 2000, 8, 0.499, 2, 0 + aL *= kamp * iamp * 3 + aR *= kamp * iamp * 3 + bus_mix("master", aL, aR) + bus_mix("delay3", aL*0.25, aR*0.25) +endin + + + + +;glitch sampler vars +giglitchsamples = 44100 +giglitchbufferL ftgen 0, 0, giglitchsamples, 7, 0 +giglitchbufferR ftgen 0, 0, giglitchsamples, 7, 0 +instr play_glitchread + iamp = bid_getparameter(p4, p5, 2) + ifreq = cpsmidinn(tab_i(random(1, ftlen(gibid_chordfn) - 1), gibid_chordfn)) + ilen = ((1/(ifreq))*sr)*pow(2, round(random(0, 4))) + istart random 0, giglitchsamples-ilen + awindex phasor giglitchsamples / ilen + aL table awindex*giglitchsamples, giglitchbufferL + aR table awindex*giglitchsamples, giglitchbufferR + aL butterhp aL, 350 + aR butterhp aR, 350 + aL *= 0.4 * iamp + aR *= 0.4 * iamp + if (random(0, 1) > 0.7) then + if (random(0, 1) > 0.5) then + bus_mix("delay1", aL, aR) + else + bus_mix("delay2", aL, aR) + endif + endif + bus_mix("master", aL, aR) +endin + +instr play_snare + icps0 = 110 + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.3 + icps1 = 4.0 * icps0 + kcps port icps0, 0.007, icps1 + kcpsx = kcps * 1.5 + + kfmd port 0.0, 0.01, 0.7 + aenv1 expon 1.0, 0.03, 0.5 + kenv2 port 1.0, 0.008, 0.0 + aenv2 interp kenv2 + aenv3 expon 1.0, 0.025, 0.5 + + a_ oscili 1.0, kcps + a1 oscili 1.0, kcps * (1.0 + a_*kfmd) + a_ oscili 1.0, kcpsx + a2 oscili 1.0, kcpsx * (1.0 + a_*kfmd) + + a3 unirand 4.0 + a3 = a3 - 1.0 + a3 butterbp a3, 3200, 1500 + a3 = a3 * aenv2 + + a0 = a1 + a2*aenv3 + a3*1.0 + a0 = a0 * aenv1 + a0 butterhp a0, 210 + aout = a0 * iamp * 1.4 + bus_mix("master", aout, aout) + +endin + + +#end |