;--------------------------------------------------------- ; Copter ; Coded by Hans Mikelson April 2001 ;--------------------------------------------------------- sr = 44100 ; Sample rate kr = 4410 ; Kontrol rate ksmps = 10 ; Samples/Kontrol period nchnls = 2 ; Normal stereo zakinit 50,50 ; Initialize the zak system ;--------------------------------------------------------- ; Copter ;--------------------------------------------------------- instr 10 idur = p3 ; Duration iamp = p4 ; Amplitude irtab = p5 ; Rate table ifcd = p6 ; Fco depth iphf = p7 ; Fco phase iphs = p8 ; Separation phase iq = p9 ; Resonance imode = p10 ; Low pass/High pass ibf = p11 ; Base frequency ioutchl = p12 ioutchr = p13 anz pinkish 1 kamp linseg 0, idur*.25, iamp, idur*.5, iamp, idur*.25, 0 ; Amp envelope krt oscili 1, 1/idur, irtab ; Controls modulation frequency asin1l oscili 1, krt, 1, .5+iphf ; Sine 1 is for filter Fco asin2l oscili 1, krt/2, 1 ; Sine 2 is for amplitude modulation arezl rezzy anz, (asin1l+1)*ifcd*krt+ibf, iq, imode ; Make sine positive add base fqc aoutl = arezl*asin2l*2 ; Modulate amplitude asin1r oscili 1, krt, 1, .25+iphf ; Controls modulation frequency asin2r oscili 1, krt/2, 1, .25 ; Sine 1 is for filter Fco arezr rezzy anz, (asin1r+1)*ifcd*krt+ibf, iq, imode ; Make sine positive add base fqc aoutr = arezr*asin2r*2 ; Modulate amplitude outs aoutl*kamp, aoutr*kamp ; Output the result zaw aoutl, ioutchl zaw aoutr, ioutchr endin ;--------------------------------------------------------- ; Copter 2 ;--------------------------------------------------------- instr 11 idur = p3 ; Duration iamp = p4 ; Amplitude irtab = p5 ; Rate table ifcd = p6 ; Fco depth iphf = p7 ; Fco phase iphs = p8 ; Separation phase iq = p9 ; Resonance imode = p10 ; Low pass/High pass ibf = p11 ; Base frequency ioutchl = p12 ioutchr = p13 iramp = p14 ; Fade in and out time ihma = p15 ; Hum amplitude anz pinkish 1 kamp linseg 0, idur*iramp, 1, idur*(1-2*iramp), 1, idur*iramp, 0 ; Amp envelope krt oscili 1, 1/idur, irtab ; Controls modulation frequency asin1l oscili 1, krt, 1, .5+iphf ; Sine 1 is for filter Fco asin2l oscili 1, krt/2, 1 ; Sine 2 is for amplitude modulation arezl rezzy anz, (asin1l+1)*ifcd*krt+ibf, iq, imode ; Make sine positive add base fqc asin3l oscili 1, .01*krt, 1 ashpl = 1-tanh((asin1l+asin3l*.8)*10) aoutl = arezl*asin2l*ashpl ; Modulate amplitude ahuml buthp (ashpl-1)*ihma,20 ; Take out DC asin1r oscili 1, krt, 1, .25+iphf ; Controls modulation frequency asin2r oscili 1, krt/2, 1, .25 ; Sine 1 is for filter Fco arezr rezzy anz, (asin1r+1)*ifcd*krt+ibf, iq, imode ; Make sine positive add base fqc asin3r oscili 1, .01*krt, 1, iphf ashpr = 1-tanh((asin1r+asin3r*.8)*10) aoutr = arezr*asin2r*ashpr ; Modulate amplitude ahumr buthp (ashpr-1)*ihma,20 ; Take out DC outs (aoutl+ahumr)*kamp*iamp, (aoutr+ahuml)*kamp*iamp ; Output the result zaw (aoutl+ahumr)*kamp, ioutchl zaw (aoutr+ahuml)*kamp, ioutchr endin ;--------------------------------------------------------------- ; Simple Flanger ;--------------------------------------------------------------- instr 50 idur = p3 ; Duration iamp = p4 ; Amplitude idpth = p5 ; Depth irate = p6 ; Rate ifdbk = p7 ; Feedback iphas = p8 ; L-R Phase difference imin = .1 ; Minimum delay time iinch = p9 ; Input channel ioffst = imin + idpth ; Offset aoutl init 0 ; Need to initialize these aoutr init 0 ; for the feedback path. kdclk linseg 0, .002, 1, idur-.004, 1, .002, 0 ; Declick ;asig rand iamp ; Just a simple random number asig zar iinch ; Read the input channel asig = asig*iamp alfol oscil idpth, irate, 1 ; Left LFO alfor oscil idpth, irate, 1, iphas ; Right LFO adel delay asig, ioffst/1000 ; Delay the original signal adell vdelay3 asig+aoutl*ifdbk, alfol+ioffst, ioffst*2 ; Delay left adelr vdelay3 asig+aoutr*ifdbk, alfor+ioffst, ioffst*2 ; Delay right aoutl = adel + adell aoutr = adel + adelr outs kdclk*adell*.5, kdclk*adelr*.5 ; Generate the sound endin