Professional Documents
Culture Documents
eMW NOTES
eMW NOTES
SESSION
SuperCollider
.
(object oriented).
, (client)
(server). T server .
SuperCollider
.
SuperCollider.boot;
{goto http://supercollider.sourceforge.net/
download. SuperCollider3.6.2
install.SuperCollider3.6.2
run.SuperCollider3.6.2}
SESSION
//Notes
supercollider C++
Java Smalltalk.
. Integer
String .
Function.
.
. ,
.
. Object.message .
.
SinOsc .ar audio rate (SinOsc.ar).
2 .squared
(2.squared).
SESSION
//
. interpreter
Arguments ()
.
SinOsc .ar arguments . to
freq, phase, mul, add ( .. SinOsc.ar(freq:250, phase:0, mul:1, add:
0) SinOsc.ar(freq: 2000, phase: 1, mul: 2, add: 0) ).
Variables ()
. 2.squared
~a = 2 ~a.squared. supercollider
. =
.
~ .
x = 10
s i. s
~s. Help Environment.
To
.
SESSION
UGen (UnitGenerator)
SinOsc (Sine Oscillator) UGen. UGens
. UGens
audio rate control rate. audio rate
control rate .
Synth
Synth UGens
. o Synth UGens
(audio control rate) Bus.
us
SESSION
Function
{} Function.
{arguments; statements;} ( {statements;}).
Function .
~add = { 3 + 4; };.
.value, ~add.value; .
~add = {arg a = 3, b = 4; a + b; };. arguments
~add.value(a: 5, b: 5); ( ).
.play function
Synth ( !).
Synth .
Synth SinOsc argument
freq mul, Synth ~synth1 (
).
~synth1 = {arg freq = 330, mul = 1; Out.ar(0, SinOsc.ar(freq,
0, mul, 0))}.play;
~synth1.set(\freq, 400, \mul, 2);
SESSION
Modulation
control rate Bus argument Synth
control rate Bus.
~lfoBus = Bus.control;
control Synth ~lfoBus.
~lfoSynth = {
arg lfoFreq = 2, lfoAmp = 20;
Out.kr(~lfoBus, SinOsc.kr(lfoFreq, 0, lfoAmp, 200))
}.play;
argument freq ~lfoBus.
~synth1.map(\freq, ~lfoBus);
SESSION
//Code
SESSION
SESSION
//Notes
function, global
~synth1, function (arguments), freq
() mul ().
Out,
(bus),
. 0,
.
Out, SinOsc,
. freq mul
, phase add,
SinOsc.
function ~synth1, scope,
function
- .
SESSION
SynthDef.
sine
.
Elvelope,
.
.perc = percussion
.
doneAction: 2,
, .
.
SESSION
SynhtDef function
,
, .
, ~s1 ~s2
(~s1 = Synth(\sine) ~s2 = Synth(\sine)),
.set (~s1.set(\freq, 200)),
~s1, 330Hz
SynhtDef 200Hz.
SESSION
SynthDef (arg),
Ugens , SinOsc
LFPulse.
,
SynthDef. ,
SinOsc
SynthDef.
AM (Amplitude Modulation)
, ,
.
(carrier)
(modulator).
modulator
SinOsc. (carriers) , LFPulse
SinOsc.
SESSION
modulator = SinOsc.kr(modfreq, modphase, modmul,
modadd).abs;
source = [LFPulse.ar(freq, lphase, lwidth, lmul +
modulator, ladd), SinOsc.ar([freq, freq/2],
lphase, lmul + modulator, ladd)];
env = EnvGen.ar(Env.perc(releaseTime: rls),
doneAction: 2);
}).send(s);
SESSION
arguments
SynhtDef.
~s1 = Synth(\sound_1, [\freq, 100, \rls, 0.3,
\lwidth, 0.5]);
~s1 = Synth(\sound_1, [\freq, 100, \rls, 4,
\lwidth, 0.5, \lmul, 0, \modmul, 0.3]);
~s1 = Synth(\sound_1, [\freq, 100, \rls, 4,
\lwidth, 0.5, \lmul, 0, \modmul, 1,
\modfreq, 4, \modadd, 0.5]);
SESSION
SynthDef,
FM (Frequency Modulation) ,
,
.
.
.
MouseX
MouseY, ,
,
.
SESSION
source = [LFPulse.ar([freq, freq* 1.5, freq*2] +
SinOsc.kr(modfreq, 0, modmul, modadd).abs, lphase,
MouseY.kr(0.5, 0.9), MouseX.kr(0, 2), ladd),
SinOsc.ar([freq, freq/2] + SinOsc.kr(modfreq, 0,
modmul, modadd).abs, lphase, MouseX.kr(0, 2), ladd)];
}).send(s);
SESSION