Debian Codegraph @

doc/8.topics/fudi.htm

raw
1 <!DOCTYPE html>
2 <html lang="en-us">
3 <head>
4 <title>FUDI</title>
5 <style>
6 BODY {
7 background: #ffffff;;
8 color: #000000;
9 font-family: Georgia, serif;
10 font-size: 12 pt;
11 line-height: 1.6;
12 }
13
14 #corpus {
15 width: 6.5in;
16 margin-left: 0.8in;
17 }
18
19 H1, H2, H3, H4, H5, H6, ol, ul, mark, p, PRE {
20 color: #3E4349;
21 }
22
23 H1, H2 {
24 text-align: center;
25 font-weight: normal;
26 }
27
28 PRE {
29 font-size: 110%;
30 background-color:#f0f0f0;
31 text-align: left;
32 border-radius: 8px;
33 padding: 8px;
34 font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
35 }
36
37 /* standard link */
38
39 a:link {
40 text-decoration: none;
41 color: #006699;
42 }
43
44 a:visited {
45 text-decoration: none;
46 color: #006699;
47 }
48
49 a:hover {
50
51 background-color:#eeeee4;
52 }
53
54 a:active {
55 text-decoration: none;
56 color: blue;
57 }
58 </style>
59 <body>
60 <div id=corpus>
61
62 <h1 id="fudi">FUDI</h1>
63 <p><strong>FUDI</strong> is a the networking protocol used by Pd
64 internally to communicate between the GUI process and the DSP process.
65 The same protocol is also used for saving patches to the Pd file. FUDI
66 stands for "Fast Unified Digital Interface" (or according to Miller
67 Puckette, whatever other acronym people can come up with :)</p>
68
69 <h3 id="format">Format:</h3>
70
71 <p><strong>FUDI</strong> is a packet oriented protocol. Each message
72 consists of one or more <strong>atoms</strong>, separated by one or more
73 <strong>whitespace</strong> characters, and it’s terminated by a
74 <strong>semicolon</strong> character. An <strong>atom</strong> is a
75 sequence of one or more characters; whitespaces inside atoms can be
76 escaped by the <strong>backslash</strong> (ascii 92) character (see
77 Examples below).</p>
78
79 <p>A <strong>whitespace</strong> is either a space (ascii 32), a tab
80 (ascii 9) or a newline (ascii 10).</p>
81
82 <p>A <strong>semicolon</strong> (ascii 59) is mandatory to terminate
83 (and send) a message. A <strong>newline</strong> is just treated as
84 whitespace and not needed for message termination.</p>
85
86 <h3 id="implementations">Implementations:</h3>
87
88 <p><strong>[netsend]</strong> / <strong>[netreceive]</strong></p>
89
90 <p>Those classes can be used to transport Pd-messages over a TCP or UDP
91 socket.</p>
92
93 <h3 id="example-messages">Example messages:</h3>
94
95 <pre><code>test/blah 123.45314;</code></pre>
96 <pre><code>my-slider 12;</code></pre>
97 <pre><code>hello this is a message;</code></pre>
98 <pre><code>this message continues
99 in the following
100 line;</code></pre>
101 <pre><code>you; can; send; multiple messages; in a line;</code></pre>
102 <pre><code>this\ is\ one\ whole\ atom;</code></pre>
103 <pre><code>this_atom_contains_a\
104 newline_character_in_it;</code></pre>
105
106 <h3 id="message-conversion">Message conversion:</h3>
107
108 <p><strong>[fudiformat]</strong> / <strong>[fudiparse]</strong></p>
109
110 <p>These classes can be used to convert Pd-messages to FUDI and
111 vice-versa.</p>
112
113 <p><strong>[fudiformat]</strong>: convert Pd messages to FUDI packets.</p>
114 <p><strong>[fudiparse]</strong>: parse FUDI packets into Pd messages</p>
115
116 <hr />
117 <h3 id="using-other-languages-or-tools">Using other languages or
118 tools:</h3>
119
120 <h3 id="pdsend">pdsend</h3>
121
122 <p>usage: <code>pdsend &lt;portnumber&gt; [&lt;host&gt;] [udp|tcp]</code> (default is localhost and
123 tcp)</p>
124
125 <p>Example:</p>
126
127 <pre><code>echo &quot;list foo bar;&quot; | pdsend 8888</code></pre>
128
129 <h3 id="tcl">Tcl</h3>
130
131 <p>Just create a socket object and write data to it:</p>
132
133 <pre><code>set sock [socket localhost 8888]
134 puts $sock &quot;test/blah 123.45314;&quot;</code></pre>
135
136 <p>note that since newline is not mandatory, you can send messages
137 without newline at the end, but you have to flush the socket buffer (or
138 change buffering mode - not recommended):</p>
139
140 <pre><code>set sock [socket localhost 8888]
141 puts -nonewline $sock &quot;test/blah 123.45314;&quot;
142 flush $sock</code></pre>
143
144 <h3 id="netcat">netcat</h3>
145
146 <p>netcat (aka nc) is a handy command line tool for networking. You can
147 use it to send FUDI messages:</p>
148
149 <pre><code>echo &quot;blah;&quot; | nc localhost 8888</code></pre>
150 <hr />
151
152 <h3 id="related">Related:</h3>
153
154 <p>Pd also interfaces via <em>OpenSoundControl</em> (aka
155 <strong>OSC</strong>)</p>
156 <p><a
157 href="https://en.wikipedia.org/wiki/Open_Sound_Control">https://en.wikipedia.org/wiki/Open_Sound_Control</a></p>
158
159 <p>The native OSC objects in Pd are:</p>
160 <p><strong>[oscformat]</strong> - convert Pd lists to OSC packets</p>
161 <p><strong>[oscparse]</strong> - parse OSC packets into Pd messages</p>
162
163 </div>
164 </body>
165 </html>