;
;Noise Gate
; read in wave file
; p3
; # sta dur gain
i 1 0 10 1
; Noise Gate Curve
; # time size gen y len y len y len y len y
f 6 0 1024 7 0 64 0 0 1 448 1 513 1
; NOISE GATE
; p3 p4 p5 p6 p7 p8 p9
; # sta dur rmstime delay f postgain inch outch
i 2 0 10 .02 .01 6 1 1 2
; SINE WAVE
; p4 p5
; # time size gen partial
f 1 0 8192 10 1
sr = 48000
kr = 4800
ksmps = 10
nchnls = 2
zakinit 30, 30
;read in stereo wave file to two separate audio signals
instr 1
kline linseg 1, 5, 0, 5, 1
ar1 oscil 15000*kline, 440, 1
zaw ar1*p4, 1
endin
;noise gate
instr 2
ifqc = 1/p4
ideltm = p5
itab = p6
ipostgain = p7
iinch = p8
ioutch = p9
kenv linseg 0, 0.02, 1, p3-0.04, 1, 0.02, 0
asig zar iinch
adel1 delayr ideltm
delayw asig
kamp rms adel1, ifqc
kampn = kamp/30000
kcomp tablei kampn,itab,1,0
acomp = kcomp*asig*ipostgain
zaw acomp*kenv, ioutch
outs acomp*kenv, acomp*kenv
endin