Friday, April 04, 2014

fridayTwelveTone;



So, I am continuing to explore superCollider.  I was playing around with it a bit tonight mainly working on how to schedule events/notes/sounds and such.  I decided to do a twelve-tone piece.  It isn't serial in that the pitches aren't repeated in a set order; rather a random generator is spitting out the 12 pitches three times.  First time through is from A3 to A4; second is E4 to E5; and finally A3 to A4 again.  Definitely, this is more of an exploration than an aesthetic achievement, but expiration is the fun part of composing anyway.

Here's the code:
(
SynthDef(\sine, {
arg freq1=57, freq2=69;
var out;
out = SinOsc.ar(Rand(freq1,freq2).midicps, 0, 0.1);
out = (out + FreeVerb.ar(out, 0.44, 0.7));
out = out*Line.kr(0.5, 0, 1, mul:3, doneAction:2);
Out.ar(0, Pan2.ar(out));
}).add;
)
(
SynthDef(\woosh, {
var out;
out = PinkNoise.ar(EnvGen.kr(Env.perc(0.01, 1), doneAction: 2));
out = (out + FreeVerb2.ar(out, out, 0.7, 1))*0.07;
Out.ar(0, Pan2.ar(out, 0)
)
}).add
)

s.prepareForRecord;
s.record;
(
var t_c = TempoClock.default;

t_c.tempo_(1);

t_c.sched(1, {Routine({
12.do({
Synth.new(\woosh); 3.0.wait;
})
}).play};
);

t_c.tempo_(4);

t_c.sched(1, {Routine({
12.do({
Synth.new(\sine); 1.0.wait;
})
}).play};
);
t_c.sched(12, {Routine({
12.do({
Synth.new(\sine, [\freq1, 64, \freq2, 76]); 1.0.wait;
})
}).play};
);
t_c.sched(24, {Routine({
12.do({
Synth.new(\sine); 1.0.wait;
})
}).play};
);
)
s.stopRecording;