Wednesday, August 02, 2006

Week1 - SuperCollider Exercise - Scheduling

The process of creating a phasing sequence was fairly simple, which is a good thing. I created a simple SynthDef to begin. I managed to create the Synth Def and only have one error that needed to be corrected. I think that is pretty good considering I had not touched SuperCollider since the date the major projects were due. The creation of three sound sources and scheduling them to play for a short period of time was simple. I have not done anything here that is groundbreaking, but I think I've grasped the concept.


SCHEDULING
(
//Phasing
SynthDef(
\phasing,

{
//Arguments
arg carFreq = 440,
panPos = 0;

//Variables
var carrier,
env;

//Carrier
carrier = SinOsc.ar(carFreq, 0, 0.5);

//Envelope
env = carrier * EnvGen.kr(Env.perc, 1.0, doneAction:2);

//Output
Out.ar(0, Pan2.ar(env, panPos));
}
).send(s)

)

(
//Variables
var d,
e,
f;

//TempoClocks
d = TempoClock(1.5);
e = TempoClock(0.6);
f = TempoClock(3.0);

//Clocks
d.schedAbs(1, {Synth(\phasing, [\carFreq, 440, \panPos, 1]); 2.0} );
e.schedAbs(0, {Synth(\phasing, [\carFreq, 447, \panPos, -1]); 1.0} );
f.schedAbs(0, {Synth(\phasing, [\carFreq, 452, \panPos, -0.5]); 3.0} );

//SystemClock
SystemClock.sched(25, {d.clear;
e.clear;
f.clear;});
)

0 Comments:

Post a Comment

<< Home