-
Notifications
You must be signed in to change notification settings - Fork 5
/
08-architecture.html
64 lines (57 loc) · 2.36 KB
/
08-architecture.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<!-- 2019-03-12 Tue 19:56 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Architecture</title>
<meta name="generator" content="Org mode">
</head>
<body>
<div id="content">
<header>
<h1 class="title">Architecture</h1>
</header><nav id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orga7e0590">1. Server Introspection</a></li>
</ul>
</div>
</nav>
<div id="outline-container-orga7e0590" class="outline-2">
<h2 id="orga7e0590"><span class="section-number-2">1</span> Server Introspection</h2>
<div class="outline-text-2" id="text-1">
<p>
In chapter 4, we saw that a synth can be manually released by supplying the <code>node</code> object returned by the <code>synth</code> function as the first argument to <code>release</code>. But what if we forgot to manually save the <code>node</code> in a variable? Fortunately, it's also possible to control nodes manually by providing their ID number in place of the node object. To find out the ID of a node running on the server, we can use the following code:
</p>
<div class="org-src-container">
<pre class="src src-lisp">(server-query-all-nodes)
</pre>
</div>
<p>
This function doesn't return any results, but it causes the server to print out a list of all groups and nodes currently running, which would typically look similar to the following:
</p>
<pre class="example">
NODE TREE Group 0
1 group
1047 newsynth
</pre>
<p>
This output shows that there is one group running on the server (the default group with ID 1), and in that group is one instance of the "newsynth" synth, running with ID 1047. If we wanted to release this synth, we can simply supply its ID to the <code>release</code> function: <code>(release 1047)</code>. This also works with other functions for controlling synths on the server, such as <code>ctrl</code> or <code>free</code>.
</p>
<p>
Additionally, these functions will work with group IDs as well, in case you want to control all synths in a group simultaneously. So for example, to stop all synths running on the server, you can simply run the following:
</p>
<div class="org-src-container">
<pre class="src src-lisp">(stop 1)
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="date">Last updated: 2019-03-12 Tue 19:56</p>
</div>
</body>
</html>