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: 18.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
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica
}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #ad140d}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #2c7014}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000}
19 p
.p10
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
20 p
.p11
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #bf0000; min-height: 12.0px}
21 p
.p12
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000; min-height: 12.0px}
22 p
.p13
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica
; min-height: 17.0px}
23 p
.p14
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #001bb9}
24 span
.s1
{color: #001bb9}
25 span
.s2
{color: #000000}
26 span
.s3
{color: #2c7014}
27 span
.s4
{color: #ad140d}
28 span
.s5
{color: #0000ff}
29 span
.s6
{color: #0000bf}
30 span
.s7
{text-decoration: underline
; color: #0021e7}
31 span
.s8
{font: 12.0px Helvetica
}
32 span
.Apple-tab-span
{white-space:pre
}
36 <p class=
"p1"><b>Groups
</b></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p3">Our discussion about the order of synths on the server brings us to the topic of groups. Synths on the server are a type of what are called
<i>nodes
</i>. There's one other type of node: groups. Groups are simply collections of nodes, and can contain synths, other groups, or combinations of both. They are mostly useful in two ways: First they are very helpful in controlling order, second, they allow you to easily group together nodes and send them messages all at once. As you've probably guessed, there's a handy Server abstraction object to represent group nodes in the client app: Group.
</p>
39 <p class=
"p2"><br></p>
40 <p class=
"p4"><b>Groups as Ordering Tools
</b></p>
41 <p class=
"p2"><br></p>
42 <p class=
"p3">Groups can be quite helpful in terms of controlling order. Like synths they take targets and addActions as arguments, which makes it easy to put them in position.
</p>
43 <p class=
"p5"><br></p>
44 <p class=
"p6"><span class=
"Apple-tab-span"> </span>g =
<span class=
"s1">Group
</span>.new;
</p>
45 <p class=
"p6"><span class=
"Apple-tab-span"> </span>h =
<span class=
"s1">Group
</span>.before(g);
</p>
46 <p class=
"p6"><span class=
"Apple-tab-span"> </span>g.free; h.free;
</p>
47 <p class=
"p2"><br></p>
48 <p class=
"p3">This can be very helpful for things like keeping effects or processing separate from sound sources, and in the right order. Let's reconsider our reverb example from the previous section.
</p>
49 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
50 <p class=
"p6"><span class=
"Apple-tab-span"> </span>(
</p>
51 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// a stereo version
</p>
52 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">SynthDef
</span>(
<span class=
"s3">\tutorial_DecaySin2
</span>, {
<span class=
"s1">arg
</span> outBus =
0, effectBus, direct =
0.5, freq =
440;
</p>
53 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">var
</span> source;
</p>
54 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>//
1.0.rand2 returns a random number from -
1 to
1, used here for a random pan
</p>
55 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>source =
<span class=
"s1">Pan2
</span>.ar(
<span class=
"s1">Decay2
</span>.ar(
<span class=
"s1">Impulse
</span>.ar(
<span class=
"s1">Rand
</span>(
0.3,
1),
0,
0.125),
0.3,
1,
<span class=
"Apple-converted-space"> </span></p>
56 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">SinOsc
</span>.ar(
<span class=
"s1">SinOsc
</span>.kr(
0.2,
0,
110, freq))),
<span class=
"s1">Rand
</span>(-
1.0,
1.0));
</p>
57 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">Out
</span>.ar(outBus, source * direct);
</p>
58 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">Out
</span>.ar(effectBus, source * (
1 - direct));
</p>
59 <p class=
"p6"><span class=
"Apple-tab-span"> </span>}).send(s);
</p>
60 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
61 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">SynthDef
</span>(
<span class=
"s3">\tutorial_Reverb2
</span>, {
<span class=
"s1">arg
</span> outBus =
0, inBus;
</p>
62 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">var
</span> input;
</p>
63 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>input =
<span class=
"s1">In
</span>.ar(inBus,
2);
</p>
64 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>16.do({ input =
<span class=
"s1">AllpassC
</span>.ar(input,
0.04,
<span class=
"s1">Rand
</span>(
0.001,
0.04),
3)});
</p>
65 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s1">Out
</span>.ar(outBus, input);
</p>
66 <p class=
"p6"><span class=
"Apple-tab-span"> </span>}).send(s);
</p>
67 <p class=
"p6"><span class=
"Apple-tab-span"> </span>)
</p>
68 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
69 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// now we create groups for effects and synths
</p>
70 <p class=
"p6"><span class=
"Apple-tab-span"> </span>(
</p>
71 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~sources =
<span class=
"s1">Group
</span>.new;
</p>
72 <p class=
"p6"><span class=
"Apple-tab-span"> </span>~effects =
<span class=
"s1">Group
</span>.after(~sources);
<span class=
"Apple-tab-span"> </span><span class=
"s4">// make sure it's after
</span></p>
73 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"s2">~bus =
</span><span class=
"s1">Bus
</span><span class=
"s2">.audio(s,
2);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// this will be our stereo effects bus
</p>
74 <p class=
"p6"><span class=
"Apple-tab-span"> </span>)
</p>
75 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
76 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// now synths in the groups. The default addAction is \addToHead
</p>
77 <p class=
"p6"><span class=
"Apple-tab-span"> </span>(
</p>
78 <p class=
"p6"><span class=
"Apple-tab-span"> </span>x =
<span class=
"s1">Synth
</span>(
<span class=
"s3">\tutorial_Reverb2
</span>, [
<span class=
"s3">\inBus
</span>, b], ~effects);
</p>
79 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span>y =
</span><span class=
"s1">Synth
</span><span class=
"s2">(
</span>\tutorial_DecaySin2
<span class=
"s2">, [
</span>\effectBus
<span class=
"s2">, ~bus,
</span>\outBus
<span class=
"s2">,
0], ~sources);
</span></p>
80 <p class=
"p8"><span class=
"s2"><span class=
"Apple-tab-span"> </span>z =
</span><span class=
"s1">Synth
</span><span class=
"s2">(
</span>\tutorial_DecaySin2
<span class=
"s2">, [
</span>\effectBus
<span class=
"s2">, ~bus,
</span>\outBus
<span class=
"s2">,
0,
</span>\freq
<span class=
"s2">,
660], ~sources);
</span></p>
81 <p class=
"p6"><span class=
"Apple-tab-span"> </span>)
</p>
82 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
83 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// we could add other source and effects synths here
</p>
84 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
85 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>~sources.free; ~effects.free;
</span>// this frees their contents (x, y, z) as well
</p>
86 <p class=
"p6"><span class=
"s4"><span class=
"Apple-tab-span"> </span></span>~bus.free;
</p>
87 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
88 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// remove references to ~sources and ~effects environment variables:
</p>
89 <p class=
"p6"><span class=
"Apple-tab-span"> </span>currentEnvironment.clear;
</p>
90 <p class=
"p2"><br></p>
91 <p class=
"p3">Note that we probably don't care what order the sources and effects are within the groups, all that matters is that all effects synths come after the source synths that they process.
</p>
92 <p class=
"p2"><br></p>
93 <p class=
"p3">If you're wondering about the names '~sources' and '~effects', placing a tilde (~) in front of a word is a way of creating an
<i>environment variable
</i>. For the moment, all you need to know about them is that they can be used in the same way as interpreter variables (you don't need to declare them, and they are persistent), and they allow for more descriptive names. You should consider using
<b>variable definitions
</b> and
<a href=
"../../Core/Kernel/Function.html"><span class=
"s5">Function
</span></a>s wherever no later direct access is needed – a large number of environment variables may cause bugs that are hard to find. Remember to
<b>clear
</b> the currentEnvironment (see above) to avoid interference.
</p>
94 <p class=
"p2"><br></p>
95 <p class=
"p9">// to be sure, create a new
<a href=
"../../Collections/Environment.html"><span class=
"s5">Environment
</span></a>:
</p>
96 <p class=
"p10"><span class=
"Apple-tab-span"> </span><span class=
"s6">Environment
</span>.new.push;
</p>
97 <p class=
"p11"><br></p>
98 <p class=
"p9">// some code..
</p>
99 <p class=
"p12"><br></p>
100 <p class=
"p9">// restore old environment
</p>
101 <p class=
"p10"><span class=
"Apple-tab-span"> </span>currentEnvironment.pop;
</p>
102 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
103 <p class=
"p4"><b>All the addActions
</b></p>
104 <p class=
"p13"><br></p>
105 <p class=
"p3">At this point it's probably good to cover the remaining add actions. In addition to \addBefore and \addAfter, there is also the (rarely) used \addReplace, and two add actions which apply to Groups: \addToHead and \addToTail. The former adds the receiver to the beginning of the group, so that it will execute first, the latter to the end of the group, so that it will execute last. Like the other addActions, \addToHead and \addToTail have convenience methods called 'head' and 'tail'.
</p>
106 <p class=
"p2"><br></p>
107 <p class=
"p6"><span class=
"Apple-tab-span"> </span>g =
<span class=
"s1">Group
</span>.new;
</p>
108 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>h =
</span><span class=
"s1">Group
</span><span class=
"s2">.head(g);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// add h to the head of g
</p>
109 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>x =
</span><span class=
"s1">Synth
</span><span class=
"s2">.tail(h,
</span><span class=
"s3">\default
</span><span class=
"s2">);
<span class=
"Apple-tab-span"> </span></span>// add x to the tail of h
</p>
110 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>s.queryAllNodes;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// this will post a representation of the node hierarchy
</p>
111 <p class=
"p6"><span class=
"Apple-tab-span"> </span>x.free; h.free; g.free;
</p>
112 <p class=
"p5"><br></p>
113 <p class=
"p4"><b>'queryAllNodes' and node IDs
</b></p>
114 <p class=
"p2"><br></p>
115 <p class=
"p3">Server has a method called 'queryAllNodes' which will post a representation of the server's node tree. You should have seen something like the following in the post window when executing the example above:
</p>
116 <p class=
"p2"><br></p>
117 <p class=
"p6">nodes on localhost:
</p>
118 <p class=
"p6">a Server
</p>
119 <p class=
"p6">Group(
0)
</p>
120 <p class=
"p6"><span class=
"Apple-converted-space"> </span>Group(
1)
</p>
121 <p class=
"p6"><span class=
"Apple-converted-space"> </span>Group(
1000)
</p>
122 <p class=
"p6"><span class=
"Apple-converted-space"> </span>Group(
1001)
</p>
123 <p class=
"p6"><span class=
"Apple-converted-space"> </span>Synth
1002</p>
124 <p class=
"p5"><span class=
"Apple-converted-space"> </span></p>
125 <p class=
"p3">When you see a Group printed here, anything below it and indented to the right is contained within it. The order of nodes is from top to bottom. The numbers you see are what are called node IDs, which are how the server keeps track of nodes. Normally when working with Server abstraction objects you won't need to deal with node IDs as the objects keep track of them, assigning and freeing them when appropriate.
</p>
126 <p class=
"p2"><br></p>
127 <p class=
"p3">You may have been wondering why there were four groups posted above when we only created two. The first two, with the IDs
0 and
1, are special groups, called the RootNode and the 'default group'.
</p>
128 <p class=
"p13"><br></p>
129 <p class=
"p4"><b>The Root Node and the Default Group
</b></p>
130 <p class=
"p13"><br></p>
131 <p class=
"p3">When a server app is booted there is a special group created with a node ID of
0. This represents the top of the server's node tree. There is a special server abstraction object to represent this, called RootNode. In addition there is another group created with an ID of
1, called the default group. This is the default target for all Nodes
<span class=
"Apple-converted-space"> </span>and is what you will get if you supply a Server as a target. If you don't specify a target or pass in nil, you will get the default group of the default Server.
<span class=
"Apple-converted-space"> </span></p>
132 <p class=
"p2"><br></p>
133 <p class=
"p6"><span class=
"s1"><span class=
"Apple-tab-span"> </span>Server
</span>.default.boot;
</p>
134 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>a =
</span><span class=
"s1">Synth
</span><span class=
"s2">.new(
</span><span class=
"s3">\default
</span><span class=
"s2">);
</span>// creates a synth in the default group of the default Server
</p>
135 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>a.group;
</span>// Returns a Group object. Note the ID of
1 (the default group) in the post window
</p>
136 <p class=
"p2"><br></p>
137 <p class=
"p3">The default group serves an important purpose: It provides a predictable basic Node tree so that methods such as Server-scope and Server-record (which create nodes which
<i>must
</i> come after everything else) can function without running into order of execution problems. In the example below the scoping node will come after the default group.
</p>
138 <p class=
"p2"><br></p>
139 <p class=
"p6"><span class=
"s1"><span class=
"Apple-tab-span"> </span>Server
</span>.internal.boot;
</p>
140 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
141 <p class=
"p6"><span class=
"Apple-tab-span"> </span>{
<span class=
"s1">SinOsc
</span>.ar(mul:
0.2) }.scope(
1);
</p>
142 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
143 <p class=
"p7"><span class=
"Apple-tab-span"> </span>// watch the post window;
</p>
144 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">Server
</span>.internal.queryAllNodes;
<span class=
"Apple-converted-space"> </span></p>
145 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
146 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// our SinOsc synth is within the default group (ID
1)
</p>
147 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// the scope node ('stethoscope') comes after the default group, so no problems
</p>
148 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
149 <p class=
"p6"><span class=
"s1"><span class=
"Apple-tab-span"> </span>Server
</span>.internal.quit;
</p>
150 <p class=
"p2"><br></p>
151 <p class=
"p3">In general you should add nodes to the default group, or groups contained within it, and
<i>not
</i> before or after it. When adding an 'effects' synth, for instance, one should resist the temptation to add it after the default group, and instead create a separate source group within the default group. This will prevent problems with scoping or recording.
<span class=
"Apple-converted-space"> </span></p>
152 <p class=
"p2"><br></p>
153 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span>default group [
</b></p>
154 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>source group [
</b></p>
155 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>source synth1
</b></p>
156 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>source synth2
</b></p>
157 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>]
</b></p>
158 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>effects synth
</b></p>
159 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span>]
</b></p>
160 <p class=
"p3"><b><span class=
"Apple-tab-span"> </span>recording synth
</b></p>
161 <p class=
"p13"><br></p>
162 <p class=
"p4"><b>Groups as, well, groups...
</b></p>
163 <p class=
"p2"><br></p>
164 <p class=
"p3">The other major use of groups is to allow you to easily treat a number of synths as a whole. If you send a 'set' message to a group, it will apply that message to all nodes contained within it.
</p>
165 <p class=
"p2"><br></p>
166 <p class=
"p6"><span class=
"Apple-tab-span"> </span>g =
<span class=
"s1">Group
</span>.new;
</p>
167 <p class=
"p5"><span class=
"Apple-tab-span"> </span></p>
168 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>// make
4 synths in g
</p>
169 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>//
1.0.rand2 returns a random number from -
1 to
1.
<span class=
"Apple-converted-space"> </span></p>
170 <p class=
"p6"><span class=
"Apple-tab-span"> </span>4.do({ {
<span class=
"s1">arg
</span> amp =
0.1;
<span class=
"s1">Pan2
</span>.ar(
<span class=
"s1">SinOsc
</span>.ar(
440 +
110.rand,
0, amp),
1.0.rand2) }.play(g); });
</p>
171 <p class=
"p5"><br></p>
172 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span>g.set(
</span><span class=
"s3">\amp
</span><span class=
"s2">,
0.005);
</span>// turn them all down
</p>
173 <p class=
"p5"><br></p>
174 <p class=
"p6"><span class=
"Apple-tab-span"> </span>g.free;
</p>
175 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
176 <p class=
"p4"><b>Groups, their Inheritance, and More on Tracking Down Help
</b></p>
177 <p class=
"p2"><br></p>
178 <p class=
"p3">Now for a little more OOP theory. Both Group and Synth are examples of what are called
<i>subclasses
</i>. You can think of subclasses as being children of a parent class, called their
<i>superclass
</i>. All subclasses inherit the methods of their superclass. They may
<i>override
</i> some methods with their own implementation (taking advantage of
<i>polymorphism
</i>), but in general subclasses respond to all the methods of their superclass, and some other ones of their own. Some classes are
<i>abstract classes
</i>, which means that you don't actually make instances of them, they just exist to provide a common set of methods and variables to their subclasses.
<span class=
"Apple-converted-space"> </span></p>
179 <p class=
"p2"><br></p>
180 <p class=
"p3">We might for instance imagine an abstract class called Dog, which has a number of subclasses, such as Terrier, BassetHound, etc. These might all have a 'run' method, but not all would need a 'herdSheep' method.
</p>
181 <p class=
"p2"><br></p>
182 <p class=
"p3">This way of working has certain advantages: If you need to change an inherited method, you can do so in one place, and all the subclasses which inherit it will be changed too. As well, if you want to extend a class to make your own personal variant or enhanced version, you can automatically get all the functionality of the superclass.
</p>
183 <p class=
"p2"><br></p>
184 <p class=
"p3">Inheritance can go back through many levels, which is to say that a class' superclass may also have a superclass. (A class cannot, however have more than one immediate superclass.) All objects in SC in fact inherit from a class called Object, which defines a certain set of methods which all its subclasses either inherit or override.
</p>
185 <p class=
"p2"><br></p>
186 <p class=
"p3">Group and Synth are subclasses of the abstract class
<a href=
"../../ServerArchitecture/Node.html"><span class=
"s1">Node
</span></a>. Because of this, some of their methods are defined in Node, and (perhaps more practically important)
<i>are documented in Node's helpfile
</i>.
<span class=
"Apple-converted-space"> </span></p>
187 <p class=
"p2"><br></p>
188 <p class=
"p3">So if you're looking at a helpfile and can't find a particular method that a class responds to, you may need to go to the helpfile for that class' superclass, or farther up the chain. Most classes have their superclass listed at the top of their helpfile. You can also use the following methods for getting this kind of info and tracking down documentation (watch the post window):
</p>
189 <p class=
"p2"><br></p>
190 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span><span class=
"s1">Group
</span><span class=
"s2">.superclass;
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// this will return 'Node'
</p>
191 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">Group
</span>.superclass.openHelpFile;
</p>
192 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">Group
</span>.findRespondingMethodFor(
<span class=
"s3">'set'
</span>);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">// Node-set
</span></p>
193 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s1">Group
</span>.findRespondingMethodFor(
<span class=
"s3">'postln'
</span>);
<span class=
"Apple-tab-span"> </span><span class=
"s4">// Object-postln;
</span></p>
194 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span><span class=
"s1">Group
</span><span class=
"s2">.helpFileForMethod(
</span><span class=
"s3">'postln'
</span><span class=
"s2">);
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span>// opens class Object help file
</p>
195 <p class=
"p2"><br></p>
196 <p class=
"p3">For more information see:
<b><span class=
"Apple-converted-space"> </span></b></p>
197 <p class=
"p2"><br></p>
198 <p class=
"p14"><span class=
"s7"><a href=
"../../ServerArchitecture/Group.html">Group
</a></span><span class=
"s2"><b> </b><a href=
"../../ServerArchitecture/Node.html"><span class=
"s8">Node
</span></a><b> </b><a href=
"../../ServerArchitecture/default_group.html"><span class=
"s8">default_group
</span></a><b> </b><a href=
"../../ServerArchitecture/RootNode.html"><span class=
"s8">RootNode
</span></a><b> </b><a href=
"../../Language/Intro-to-Objects.html"><span class=
"s8">Intro-to-Objects
</span></a><b> </b><a href=
"../../ServerArchitecture/Order-of-execution.html"><span class=
"s8">Order-of-execution
</span></a><b> </b><a href=
"../../ServerArchitecture/Synth.html"><span class=
"s8">Synth
</span></a><b> </b><a href=
"../../More-On-Getting-Help.html"><span class=
"s8">More-On-Getting-Help
</span></a><b> </b><a href=
"../../Other Topics/Internal-Snooping.html"><span class=
"s8">Internal-Snooping
</span></a></span></p>
199 <p class=
"p2"><br></p>
200 <p class=
"p3">____________________
</p>
201 <p class=
"p2"><br></p>
202 <p class=
"p3">This document is part of the tutorial
<b>Getting Started With SuperCollider
</b>.
</p>
203 <p class=
"p2"><br></p>
204 <p class=
"p3">Click here to go on to the next section:
<a href=
"Buffers.html"><span class=
"s1">Buffers
</span></a></p>
205 <p class=
"p2"><br></p>
206 <p class=
"p3">Click here to return to the table of Contents:
<a href=
"Getting Started With SC.html"><span class=
"s1">Getting Started With SC
</span></a></p>