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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570
|
%---------------------------------------------------
\chapter{OSC support} \label{sec:osc}
%---------------------------------------------------
Most \faust architectures provide Open Sound Control (OSC) support \footnote{The implementation is based internally on the \emph{oscpack} library by Ross Bencina}. This allows \faust applications to be remotely controlled from any OSC capable application, programming language, or hardware device. OSC support can be activated using the
\code{-osc} option when building the application with the appropriate \code{faust2xxx} command. The following table (table \ref{tab:oscarch}) lists \faust's architectures which provide OSC support.
\begin{table}[htp]
\begin{center}
\begin{tabular}{rcc}
\hline
\bf{Audio system} & \bf{Environment} & \bf{OSC support} \\
\hline
%\OSTab{Linux} \\
%\multicolumn{3}{|l|}{Linux} \\
%\hline
\\
\emph{Linux}\\
Alsa & GTK, Qt, Console & yes\\
Jack & GTK, Qt, Console & yes\\
Netjack & GTK, Qt, Console & yes\\
PortAudio & GTK, Qt & yes\\
%\hline
\\
\emph{Mac OS X} \\
%\hline
CoreAudio & Qt & yes\\
Jack & Qt, Console & yes\\
Netjack & Qt, Console & yes\\
PortAudio & Qt & yes\\
%\hline
\\
\emph{Windows} \\
%\hline
Jack & Qt, Console & yes\\
PortAudio & Qt & yes\\
%\hline
\hline
\end{tabular}
\end{center}
\caption{\faust architectures with OSC support.}
\label{tab:oscarch}
\end{table}
\section{A simple example}
%Let's use a very simple 'noise.dsp' example, a white noise generator with a level control, to illustrate how OSC support works:
To illustrate how OSC support works let's define a very simple noise generator with a level control: \lstinline'noise.dsp'
\begin{lstlisting}
process = library("music.lib").noise
* hslider("level", 0, 0, 1, 0.01);
\end{lstlisting}
We are going to compile this example as a standalone Jack QT application with OSC support using the command:
\begin{lstlisting}
faust2jaqt -osc noise.dsp
\end{lstlisting}
When we start the application from the command line:
\begin{lstlisting}
./noise
\end{lstlisting}
we get various information on the standard output, including:
\begin{lstlisting}
Faust OSC version 0.93 application 'noise' is running on UDP ports 5510, 5511, 5512
\end{lstlisting}
As we can see the OSC module makes use of three different UDP ports:
\begin{itemize}
\item \lstinline'5510' is the listening port number: control messages should be addressed to this port.
\item \lstinline'5511' is the output port number: control messages sent by the application and answers to query messages are sent to this port.
\item \lstinline'5512' is the error port number: used for asynchronous error notifications.
\end{itemize}
These OSC parameters can be changed from the command line using one of the following options:
%\begin{lstlisting}
% -port number
% -outport number
% -errport number
% -desthost host
% -xmit 0|1|2
%\end{lstlisting}
\begin{itemize}
\item \lstinline'-port number' set the port number used by the application to receive messages.
\item \lstinline'-outport number' set the port number used by the application to transmit messages.
\item \lstinline'-errport number' set the port number used by the application to transmit error messages.
\item \lstinline'-desthost host' set the destination host for the messages sent by the application.
\item \lstinline'-xmit 0|1|2' turn transmission OFF, ALL, or ALIAS (default OFF). When transmission is OFF, input elements can be controlled using their addresses or aliases (if present). When transmission is ALL, input elements can be controlled using their addresses or aliases (if present), user's actions and output elements (bargraph) are transmitted as OSC messages as well as aliases (if present). When transmission is ALIAS, input elements can only be controlled using their aliases, user's actions and output elements (bargraph) are transmitted as aliases only.
\item \lstinline'-xmitfilter path' allows to filter output messages. Note that 'path' can be a regular expression (like "/freeverb/Reverb1/*").
\end{itemize}
For example:
\begin{lstlisting}
./noise -xmit 1 -desthost 192.168.1.104 -outport 6000
\end{lstlisting}
will run noise with transmission mode ON, using 192.168.1.104 on port 6000 as destination.
\section{Automatic port allocation}
In order to address each application individually, only one application can be listening on a single port at one time. Therefore when the default incoming port 5510 is already opened by some other application, an application will automatically try increasing port numbers until it finds an available port. Let's say that we start two applications \code{noise} and \code{mixer} on the same machine, here is what we get:
\begin{lstlisting}
$ ./noise &
...
Faust OSC version 0.93 application 'noise' is running on UDP ports 5510, 5511, 5512
$ ./mixer
...
Faust OSC version 0.93 application 'mixer' is running on UDP ports 5513, 5511, 5512
\end{lstlisting}
The \code{mixer} application fails to open the default incoming port 5510 because it is already opened by \code{noise}. Therefore it tries to find an available port starting from 5513 and open it. Please note that the two outcoming ports 5511 and 5512 are shared by all running applications.
\section{Discovering OSC applications}
The commands \code{oscsend}\marginpar{\code{oscsend} \emph{hostname} \emph{port} \emph{address} \emph{types} \emph{values}: send OpenSound Control message via UDP. \emph{types} is a string, the letters indicates the type of the following values: i=integer, f=float, s=string,...}
Send OpenSound Control message via UDP. and \code{oscdump}\marginpar{\code{oscdump} \emph{port} : receive OpenSound Control messages via UDP and dump to standard output} from the liblo package provide a convenient mean to experiment with OSC control. For the experiment let's use two additional terminals. The first one will be used to send OSC messages to the noise application using \code{oscsend}. The second terminal will be used to monitor the messages sent by the application using \code{oscdump}. We will indicate by \lstinline'T1$' the command types on terminal T1 and by \lstinline'T2:' the messages received on terminal T2. To monitor on terminal T2 the OSC messages received on UDP port 5511 we will use \code{oscdump}:
\begin{lstlisting}
T2$ oscdump 5511
\end{lstlisting}
Once set we can use the \code{hello} message to scan UDP ports for FAUST applications. For example:
\begin{lstlisting}
T1$ oscsend localhost 5510 "/*" s hello
\end{lstlisting}
gives us the root message address, the network and the UDP ports used by the noise application:
\begin{lstlisting}
T2: /noise siii "192.168.1.102" 5510 5511 5512
\end{lstlisting}
\section{Discovering the OSC interface of an application}
Once we have an application we can discover its OSC interface (the set of OSC messages we can use to control it) by sending the \code{get} message to the root:
\begin{lstlisting}
T1$ oscsend localhost 5510 /noise s get
\end{lstlisting}
As an answer of the osc messages understood by the application, a full description is available on terminal T2:
\begin{lstlisting}
T2: /noise sF "xmit" #F
T2: /noise ss "desthost" "127.0.0.1"
T2: /noise si "outport" 5511
T2: /noise si "errport" 5512
T2: /noise/level fff 0.000000 0.000000 1.000000
\end{lstlisting}
The root of the osc interface is \code{/noise}. Transmission is OFF, \code{xmit} is set to false. The destination host for sending messages is \code{"127.0.0.1"}, the output port is \code{5511} and the error port is \code{5512}. The application has only one user interface element: \code{/noise/level} with current value \code{0.0}, minimal value \code{0.0} and maximal value \code{1.0}.
\section{Widget's OSC address}
Each widget of an application has a unique OSC address obtained by concatenating the labels of it's surrounding groups with its own label.
\marginpar{ There are potential conflicts between widget's labels and the OSC address space. An OSC symbolic name is an ASCII string consisting of a restricted set of printable characters. Therefore to ensure compatibility spaces are replaced by underscores and some other characters (asterisk, comma, forward, question mark, open bracket, close bracket, open curly brace, close curly brace) are replaced by hyphens.}
Here is as an example \code{mix4.dsp}, a very simplified monophonic audio mixer with 4 inputs and one output. For each input we have a mute button and a level slider:
\begin{lstlisting}
input(v) = vgroup("input %v", *(1-checkbox("mute")) : *(vslider("level", 0, 0, 1, 0.01)));
process = hgroup("mixer", par(i, 4, input(i)) :> _);
\end{lstlisting}
If we query this application:
\begin{lstlisting}
T1$ oscsend localhost 5510 "/*" s get
\end{lstlisting}
We get a full description of its OSC interface on terminal T2:
\begin{lstlisting}
T2: /mixer sF "xmit" #F
T2: /mixer ss "desthost" "127.0.0.1"
T2: /mixer si "outport" 5511
T2: /mixer si "errport" 5512
T2: /mixer/input_0/level fff 0.0000 0.0000 1.0000
T2: /mixer/input_0/mute fff 0.0000 0.0000 1.0000
T2: /mixer/input_1/level fff 0.0000 0.0000 1.0000
T2: /mixer/input_1/mute fff 0.0000 0.0000 1.0000
T2: /mixer/input_2/level fff 0.0000 0.0000 1.0000
T2: /mixer/input_2/mute fff 0.0000 0.0000 1.0000
T2: /mixer/input_3/level fff 0.0000 0.0000 1.0000
T2: /mixer/input_3/mute fff 0.0000 0.0000 1.0000
\end{lstlisting}
As we can see each widget has a unique OSC address obtained by concatenating the top level group label "mixer", with the "input" group label and the widget label. Please note that in this operation whites spaces are replaced by underscores and metadata are removed.
All addresses must have a common root. This is the case in our example because there is a unique horizontal group "mixer" containing all widgets. If a common root is missing as in the following code:
\begin{lstlisting}
input(v) = vgroup("input %v", *(1-checkbox("mute")) : *(vslider("level", 0, 0, 1, 0.01)));
process = par(i, 4, input(i)) :> _;
\end{lstlisting}
then a default vertical group is automatically create by the \faust compiler using the name of the file \code{mix4} as label:
\begin{lstlisting}
T2: /mix4 sF "xmit" #F
T2: /mix4 ss "desthost" "127.0.0.1"
T2: /mix4 si "outport" 5511
T2: /mix4 si "errport" 5512
T2: /mix4/input_0/level fff 0.0000 0.0000 1.0000
T2: /mix4/input_0/mute fff 0.0000 0.0000 1.0000
T2: /mix4/input_1/level fff 0.0000 0.0000 1.0000
T2: /mix4/input_1/mute fff 0.0000 0.0000 1.0000
T2: /mix4/input_2/level fff 0.0000 0.0000 1.0000
T2: /mix4/input_2/mute fff 0.0000 0.0000 1.0000
T2: /mix4/input_3/level fff 0.0000 0.0000 1.0000
T2: /mix4/input_3/mute fff 0.0000 0.0000 1.0000
\end{lstlisting}
\section{Controlling the application via OSC}
We can control any user interface element of the application by sending one of the previously discovered messages. For example to set the noise level of the application to \code{0.2} we send:
\begin{lstlisting}
T1$ oscsend localhost 5510 /noise/level f 0.2
\end{lstlisting}
If we now query \code{/noise/level} we get, as expected, the value \code{0.2}:
\begin{lstlisting}
T1$ oscsend localhost 5510 /noise/level s get
T2: /noise/level fff 0.2000 0.0000 1.0000
\end{lstlisting}
\section{Turning transmission ON}
The xmit message at the root level is used to control the realtime transmission of OSC messages corresponding to user interface's actions. For examples:
\begin{lstlisting}
T1$ oscsend localhost 5510 /noise si xmit 1
\end{lstlisting}
turns transmission in ALL mode. Now if we move the level slider we get a bunch of messages:
\begin{lstlisting}
T2: /noise/level f 0.024000
T2: /noise/level f 0.032000
T2: /noise/level f 0.105000
T2: /noise/level f 0.250000
T2: /noise/level f 0.258000
T2: /noise/level f 0.185000
T2: /noise/level f 0.145000
T2: /noise/level f 0.121000
T2: /noise/level f 0.105000
T2: /noise/level f 0.008000
T2: /noise/level f 0.000000
\end{lstlisting}
This feature can be typically used for automation to record and replay actions on the user interface, or to remote control from one application to another. It can be turned OFF any time using:
\begin{lstlisting}
T1$ oscsend localhost 5510 /noise si xmit 0
\end{lstlisting}
Use the ALIAS (xmit = 2) mode if you need restricted access to your program: when ALIAS is mode is used, only aliases of input elements (sliders, buttons...) can be used to control them, and output elements (bargraph) will only emit on their aliases.
\section{Filtering OSC messages}
When the transmission of OSC messages is ON, all the user interface elements are sent through the OSC connection.
\begin{lstlisting}
T2: /harpe/level f 0.024000
T2: /harpe/hand f 0.1
T2: /harpe/level f 0.024000
T2: /harpe/hand f 0.25
T2: /harpe/level f 0.024000
T2: /harpe/hand f 0.44
T2: /noise/level f 0.145000
T2: /harpe/hand f 0.78
T2: /noise/level f 0.145000
T2: /harpe/hand f 0.99
\end{lstlisting}
We can choose to filter the unwanted parameters (or group of parameters). For example:
\begin{lstlisting}
T1$ oscsend localhost 5510 /harpe si xmit 1 xmitfilter /harpe/level
\end{lstlisting}
As a result, we will receive:
\begin{lstlisting}
T2: /harpe/hand f 0.1
T2: /harpe/hand f 0.25
T2: /harpe/hand f 0.44
T2: /harpe/hand f 0.78
\end{lstlisting}
To reset the filter, send:
\begin{lstlisting}
T1$ oscsend localhost 5510 /harpe si xmit 1 xmitfilter
\end{lstlisting}
\section{Using OSC aliases}
Aliases are a convenient mechanism to control a \faust application from a preexisting set of OSC messages.
Let's say we want to control our noise example with touchOSC on Android. The first step is to configure TouchOSC host to 192.168.1.102 (the host running our noise application) and outgoing port to 5510.
Then we can use oscdump 5510 (after quitting the noise application in order to free port 5510) to visualize the OSC messages sent by TouchOSC. Let's use for that the left slider of simple layout. Here is what we get:
\begin{lstlisting}
T2: /1/fader1 f 0.000000
T2: /1/fader1 f 0.004975
T2: /1/fader1 f 0.004975
T2: /1/fader1 f 0.008125
T2: /1/fader1 f 0.017473
T2: /1/fader1 f 0.032499
T2: /1/fader1 f 0.051032
T2: ...
T2: /1/fader1 f 0.993289
T2: /1/fader1 f 1.000000
\end{lstlisting}
We can associate this OSC message to the noise level slider by inserting the metadata [osc:/1/fader1 0 1] into the slider's label:
\marginpar{
Several osc aliases can be inserted into a single label allowing the same widget to be controlled by several OSC messages.
}
\begin{lstlisting}
process = library("music.lib").noise * hslider("level[osc:/1/fader1 0 1]",0,0,1,0.01);
\end{lstlisting}
Because here the range of /1/fader1 is 0 to 1 like the level slider we can remove the range mapping information and write simply :
\begin{lstlisting}
process = library("music.lib").noise * hslider("level[osc:/1/fader1]", 0, 0, 1, 0.01);
\end{lstlisting}
TouchOSC can also send accelerometer data by enabling Settings/Options/Accelerometer. Using again oscdump 5510 we can visualize the messages send by TouchOSC:
\begin{lstlisting}
T2: ...
T2: /accxyz fff -0.147842 0.019752 9.694721
T2: /accxyz fff -0.157419 0.016161 9.686341
T2: /accxyz fff -0.167594 0.012570 9.683948
T2: ...
\end{lstlisting}
As we can see TouchOSC send the x, y and z accelerometers in a single message, as a triplet of values ranging approximatively from $-9.81$ to $9.81$. In order to select the appropriate accelerometer we need to concatenate to /accxyz a suffix /0, /1 or /2. For example /accxyz/0 will correspond to x, /accxyz/1 to y, etc. We also need to define a mapping because the ranges are different:
\begin{lstlisting}
process = library("music.lib").noise * hslider("level[osc:/accxyz/0 0 9.81]",0,0,1,0.01);
\end{lstlisting}
\begin{table}[htp]
\begin{center}
\begin{tabular}{|l|l|}
\hline
\bf{alias} & \bf{description} \\
\hline
\lstinline'[osc:/1/rotary1 0 1]' & top left rotary knob\\
\lstinline'[osc:/1/rotary2 0 1]' & middle left rotary knob\\
\lstinline'[osc:/1/rotary3 0 1]' & bottom left rotary knob\\
\lstinline'[osc:/1/push1 0 1]' & bottom left push button\\
\lstinline'[osc:/1/push2 0 1]' & bottom center left push button\\
\hline
\lstinline'[osc:/1/toggle1 0 1]' & top center left toggle button\\
\lstinline'[osc:/1/toggle2 0 1]' & middle center left toggle button\\
\lstinline'[osc:/1/fader1 0 1]' & center left vertical fader\\
\hline
\lstinline'[osc:/1/toggle3 0 1]' & top center right toggle button\\
\lstinline'[osc:/1/toggle4 0 1]' & middle center right toggle button\\
\lstinline'[osc:/1/fader2 0 1]' & center right vertical toggle button\\
\hline
\lstinline'[osc:/1/rotary4 0 1]' & top right rotary knob\\
\lstinline'[osc:/1/rotary5 0 1]' & middle right rotary knob\\
\lstinline'[osc:/1/rotary6 0 1]' & bottom right rotary knob\\
\lstinline'[osc:/1/push3 0 1]' & bottom center right push button\\
\lstinline'[osc:/1/push4 0 1]' & bottom right push button\\
\hline
\lstinline'[osc:/1/fader3 0 1]' & bottom horizontal fader\\
\hline
\lstinline'[osc:/accxyz/0 -10 10]' & $x$ accelerometer\\
\lstinline'[osc:/accxyz/1 -10 10]' & $y$ accelerometer\\
\lstinline'[osc:/accxyz/2 -10 10]' & $z$ accelerometer\\
\hline
\end{tabular}
\end{center}
\caption{Examples of OSC message aliases for TouchOSC (layout Mix2).}
\label{tab:oscalias}
\end{table}
\section{OSC cheat sheet}
\subsection*{Default ports}
\begin{tabular}{ll}
\lstinline'5510' & default listening port\\
\lstinline'5511' & default transmission port\\
\lstinline'5512' & default error port\\
\lstinline'5513...' & alternative listening ports
\end{tabular}
\subsection*{Command line options}
\begin{tabular}{rl}
\lstinline'-port' $n$ & set the port number used by the application to receive messages\\
\lstinline'-outport' $n$ & set the port number used by the application to transmit messages\\
\lstinline'-errport' $n$ & set the port number used by the application to transmit error messages\\
\lstinline'-desthost' $h$ & set the destination host for the messages sent by the application\\
\lstinline'-xmit 0|1|2' & turn transmission OFF, ALL or ALIAS (default OFF) \\
\lstinline'-xmitfilter' $s$ & filter the \faust paths at emission time
\end{tabular}
\subsection*{Discovery messages}
\begin{tabular}{ll}
\lstinline'oscsend' \emph{host} \emph{port} \lstinline'"/*" s hello' & discover if any OSC application is listening on port $p$ \\
\lstinline'oscsend' \emph{host} \emph{port} \lstinline'"/*" s get' & query OSC interface of application listening on port $p$
\end{tabular}
\subsection*{Control messages}
\begin{tabular}{ll}
\lstinline'oscsend' \emph{host} \emph{port} \lstinline'"/*"' \lstinline'si xmit 0|1|2' & set transmission mode \\
\lstinline'oscsend' \emph{host} \emph{port} \emph{widget} \lstinline's get' & get widget's value \\
\lstinline'oscsend' \emph{host} \emph{port} \emph{widget} \lstinline'f' $v$ & set widget's value
\end{tabular}
\subsection*{Alias}
\begin{tabular}{ll}
\lstinline'"...[osc:' \emph{address} \emph{lo} \emph{hi} \lstinline']..."' & alias with \emph{lo}$\rightarrow$\emph{min}, \emph{hi}$\rightarrow$\emph{max} mapping\\
\lstinline'"...[osc:' \emph{address}\lstinline']..."' & alias with \emph{min}, \emph{max} clipping
\end{tabular}
%
%\section{OLD}
%
%%---------------------------------------------------
%\subsection{OSC GUI architecture module}
%\label{sec:oscgui}
%
%The OSC UI architecture transforms each UI active widget addition into an \code{addnode} call, ignores the passive widgets and transforms container calls (\code{openXxxBox, closeBox}) into \code{opengroup} and \code{closegroup} calls.
%
%\subsubsection{OSC address space and messages}
%The OSC address space adheres strictly to the hierarchy defined by the \code{addnode} and \code{opengroup, closegroup} calls. It supports the OSC pattern matching mechanism as described in \cite{OSC}.
%
%A node expects to receive OSC messages with a single float value as parameter. This policy is strict for the parameters count, but relaxed for the parameter type: OSC int values are accepted and casted to float.
%
%\begin{table}[htdp]
%\begin{center}
%\begin{tabular}{|c|c|c|}
%\hline
%\bf{Audio system} & \bf{Environment} & \bf{OSC support} \\
%\hline
%\OSTab{Linux} \\
%%\multicolumn{3}{|l|}{Linux} \\
%\hline
%Alsa & GTK, Qt & yes\\
%Jack & GTK, Qt, Console & yes\\
%PortAudio & GTK, Qt & yes\\
%\hline
%\OSTab{Mac OS X} \\
%\hline
%CoreAudio & Qt & yes\\
%Jack & Qt, Console & yes\\
%PortAudio & Qt & yes\\
%\hline
%\OSTab{Windows} \\
%\hline
%Jack & Qt, Console & yes\\
%PortAudio & Qt & yes\\
%\hline
%\OSTab{iOS (iPhone)} \\
%\hline
%CoreAudio & Cocoa & not yet\\
%\hline
%\end{tabular}
%\end{center}
%\caption{OSC support in \faust application's architectures.}
%\label{tab:oscarch2}
%\end{table}
%
%
%Two additional messages are defined to provide \faust applications discovery and address space discoveries:
%\begin{itemize}
%\item the \code{hello} message: accepted by any module root address. The module responds with its root address, followed by its IP address and the UDP port numbers (listening port, output port, error port).
%See the network management section below for ports numbering scheme.
%\item the \code{get} message: accepted by any valid OSC address. The \code{get} message is propagated to every terminal node that responds with its OSC address and current values (value, min and max).
%\end{itemize}
%
%\textbf{Example:} \\
%Consider the \emph{noise} module provided with the \faust examples:
%\begin{itemize}
%\item it sends \code{/noise 192.168.0.1 5510 5511 5512} \\in answer to a \code{hello} message,
%\item it sends \code{/noise/Volume 0.8 0. 1.} \\in answer to a \code{get} message.
%\end{itemize}
%
%
%\subsubsection{Network management.}
%The OSC module makes use of three different UDP port numbers:
%\begin{itemize}
%\item 5510 is the listening port number: control messages should be addressed to this port.
%\item 5511 is the output port number: answers to query messages are sent to this port.
%\item 5512 is the error port number: used for asynchronous error notifications.
%\end{itemize}
%
%When the UDP listening port number is busy (for instance in case of multiple \faust programs running), the system automatically looks for the next available port number. Unless otherwise specified by the command line, the UDP output port numbers are unchanged.
%
%A program sends its name (actually its root address) and allocated port numbers on the OSC output port on startup.
%
%Port numbers can be changed on the command line with the following options: \\
%\hspace*{6mm}\lstinline'[-port | -outport | -errport] number'
%
%The default UDP output streams destination is \code{localhost}. It can also be changed with the command line option \\
%\hspace*{6mm}\code{-dest address} where address is a host name or an IP number.
%
%%---------------------------------------------------
%\subsection{OSC message aliases}
%\label{sec:oscaudio}
%Alias is a metadata-based mechanism allowing to map arbitrary incoming OSC messages to program parameters.
%%%This is convenient when one has no control on the OSC messages emitted.
%Some remote controllers, like TouchOSC on Android, can only transmit predefined messages, for example \lstinline'/1/push1 1.000000' when push button 1 is pressed, \lstinline'/accxyz -0.421380 0.268151 9.232041' for the x, y and z accelerometers, \lstinline'/1/fader1 0.563994' when fader 1 is moved, etc.
%
%Such messages can be used to control a specific program parameter by inserting an OSC metadata \lstinline'[osc:/path/name]' in its label. For example \lstinline'vslider("Volume", 0, 0, 1, 0.1)' can be controlled by TouchOSC fader 1 by indicating its OSC address : \lstinline'vslider("Volume[osc:/1/fader1]", 0, 0, 1, 0.1)' (see table \ref{tab:oscalias} for a more complete list of aliases).
%
%By default the incoming value range is assumed to be between 0 and 1. But it is possible to indicate a different range : \lstinline'[osc:/path/name min max]'. When incoming messages provide more than one value it is possible to select the right one with an additional suffix (numbered starting form 0) to the pathname. For instance \lstinline'vslider("Volume[osc:/accxyz/1 -10 10]", 0, 0, 1, 0.1)' would allow to control the volume using the $y$ accelerometer. Moreover the accelerometer's values are mapped from range $[-10..10]$ to range $[0..1]$.
%
%
%\begin{table}[htdp]
%\begin{center}
%\begin{tabular}{|l|l|}
%\hline
%\bf{alias} & \bf{description} \\
%\hline
%\lstinline'[osc:/1/rotary1]' & top left rotary knob\\
%\lstinline'[osc:/1/rotary2]' & middle left rotary knob\\
%\lstinline'[osc:/1/rotary3]' & bottom left rotary knob\\
%\lstinline'[osc:/1/push1]' & bottom left push button\\
%\lstinline'[osc:/1/push2]' & bottom center left push button\\
%\hline
%\lstinline'[osc:/1/toggle1]' & top center left toggle button\\
%\lstinline'[osc:/1/toggle2]' & middle center left toggle button\\
%\lstinline'[osc:/1/fader1]' & center left vertical fader\\
%\hline
%\lstinline'[osc:/1/toggle3]' & top center right toggle button\\
%\lstinline'[osc:/1/toggle4]' & middle center right toggle button\\
%\lstinline'[osc:/1/fader2]' & center right vertical toggle button\\
%\hline
%\lstinline'[osc:/1/rotary4]' & top right rotary knob\\
%\lstinline'[osc:/1/rotary5]' & middle right rotary knob\\
%\lstinline'[osc:/1/rotary6]' & bottom right rotary knob\\
%\lstinline'[osc:/1/push3]' & bottom center right push button\\
%\lstinline'[osc:/1/push4]' & bottom right push button\\
%\hline
%\lstinline'[osc:/1/fader3]' & bottom horizontal fader\\
%\hline
%\lstinline'[osc:/accxyz/0 -10 10]' & $x$ accelerometer\\
%\lstinline'[osc:/accxyz/1 -10 10]' & $y$ accelerometer\\
%\lstinline'[osc:/accxyz/2 -10 10]' & $z$ accelerometer\\
%\hline
%\end{tabular}
%\end{center}
%\caption{Examples of OSC message aliases for TouchOSC (layout Mix2). Since most of these messages produce values in the default range $[0..1]$ , there is no need to indicate this range. Accelerometers producing values in a different range, this range $[-10..10]$ has to be indicated. }
%\label{tab:oscalias}
%\end{table}
%
%
%%---------------------------------------------------
%\subsection{OSC audio architecture}
%\label{sec:oscaudio}
%
%The OSC audio architecture implements an audio architecture where audio inputs and outputs are replaced by OSC messages. Using this architecture, a \faust module accepts arbitrary data streams on its root OSC address, and handles this input stream as interleaved signals. Thus, each incoming OSC packet addressed to a module root triggers a computation loop, where as many values as the number of incoming frames are computed.
%
%The output of the signal computation is sent to the OSC output port as non-interleaved data to the OSC addresses \code{/root/n} where \code{root} is the module root address and \code{n} is the output number (indexed from 0).
%
%For example: \\
%consider a \faust program named \emph{split} and defined by:\\
%\hspace*{6mm} \lstinline'process = _ <: _,_' \\
%the message \\
%\hspace*{6mm} \code{/split 0.3}
%\\ will produce the 2 following messages as output: \\
%\hspace*{6mm}\code{/split/0 0.3}\\
%\hspace*{6mm}\code{/split/1 0.3}
%
%
%The OSC audio architecture provides a very convenient way to execute a signal processing at an arbitrary rate, even allowing to make step by step computation. Connecting the output OSC signals to Max/MSP or to a system like INScore\footnote{\url{http://inscore.sf.net}}\cite{Fober:10c}, provides a close examination of the computation results.
%
|