1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"949.35">
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: 9.0px Monaco
; min-height: 12.0px}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000; min-height: 12.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #0000bf}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
18 span
.s1
{font: 18.0px Helvetica
}
19 span
.s2
{color: #0000ff}
20 span
.s3
{color: #000000}
21 span
.s4
{color: #0000bf}
22 span
.s5
{color: #606060}
23 span
.s6
{color: #007300}
24 span
.Apple-tab-span
{white-space:pre
}
28 <p class=
"p1"><span class=
"s1"><b>TempoBusClock
</b></span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><b>a clock that synchronizes its tempo with the server
</b></p>
29 <p class=
"p2"><br></p>
30 <p class=
"p1">superclass: TempoClock
</p>
31 <p class=
"p2"><br></p>
32 <p class=
"p2"><br></p>
33 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>*new(control, tempo, beats, seconds)
</b></p>
34 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>return a new instance.
<span class=
"Apple-converted-space"> </span></p>
35 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><b>control
</b> can be anything that responds to the message set(key, val, ...)
</p>
36 <p class=
"p1"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>e.g. a Synth or a NodeProxy. The control key set is
"tempo"</p>
37 <p class=
"p2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
38 <p class=
"p1"><span class=
"Apple-tab-span"> </span>otherwise TempoBusClock works just like a
<a href=
"../../../Scheduling/TempoClock.html"><span class=
"s2">TempoClock
</span></a></p>
39 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
40 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
41 <p class=
"p4"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// example
</p>
42 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
43 <p class=
"p6"><span class=
"Apple-tab-span"> </span>(
</p>
44 <p class=
"p6"><span class=
"Apple-tab-span"> </span>a = {
<span class=
"s4">|tempo=
1|
</span> <span class=
"s4">Ringz
</span>.ar(
<span class=
"s4">Impulse
</span>.ar(tempo), [
501,
500],
1/tempo) }.play;
</p>
45 <p class=
"p7"><span class=
"s3"><span class=
"Apple-tab-span"> </span>t =
</span>TempoBusClock
<span class=
"s3">(a);
</span></p>
46 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s4">Task
</span> { loop {
<span class=
"s5">"klink"</span>.postln;
1.wait } }.play(t);
</p>
47 <p class=
"p6"><span class=
"Apple-tab-span"> </span>);
</p>
48 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
49 <p class=
"p6"><span class=
"Apple-tab-span"> </span>t.tempo =
1.3;
</p>
50 <p class=
"p6"><span class=
"Apple-tab-span"> </span>t.tempo =
0.5;
</p>
51 <p class=
"p6"><span class=
"Apple-tab-span"> </span>t.tempo =
1.0;
</p>
52 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
53 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
54 <p class=
"p4"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// in ProxySpace, a TempoBusClock can be added together with a ~tempo NodeProxy:
</p>
55 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
56 <p class=
"p6"><span class=
"Apple-tab-span"> </span>p =
<span class=
"s4">ProxySpace
</span>.push(s);
</p>
57 <p class=
"p6"><span class=
"Apple-tab-span"> </span>p.makeTempoClock;
</p>
58 <p class=
"p4"><span class=
"s3"><span class=
"Apple-tab-span"> </span>p.clock;
</span>// now the ProxySpace's clock is a TempoBusClock
</p>
59 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
60 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~out.play;
</p>
61 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~out = {
<span class=
"s4">Ringz
</span>.ar(
<span class=
"s4">Impulse
</span>.ar(~tempo.kr), [
501,
500],
1/~tempo.kr) *
0.3 };
</p>
62 <p class=
"p6"><span class=
"Apple-tab-span"> </span>p.clock.tempo =
1.3;
</p>
63 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
64 <p class=
"p4"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// patterns and tasks are synchronized:
</p>
65 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
66 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~out2.play;
</p>
67 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~out2 =
<span class=
"s4">Pbind
</span>(
<span class=
"s6">\dur
</span>,
1,
<span class=
"s6">\note
</span>,
<span class=
"s4">Pwhite
</span>(
0,
7,
<span class=
"s4">inf
</span>));
</p>
68 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
69 <p class=
"p6"><span class=
"Apple-tab-span"> </span>p.clock.tempo =
3;
<span class=
"Apple-tab-span"> </span></p>
70 <p class=
"p8"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>p.clock.tempo =
1;
<span class=
"Apple-tab-span"> </span></p>
71 <p class=
"p3"><br></p>
72 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
73 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
74 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>