From 4a2d04c8cd3b4640084b41ca65a54a6615625ce9 Mon Sep 17 00:00:00 2001 From: Richard Knight Date: Sun, 31 Oct 2021 04:35:16 +0000 Subject: beta completion of BUG3 --- BUG4/instruments.udo | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 BUG4/instruments.udo (limited to 'BUG4/instruments.udo') diff --git a/BUG4/instruments.udo b/BUG4/instruments.udo new file mode 100644 index 0000000..e8f85d3 --- /dev/null +++ b/BUG4/instruments.udo @@ -0,0 +1,134 @@ +#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" + + +instr play_303 + iamp = 1.2 ;getparameter(p4, p5, 2) + + inote1 = p4 + inote2 = p5 + ifilter = p6 + + ifrq1 = 440 * exp(log(2) * (ifilter - 69) / 12) ; filter start freq. + kamp linseg 1, p3*0.8, 1, p3*0.2, 0 + kcps line cpsmidinn(inote1), p3, cpsmidinn(inote2) + kffrq port 0, 60/150, ifrq1 ; filter frequency + a1 phasor kcps ; oscillator + a1 = 1 - 2 * a1 + + a1x butterbp a1, kffrq, kcps * 1.0 ; filters + a1x = a1x * (2 + kffrq / kcps) ; correct amplitude + a1 = a1x + a1 * 0.25 ; 0.5 + a1 butterlp a1, kffrq + + a1 = taninv(a1 * 4 * iamp) ; distortion ; 2.5 + + keqf limit kffrq * 4, 10, sr * 0.48 ; EQ frequency + a1 pareq a1 * 0.4, keqf, 4.0, 1.0, 2 + a1 butterhp a1, 50 + a1 = a1 * kamp + aL, aR pan2 a1, random(0.3, 0.7) + if (p7 == 1 && random(0, 1) > 0.6) then + bus_mix("delay2", aL, aR) + endif + bus_mix("master", aL, aR) +endin + + +/* + Istvan Varga +*/ +instr play_rim + iamp = 1 + icps = 220 + acps expon icps, 0.0025, icps * 0.5 + acps = acps + icps + iamp = 1 + a1a phasor acps, 0.0 + a1b phasor acps, 0.5 + afmenv expon 1.0, 0.02, 0.5 + a1 = (a1a-a1b)*6.0*afmenv + acps = acps*(1.0+a1) + a0 oscil3 1.0, acps + a1 unirand 2.0 + a1 tone a1-1.0, 2000 + a0 = a0 + a1*0.1 + aenv expon 1.0, 0.005, 0.5 + a0 limit 4.0*iamp*a0*aenv, -1.0, 1.0 + a0 table3 a0*4096.0, gifnSaw, 0, 0, 1 + kffrq expseg 2000, 0.07, 100, 1, 100 + a0x tone a0, 10000 + a0y = a0 - a0x + a0x delay a0y, 0.0002 + a0 = a0 - a0x*4.0 + a0 pareq a0, kffrq, 0, 0.7071, 2 + a_ linseg 1, p3-0.1, 1, 0.025, 0, 1, 0 + a0 = a0*a_ + aL, aR pan2 a0*iamp, random(0.3, 0.8) + + bus_mix("delay1", aL, aR) + bus_mix("master", aL, aR) +endin + +instr play_blip + a1 oscil 0.6, 4400 + kamp line 1, p3, 0 + a1 *= kamp + + bus_mix("delay2", a1, a1) +endin + + +instr play_clap + aL noise 1, 0.3 + aR noise 1, 0.4 + aL butterbp aL, 1200, 700 + aR butterbp aR, 1200, 700 + aL taninv aL*7 + aR taninv aR*7 + + kamp linseg 2, p3, 0 + aL *= kamp + aR *= kamp + bus_mix("delay2", aL, aR) + bus_mix("master", aL, aR) + +endin + + +instr play_kick ; 808 style kick + iamp = 1 + xtratim 0.1 + krelease release + ktune init -1.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, 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.6 + aout1 distort aout1, 0.25, (p4 == 1 && random(0, 1) > 0.6) ? gifnSaw : gifnSine + aout1 pareq aout1, 100, 0.01, 0.6 + aout1 *= 3 + bus_mix("master", aout1, aout1) +endin + + +#end -- cgit v1.2.3