diff --git a/sclang-play/tutorial.sc b/sclang-play/tutorial.sc index bdccf2a..61e7523 100644 --- a/sclang-play/tutorial.sc +++ b/sclang-play/tutorial.sc @@ -194,6 +194,44 @@ z = Synth("tutorial-Rand"); ) +( + SynthDef( + "tutorial-args", + { + |freq = 440, out = 0| + Out.ar(out, SinOsc.ar(freq, 0, 0.2)) + } + ).add; + Task({ + x = Synth("tutorial-args"); + 1.wait; + y = Synth("tutorial-args", ["freq", 660]); + 1.wait; + z = Synth("tutorial-args", ["freq", 880, "out", 1]); + 1.wait; + x.free; y.free; z.free; + }).play; +) + +( + SynthDef.new( + \tutorialargs, + { + |freq = 440, out = 0| + Out.ar(out, SinOsc.ar(freq, 0, 0.2)); + } + ).add; + Task({ + x = Synth(\tutorialargs); + 1.wait; + x.set(\freq, 660); + 1.wait; + x.set(\freq, 880, \out, 1); + 1.wait; + x.free; + }).play; +) + ( s.scope; )