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