0% found this document useful (0 votes)
21 views1 page

SCAssignment 2

The document defines two synthdefs, sin_syn and wigsaw, that generate sine wave and saw wave sounds respectively. It then creates four synths (a, b, c, d) using these synthdefs. It proceeds to set various parameters on synths a and b such as gate, frequency ranges, amplitude, and stereo position and toggles the gate on and off for the two synths.

Uploaded by

James Hudson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

SCAssignment 2

The document defines two synthdefs, sin_syn and wigsaw, that generate sine wave and saw wave sounds respectively. It then creates four synths (a, b, c, d) using these synthdefs. It proceeds to set various parameters on synths a and b such as gate, frequency ranges, amplitude, and stereo position and toggles the gate on and off for the two synths.

Uploaded by

James Hudson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

(

SynthDef(\sin_syn, { | out, gate = 0, lowRand = 300 highRand = 3000 pulseRate = 10


mul = 0.5 stereo = 0 mix = 0.5 room = 0.5 |
var z;
z = Pan2.ar(
EnvGen.kr(Env.adsr(2), gate) * SinOsc.ar(TRand.kr(lowRand,
highRand, Pulse.kr(pulseRate)), mul), stereo, 0.3);
Out.ar(out, FreeVerb.ar(z, mix, room));
}).send(s);
)

(
SynthDef(\wigsaw, { | out, gate = 0, lowRand = 300 highRand = 3000 pulseRate = 10
mul = 0.5 stereo = 0 mix = 0.5 room = 0.5|
var z;
z = Pan2.ar(
EnvGen.kr(Env.adsr(2), gate) * Saw.ar(TRand.kr(lowRand, highRand,
Pulse.kr(pulseRate)), mul), stereo, 0.3);
Out.ar(out, FreeVerb.ar(z, mix, room));
}).send(s);
)

a = Synth(\sin_syn);
b = Synth(\wigsaw);
c = Synth(\wigsaw);
d = Synth(\sin_syn);

a.set(\gate, 1, \lowRand, 300, \highRand, 3000, \pulseRate, 10);


a.set(\lowRand, 20, \highRand, 30, \mul, 0.5);
a.set(\lowRand, 300, \highRand, 5000);
a.set(\lowRand, 3000, \highRand, 10000, \mul, 0.1);
a.set(\pulseRate, 5);
a.set(\gate, 1);
a.set(\gate, 0);

a.free;

b.set(\gate, 1);
a.set(\gate, 1); b.set(\gate, 0);
a.set(\gate, 0); b.set(\gate, 1);
a.set(\gate, 0); b.set(\gate, 0);
a.set(\gate, 1, \stereo, -1); b.set(\gate, 1, \stereo, 1);
a.set(\gate, 1, \stereo, 0); b.set(\gate, 1, \stereo, 0);
a.set(\gate, 1, \stereo, 1); b.set(\gate, 1, \stereo, -1);

a.free; b,free;

You might also like