From f6498b0a1605e898e10521ae4708acde3a1ddd0c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 21 Oct 2015 17:19:54 -0400 Subject: [PATCH] More fun with SuperCollider tutorial --- sclang-play/tutorial.sc | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/sclang-play/tutorial.sc b/sclang-play/tutorial.sc index b87f65d..bdccf2a 100644 --- a/sclang-play/tutorial.sc +++ b/sclang-play/tutorial.sc @@ -110,6 +110,90 @@ }.scope(zoom: 10); ) +( + SynthDef.new( + "tutorial-SinOsc", + { + Out.ar(0, SinOsc.ar(440, 0, 0.2)) + } + ).play; +) + +( + SynthDef.new( + "tutorial-SinOsc-stereo", + { + var outArray; + outArray = [ + SinOsc.ar(440, 0, 0.2), + SinOsc.ar(442, 0, 0.2) + ]; + Out.ar(0, outArray) + } + ).play; +) + +( + x = { SinOsc.ar(660, 0, 0.2) }.play; + y = SynthDef.new( + "tutorial-SinOsc", + { + Out.ar(0, SinOsc.ar(440, 0, 0.2)) + } + ).play; +) + +( + x.free; + y.free; +) + + +( + SynthDef.new( + "tutorial-PinkNoise", + { + Out.ar(0, PinkNoise.ar(0.3)) + } + ).add; + + x = Synth.new("tutorial-PinkNoise"); + y = Synth.new("tutorial-PinkNoise"); +) + +( + f = { + SinOsc.ar(440 + 200.rand, 0, 0.2) + }; + x = f.play; + y = f.play; + z = f.play; +) + +( + SynthDef( + "tutorial-NoRand", + { + Out.ar(0, SinOsc.ar(440 + 200.rand, 0, 0.2)) + } + ).add; + x = Synth("tutorial-NoRand"); + y = Synth("tutorial-NoRand"); + z = Synth("tutorial-NoRand"); +) + +( + SynthDef( + "tutorial-Rand", + { + Out.ar(0, SinOsc.ar(Rand(440, 660), 0, 0.2)) + } + ).add; + x = Synth("tutorial-Rand"); + y = Synth("tutorial-Rand"); + z = Synth("tutorial-Rand"); +) + ( s.scope; )