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.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: 9.0px Monaco
; color: #000000}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica
; min-height: 17.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco
; min-height: 16.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000; min-height: 12.0px}
17 span
.s1
{font: 15.0px Helvetica
}
18 span
.s2
{color: #0000ff}
19 span
.s3
{color: #000000}
20 span
.s4
{color: #007300}
21 span
.Apple-tab-span
{white-space:pre
}
25 <p class=
"p1"><span class=
"s1"><b>NodeEvent
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>synth- and group- like interface of Event
</b></p>
26 <p class=
"p2"><br></p>
27 <p class=
"p1">see also:
<a href=
"../Collections/Event.html"><span class=
"s2">Event
</span></a></p>
28 <p class=
"p2"><br></p>
29 <p class=
"p1">The methods
<b>Event-synth
</b> and
<b>Event-group
</b>set the parent event of the receiver to specialized events that
<b><span class=
"Apple-converted-space"> </span></b> duplicate the functionality of
<a href=
"../ServerArchitecture/Synth.html"><span class=
"s2">Synth
</span></a> and
<a href=
"../ServerArchitecture/Group.html"><span class=
"s2">Group
</span></a> objects. These objects follow the naming conventions of patterns (i.e., groups and addActions are integer ID's) and have the same stop/play/pause/resume interface as the EventStreamPlayers created by Pattern-play.
<span class=
"Apple-converted-space"> </span>So, they can be used interchangeably with patterns in control schemes and GUI's.
</p>
30 <p class=
"p2"><br></p>
31 <p class=
"p1">The following example creates
<span class=
"Apple-converted-space"> </span>a group with nodeID =
2 and plays a synth within it.
<span class=
"Apple-converted-space"> </span></p>
32 <p class=
"p2"><br></p>
33 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g = (id:
2).group;
</p>
34 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g.play;
</p>
35 <p class=
"p3"><span class=
"Apple-tab-span"> </span>a = (group:
2).synth
</p>
36 <p class=
"p3"><span class=
"Apple-tab-span"> </span>a.play;
</p>
37 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g.release;
</p>
38 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g.stop;
</p>
39 <p class=
"p2"><br></p>
40 <p class=
"p2"><br></p>
41 <p class=
"p1"><b>interface:
</b></p>
42 <p class=
"p2"><br></p>
43 <p class=
"p1"><b>play
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>starts synth or group, returns this.delta
</p>
44 <p class=
"p1"><b>stop
<span class=
"Apple-tab-span"> </span></b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>if ev[\hasGate] == true set gate to
0, otherwise frees the node
</p>
45 <p class=
"p1"><b>pause
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>disables the node
</p>
46 <p class=
"p1"><b>resume
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>reenables the node
</p>
47 <p class=
"p1"><b>set( key, value)
<span class=
"Apple-tab-span"> </span></b>sets control identified by key to value
</p>
48 <p class=
"p1"><b>split
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>returns an array of events, one for each synth or group specified by the receiver
</p>
49 <p class=
"p2"><br></p>
50 <p class=
"p1"><b>map(key, busID)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>maps control to control bus
</p>
51 <p class=
"p1"><b>before(nodeID)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>moves to immediately before nodeID
</p>
52 <p class=
"p1"><b>after(nodeID)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>moves to immediately after nodeID
</p>
53 <p class=
"p1"><b>headOf(nodeID)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>moves to immediately to head of nodeID
</p>
54 <p class=
"p1"><b>tailOf(nodeID)
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b>moves to immediately to tail of nodeID
</p>
55 <p class=
"p4"><br></p>
56 <p class=
"p5"><br></p>
57 <p class=
"p1">With the exception of ~server, ~latency, and ~instrument any key in the event can have an array as a
<span class=
"Apple-converted-space"> </span></p>
58 <p class=
"p1">value and the standard rules of multi-channel expansion will be followed.
<span class=
"Apple-converted-space"> </span></p>
59 <p class=
"p2"><br></p>
60 <p class=
"p6">// Here is a simple example of its use:
</p>
61 <p class=
"p7"><br></p>
63 <p class=
"p6"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// define a multiple Group event
</p>
64 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g = (id: [
2,
3,
4,
5,
6], group:
0, addAction:
1).group ;
<span class=
"Apple-converted-space"> </span></p>
65 <p class=
"p6"><span class=
"s3"><span class=
"Apple-tab-span"> </span>g.play;
</span>// play it
</p>
66 <p class=
"p7"><br></p>
67 <p class=
"p6"><span class=
"s3"><span class=
"Apple-tab-span"> </span></span>// make a Synth event
</p>
68 <p class=
"p3"><span class=
"Apple-tab-span"> </span>b = ( freq: [
500,
510], group: [
2,
3]).synth;
<span class=
"Apple-converted-space"> </span></p>
69 <p class=
"p3"><span class=
"Apple-tab-span"> </span>b.play;
</p>
70 <p class=
"p7"><span class=
"Apple-tab-span"> </span></p>
71 <p class=
"p3"><span class=
"Apple-tab-span"> </span>b.set(
<span class=
"s4">\freq
</span>,[
1000,
1006])
</p>
72 <p class=
"p7"><br></p>
73 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g.release
</p>
74 <p class=
"p7"><br></p>
75 <p class=
"p3"><span class=
"Apple-tab-span"> </span>b.play;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
76 <p class=
"p6"><span class=
"s3"><span class=
"Apple-tab-span"> </span>h = g.split;
<span class=
"Apple-tab-span"> </span></span>// split into individual group events
</p>
77 <p class=
"p6"><span class=
"s3"><span class=
"Apple-tab-span"> </span>c = b.split;
<span class=
"Apple-tab-span"> </span>/
</span>/ and synth events
</p>
78 <p class=
"p3"><span class=
"Apple-tab-span"> </span>c[
0].set(
<span class=
"s4">\freq
</span>,
700);
</p>
79 <p class=
"p3"><span class=
"Apple-tab-span"> </span>c[
1].set(
<span class=
"s4">\freq
</span>,
400);
</p>
80 <p class=
"p7"><span class=
"Apple-tab-span"> </span></p>
81 <p class=
"p3"><span class=
"Apple-tab-span"> </span>h[
0].stop;
</p>
82 <p class=
"p3"><span class=
"Apple-tab-span"> </span>h[
1].stop;
</p>
83 <p class=
"p7"><span class=
"Apple-tab-span"> </span></p>
84 <p class=
"p3"><span class=
"Apple-tab-span"> </span>g.stop;
</p>
86 <p class=
"p7"><br></p>