More bits in ch 2.4

cat-town
Dan Buch 7 years ago
parent 84a3f172b1
commit 670ec549f6
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

@ -318,3 +318,109 @@
)
}.scope
)
(
a = {
SinOsc.ar(440) * 0.1
}.play;
)
(
a.run(false);
)
(
a.run;
)
(
a.free;
)
(
a = {
arg freq=440;
SinOsc.ar(freq) * 0.1
}.play
)
(
a = {
arg freq=440, amp=0.1;
SinOsc.ar(freq) * amp;
}.play
)
(
a.set(\freq, rrand(220, 440), \amp, rrand(0.05, 0.2));
)
(
{
var carrier, modulator, carrfreq, modfreq;
carrfreq = MouseX.kr(440, 5000, 'exponential');
modfreq = MouseY.kr(1, 5000, 'exponential');
carrier = SinOsc.ar(carrfreq, 0, 0.5);
modulator = SinOsc.ar(modfreq, 0, 0.5);
carrier * modulator;
}.scope
)
(
{ SinOsc.ar(440, 0, 0.5) }.scope
)
(
{ SinOsc.ar(440, 0, 0.5, 0.5) }.scope
)
(
{
var carrier, modulator, carrfreq, modfreq;
carrfreq = MouseX.kr(440, 5000, 'exponential');
modfreq = MouseY.kr(1, 5000, 'exponential');
carrier = SinOsc.ar(carrfreq, 0, 0.5);
modulator = SinOsc.ar(modfreq, 0, 0.25, 0.25);
carrier * modulator;
}.scope
)
(
var w, carrfreqslider, modfreqslider, moddepthslider, synth;
w = Window("frequency modulation", Rect(100, 400, 400, 300));
w.view.decorator = FlowLayout(w.view.bounds);
synth = {
arg carrfreq=440, modfreq=1, moddepth=0.1;
SinOsc.ar(carrfreq + (moddepth * SinOsc.ar(modfreq)), 0, 0.25)
}.scope;
carrfreqslider = EZSlider(
w, 300@50, "carrfreq",
ControlSpec(20, 5000, 'exponential', 10, 440),
{ |ez| synth.set(\carrfreq, ez.value) }
);
w.view.decorator.nextLine;
modfreqslider = EZSlider(
w, 300@50, "modfreq",
ControlSpec(1, 5000, 'exponential', 1, 1),
{ |ez| synth.set(\modfreq, ez.value) }
);
w.view.decorator.nextLine;
moddepthslider = EZSlider(
w, 300@50, "moddepth",
ControlSpec(0.01, 5000, 'exponential', 0.01, 0.01),
{ |ez| synth.set(\moddepth, ez.value) }
);
w.front;
)

Loading…
Cancel
Save