| 1 | |
| 2 | <refentry id="OSCsend"> |
| 3 | <indexterm id="IndexOSCsend"><primary>OSCsend</primary></indexterm> |
| 4 | <refentryinfo><title>OSC</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>OSCsend</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>OSCsend</refname> |
| 11 | <refpurpose> |
| 12 | Sends data to other processes using the OSC protocol |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Uses the OSC protocol to send message to other OSC listening processes. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>OSCsend</command> kwhen, ihost, iport, idestination[, itype , xdata1, xdata2, ...]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <emphasis>ihost</emphasis> |
| 32 | -- a string that is the intended host computer domain name. An |
| 33 | empty string is interpreted as the current computer. |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>iport</emphasis> |
| 38 | -- the number of the port that is used for the communication. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>idestination</emphasis> |
| 43 | -- a string that is the destination address. This takes the |
| 44 | form of a file name with directories. Csound just passes this |
| 45 | string to the raw sending code and makes no interpretation. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>itype</emphasis> |
| 50 | -- a string that indicates the types of the optional arguments |
| 51 | that are read at k-rate. The string can contain the characters |
| 52 | "abcdfilmstAG" which stand for audio, Boolean, character, double, float, |
| 53 | 32-bit integer, 64-bit integer, MIDI, string, timestamp, k-rate |
| 54 | array and ftable. The OSC message may not have any types, |
| 55 | in which case, it will consist only of the destination address. |
| 56 | </para> |
| 57 | |
| 58 | </refsect1> |
| 59 | |
| 60 | <refsect1> |
| 61 | <title>Performance</title> |
| 62 | <para> |
| 63 | <emphasis>kwhen</emphasis> -- a message is sent whenever this |
| 64 | value changes. A message will always be sent on the first call. |
| 65 | </para> |
| 66 | |
| 67 | <para> |
| 68 | The data is taken from the k-values or a-value that follow the format |
| 69 | string. In a similar way to a printf format, the characters in |
| 70 | order determine how the argument is interpreted. Note that a time |
| 71 | stamp takes two arguments. |
| 72 | </para> |
| 73 | |
| 74 | </refsect1> |
| 75 | |
| 76 | <refsect1> |
| 77 | <title>Example</title> |
| 78 | <para> |
| 79 | The example shows a simple instrument, which when called, sends a group of 3 messages to a computer called "xenakis", on port 7770, to be read by a process that recognises /foo/bar as its address. |
| 80 | </para> |
| 81 | <informalexample> |
| 82 | <programlisting> |
| 83 | <emphasis role="oblock">instr</emphasis> 1 |
| 84 | <emphasis role="opc">OSCsend</emphasis> 1, "xenakis.cs.bath.ac.uk",7770, "/foo/bar", "sis", "FOO", 42, "bar" |
| 85 | <emphasis role="oblock">endin</emphasis></programlisting> |
| 86 | </informalexample> |
| 87 | <para> |
| 88 | Here is a complete example of the OSCsend opcode. It uses the file <ulink url="examples/OSCsend.csd"><citetitle>OSCsend.csd</citetitle></ulink>. |
| 89 | <example> |
| 90 | <title>Example of the OSCsend opcode.</title> |
| 91 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 92 | <xi:include href="examples-xml/OSCsend.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 93 | </example> |
| 94 | </para> |
| 95 | </refsect1> |
| 96 | |
| 97 | <refsect1> |
| 98 | <title>See also</title> |
| 99 | <para><link linkend="OSC"><citetitle>OSC (Open Sound Control)</citetitle></link></para> |
| 100 | <para> More information on this opcode: <ulink url="http://www.youtube.com/watch?v=JX1C3TqP_9Y"><citetitle>http://www.youtube.com/watch?v=JX1C3TqP_9Y</citetitle></ulink> , made by Andrés Cabrera </para> |
| 101 | </refsect1> |
| 102 | |
| 103 | <refsect1> |
| 104 | <title>Credits</title> |
| 105 | <para> |
| 106 | <simplelist> |
| 107 | <member>Author: &namejohn;</member> |
| 108 | <member>2005</member> |
| 109 | </simplelist> |
| 110 | </para> |
| 111 | <para>Data types a, A and G were added in 6.07; they send data via |
| 112 | blobs and are only really useful to other Csound instances or |
| 113 | custom listeners.</para> |
| 114 | </refsect1> |
| 115 | </refentry> |