Sweep – Boink – Snare

instr 30
; Mostly copied from Mykelson's Drum Machine.
; This instr. should stand frq1 from 30 to 200; cpspch 5.00-8.00 only

; parameters names
; 1 2 3 4 5
; i st dur amp cho
;;Csgrouper Param Recognition: 
; CSGF=3:dur=1; CSGF=4:amp=60; CSGF=5:fq1=6.00; CSGF=6:pan=0.5; CSGF=7:cho=2;

iamp = ampdb(p4);
ifrq = cpspch(p5);
ipan = p6;
icho = p7;
ipanr = ipan;
ipanl = 1-ipan;
if( icho == 1 ) goto dosnare;
if( icho == 2 ) goto dosweep;
if( icho == 3 ) goto doboink;

; Dumb Bass Drum
 kfreqenv expseg ifrq, .01, 200, .08, ifrq; ifrq was: 50.
 kampenv expseg .0001, .01, iamp, .08, .01
 asig rand kampenv
 afilt reson asig, kfreqenv, kfreqenv/8
 aout1 balance afilt, asig
 aout2 = aout1;
goto output;
dosnare:
; KS Snare Drum
 kampenv4 linseg 0, .001, 1, p3-.021, 1, .02, 0
 kptchenv linseg ifrq, .01, 300, .2, 200, .01, ifrq+100; ifrq was: 100.
 asig pluck iamp, kptchenv, 50, 402, 4, .8, 3
 aout1 = kampenv4*asig
 aout2 = kampenv4*asig
goto output;
dosweep:
; Sorta Cool Knock Sweep Drum
 kfreqenv41 expseg ifrq, .01, 200, .08, ifrq; ifrq was: 50,..,50.
 kfreqenv42 linseg ifrq+100, .01, 1000, .08, ifrq+200; ifrq+x was: 150,..,250.
 kampenv4 linseg 0, .01, iamp, .08, 0, .01, 0
 asig rand kampenv4
 afilt1 reson asig, kfreqenv41, kfreqenv41/8
 afilt2 reson asig, kfreqenv42, kfreqenv42/4
 aout1 balance afilt1, asig
 aout2 balance afilt2, asig
goto output;
doboink:
; FM Metal Boink Drum
 kampenv61 expseg .01, .01, iamp, .2, iamp/100, .1, .001
 kampenv62 linseg 401, .1, 10, .1, .5, .01, 1
 aout1 foscil kampenv61, 30, 1, 6.726, kampenv62, 401
 aout2 = aout1;
output:
outs aout1*ipanr, aout2*ipanl;
endin

;ftables:
;f401 0 8192 10 1 
;f402 0 1024 7 1 1024 1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s