cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / InOut / SharedIn.html
blob3d439f5846f072e706d3d533dfe43358164ec871
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #001bb9}
13 p.p4 {margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.0px; font: 12.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #982316}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #606060}
18 p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0025b2}
19 span.s1 {font: 18.0px Helvetica}
20 span.s2 {color: #000000}
21 span.s3 {color: #0021e7}
22 span.s4 {color: #0000ff}
23 span.s5 {color: #0025b2}
24 span.s6 {color: #982316}
25 span.s7 {color: #416d1f}
26 span.s8 {color: #606060}
27 span.Apple-tab-span {white-space:pre}
28 </style>
29 </head>
30 <body>
31 <p class="p1"><span class="s1"><b>SharedIn<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b><span class="Apple-tab-span"> </span>read from a shared control bus</b></p>
32 <p class="p2"><br></p>
33 <p class="p3"><span class="s2"><b>Inherits from: </b><a href="../../Core/Object.html"><span class="s3"><b>Object</b></span></a></span><b> : </b><a href="../../Core/Kernel/AbstractFunction.html"><b>AbstractFunction</b></a><b> : </b><a href="../UGen.html"><b>UGen</b></a><b> : </b><a href="../Multichannel/MultiOutUGen.html"><b>MultiOutUGen</b></a><b> : </b><a href="AbstractIn.html"><span class="s3"><b>AbstractIn</b></span></a></p>
34 <p class="p2"><br></p>
35 <p class="p1"><b>SharedIn.kr(bus, numChannels)</b></p>
36 <p class="p2"><br></p>
37 <p class="p1">Reads from a control bus shared between the internal server and the SC client. Control rate only. Writing to a shared control bus from the client is synchronous. When not using the internal server use node arguments or the set method of <a href="../../ServerArchitecture/Bus.html"><span class="s4">Bus</span></a> (or /c_set in messaging style).<span class="Apple-converted-space"> </span></p>
38 <p class="p2"><br></p>
39 <p class="p1"><b>bus</b> - the index of the shared control bus to read from</p>
40 <p class="p4"><b>numChannels </b>- the number of channels (i.e. adjacent buses) to read in. The default is 1. You cannot modulate this number by assigning it to an argument in a SynthDef.</p>
41 <p class="p2"><br></p>
42 <p class="p5">(</p>
43 <p class="p6">// only works with the internal server</p>
44 <p class="p5">s = <span class="s5">Server</span>.internal;</p>
45 <p class="p5">s.boot;</p>
46 <p class="p5">)</p>
47 <p class="p7"><br></p>
48 <p class="p5">(</p>
49 <p class="p8"><span class="s5">SynthDef</span><span class="s2">(</span>"help-SharedIn1"<span class="s2">, {</span></p>
50 <p class="p5"><span class="Apple-tab-span"> </span><span class="s5">Out</span>.ar(0, <span class="s5">SinOsc</span>.ar(<span class="s5">Lag</span>.kr(<span class="s5">SharedIn</span>.kr(0, 1), 0.01), 0, 0.2));</p>
51 <p class="p5">}).send(s);</p>
52 <p class="p8"><span class="s5">SynthDef</span><span class="s2">(</span>"help-SharedIn2"<span class="s2">, {</span></p>
53 <p class="p5"><span class="Apple-tab-span"> </span><span class="s5">Out</span>.ar(1, <span class="s5">SinOsc</span>.ar(<span class="s5">Lag</span>.kr(<span class="s5">SharedIn</span>.kr(0, 1), 0.01, 1.5), 0, 0.2));</p>
54 <p class="p5">}).send(s);</p>
55 <p class="p5">)</p>
56 <p class="p7"><br></p>
57 <p class="p5">(</p>
58 <p class="p5">s.setSharedControl(0, 300); <span class="s6">// an initial value</span></p>
59 <p class="p5">s.sendMsg(<span class="s7">\s_new</span>, <span class="s8">"help-SharedIn1"</span>, x = s.nextNodeID, 0, 1);</p>
60 <p class="p5">s.sendMsg(<span class="s7">\s_new</span>, <span class="s8">"help-SharedIn2"</span>, y = s.nextNodeID, 0, 1);</p>
61 <p class="p7"><br></p>
62 <p class="p9">Routine<span class="s2">({</span></p>
63 <p class="p5"><span class="Apple-tab-span"> </span>30.do({</p>
64 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>s.setSharedControl(0, 300 * (10.rand + 1));</p>
65 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>0.2.wait;</p>
66 <p class="p5"><span class="Apple-tab-span"> </span>});</p>
67 <p class="p5"><span class="Apple-tab-span"> </span>s.sendMsg(<span class="s7">\n_free</span>, x);</p>
68 <p class="p5"><span class="Apple-tab-span"> </span>s.sendMsg(<span class="s7">\n_free</span>, y);</p>
69 <p class="p5">}).play;</p>
70 <p class="p5">)</p>
71 <p class="p7"><br></p>
72 <p class="p7"><br></p>
73 <p class="p5">s.quit;</p>
74 <p class="p2"><br></p>
75 </body>
76 </html>