Slide 8
Slide 8 text
{
var snare, bdrum, hihat;
var tempo = 4;
tempo = Impulse.ar(tempo); // for a drunk drummer replace Impulse with Dust !!!
snare = WhiteNoise.ar(Decay2.ar(PulseDivider.ar(tempo, 4, 2), 0.005, 0.5));
bdrum = SinOsc.ar(Line.ar(120,60, 1), 0, Decay2.ar(PulseDivider.ar(tempo, 4, 0), 0.005, 0.5));
hihat = HPF.ar(WhiteNoise.ar(1), 10000) * Decay2.ar(tempo, 0.005, 0.5);
Out.ar(0, (snare + bdrum + hihat) * 0.4 ! 2)
}.play
-o dac // real-time output
sr = 44100
0dbfs = 1
nchnls = 2
ksmps = 64
instr 1
iAmp = p4
iFreq = p5
iAtt, iDec, iSus, iRel = 0.1, 0.4, 0.6, 0.7
kEnv = madsr:k(iAtt,iDec,iSus,iRel)
iCutoff, iRes = 5000, 0.4
aVco = vco2:a(iAmp,iFreq)
aLp = moogladder:a(aVco,iCutoff*kEnv,iRes)
outall(aLp*kEnv)
endin
i 1 0 2 0.1 440
i 1 3 2 0.2 550
i 1 7 3 0.1 550
i 1 7 3 0.1 660
Cycling'74 Max
CSound
SuperCollider