Last active
January 24, 2016 16:49
-
-
Save 44kwm20/7b9669e3a720c6e11951 to your computer and use it in GitHub Desktop.
Clapping Music by Steve Reich (gradual phase shifting process version in SuperCollider )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////// | |
// SynthDef //////////////// | |
//////////////////////////// | |
( | |
SynthDef(\clap,{ | |
arg output=0, vari=0, acc = 1; | |
var noiz, amp, filt1, filt2, aEnv, fEnv, tap; | |
noiz = WhiteNoise.ar; | |
aEnv = EnvGen.kr(Env.perc(0.01, 0.4, 1, -10).delay(Rand(0,0.02)), 1, doneAction:2); | |
fEnv = EnvGen.kr(Env.perc(0, 0.2, 1, -8), 1, doneAction:0)*600 | |
+ ((1100 + Rand(-100,300)) - (vari*100)); | |
filt1 = BPF.ar(noiz, fEnv, 0.4 - (vari * 0.1) )*0.4; | |
filt2 = BPF.ar(noiz, 1000+ Rand(-50,50), 0.2)*1; | |
acc = clip2((acc + 0.5) ,1); | |
amp = ( (filt1+filt2) ) ; | |
amp = RLPF.ar( amp, 10000 , 0.9)*2; | |
amp = amp.softclip * aEnv * acc; | |
Out.ar(output, amp); | |
}).add; | |
SynthDef(\reverb,{ | |
arg bus1, bus2; | |
var in1, in2, mix; | |
in1 = In.ar(bus1); | |
in2 = In.ar(bus2); | |
mix = FreeVerb2.ar(in1, in2, 0.2, 0.7, 0.98); | |
Out.ar(0, mix); | |
}).add; | |
) | |
//////////////////////////// | |
// Sequence //////////////// | |
//////////////////////////// | |
( | |
var tempo, clapPattern, accPattern, durPattern, performer1, performer2, | |
numRepeates, effDef, bus1, bus2, group1, group2; | |
tempo = 200/60; | |
numRepeates = 12; | |
bus1 = Bus.audio(s,1); | |
bus2 = Bus.audio(s,1); | |
group1 = Group.head(s); | |
group2 = Group.after(group1); | |
clapPattern = [1,1,1,\, 1,1,\, 1,\, 1,1,\]; | |
accPattern = [1,Pseq([0],11)]; | |
durPattern = [ | |
Pseq([ | |
Pseq([1],12*4), | |
Pseq([ Pseq([1],11), 7/8], 8) | |
], 12), | |
Pseq([1],12*(12+1)) | |
]; | |
effDef = Synth.head(group2, \reverb, [\bus1, bus1.index, \bus2, bus2.index]); | |
performer1 = Pbind( | |
\instrument, \clap, | |
\group, group1, | |
\output, bus1.index, | |
\vari, 1, | |
\degree,Pseq(clapPattern,numRepeates*13) , | |
\acc,Pseq(accPattern,numRepeates*13), | |
\dur, 0.5 | |
); | |
performer2 = Pbind( | |
\instrument, \clap, | |
\group, group1, | |
\output, bus2.index, | |
\vari, 0, | |
\degree,Pseq(clapPattern,(numRepeates*(13+1))) , | |
\acc,Pseq(accPattern,(numRepeates*(13+1))), | |
\dur, 0.5 * Pseq(durPattern,1) | |
); | |
performer1.play(TempoClock(tempo)); | |
performer2.play(TempoClock(tempo)); | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment