Bruno Ruviaro edited Control buses.tex  almost 10 years ago

Commit id: d0ddc2eb0605b28871a60e665f47cacc738e51d0

deletions | additions      

       

In the next example, the method \texttt{asMap} is used to directly map a control bus to a running synth node.  \begin{lstlisting}  // Create a SynthDef  SynthDef("simple", {arg freq = 440; Out.ar(0, SinOsc.ar(freq))}).add;  // Creat control buses  ~oneBus = Bus.control(s, 1);  ~anotherBus = Bus.control(s, 1);  // Start controls  {Out.kr(~oneBus, LFSaw.kr(1).range(100, 1000))}.play;  {Out.kr(~anotherBus, LFSaw.kr(2, mul: -1).range(500, 2000))}.play;  // Start a note  x = Synth("simple", [\freq, 800]);  x.set(\freq, ~oneBus.asMap);  x.set(\freq, ~anotherBus.asMap);  x.free;  \end{lstlisting}  \lstinputlisting[style=SuperCollider-IDE, basicstyle=\scttfamily\footnotesize]{code-asmap-control.scd}