; lowpass filter sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 instr 1 ; generate white noise imaxamp = 32767 ; maximum allowable amplitude of noise kenv linen p4, 0.05, p3, 0.05 ; envelope, with p4 between 0 and 1 anoise rand imaxamp ; white noise gasource = kenv*anoise ; control amplitude of noise with envelope ; and put it in a global variable to use as a source sound for filter endin instr 2 ; generate band-limited pulse train iharms = (sr*0.5)/p5 ; keep number of harmonics within Nyquist rate iharms limit iharms, 1, 16 imaxamp = 32767 ; maximum allowable amplitude of noise kenv linen p4*imaxamp, 0.05, p3, 0.05 ; envelope, with p4 between 0 and 1 gasource buzz kenv, p5, iharms, 1 ; band-limited pulse train (within Nyquist rate) ; put it in a global variable to use as a source sound for filter endin instr 3 ; filter a sound with a sweeping lopass filter kfreq line p4, p3, p5 ; sweep the cutoff frequency kq line p6, p3, p7 aout lowpass2 gasource, kfreq, kq out aout endin