summaryrefslogtreecommitdiff
path: root/opcodes/insremot.xml
blob: ee15d8e5d51d9d990a92f9674cee5d4749dfba6b (plain)
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
<refentry id="insremot">
<indexterm id="Indexinsremot"><primary>insremot</primary></indexterm>
  <refentryinfo><title>Remote Opcodes</title></refentryinfo>
  <refmeta>
    <refentrytitle>insremot</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>insremot</refname>
    <refpurpose>
      An opcode which can be used to implement a remote
      orchestra. This opcode will send note events from a source
      machine to one destination. 
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      With the <emphasis>insremot</emphasis> and <link
      linkend="insglobal"><citetitle>insglobal</citetitle></link>
      opcodes you are able to perform instruments on remote machines
      and control them from a master machine. The remote opcodes are
      implemented using the master/client model. All the machines
      involved contain the same orchestra but only the master machine
      contains the information of the score. During the performance
      the master machine sends the note events to the clients. The
      <emphasis>insremot</emphasis> opcode will send events from a
      source machine to one destination if you want to send events to
      many destinations (broadcast) use the <link
      linkend="insglobal"><citetitle>insglobal</citetitle></link>
      opcode instead. These two opcodes can be used in combination.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>insremot</command> idestination, isource, instrnum [,instrnum...] </synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>idestination</emphasis>
      -- a string that is the intended client computer (e.g. 192.168.0.100). This is the destination host which receives the events from the given instrument.
    </para>

    <para>
      <emphasis>isource</emphasis>
      -- a string that is the intended server computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument and sends it to the address given by idestination.
    </para>

    <para>
      <emphasis>instrnum</emphasis>
      -- a list of instrument numbers which will be played on the destination machine
    </para>

  </refsect1>

  <refsect1>
    <title>Performance</title>
    <note>
      If is essential the computers using this opcode have the same
      byte-order, data size (double or float) and pointer size.  One
      cannot use it with mixed 32 and 64 computers for instance.
    </note>    
    <note>
      Internally this opcode makes use of the gethostname and
      gethostbyname functions to determine the client's and server's
      IP address for checking which messages are for which machine.
      If a computer has more than one IP address there is no way to
      control which IP address is found.
    </note>
    <note>
      The remote operation does not allow the sending of strings at
      all.
    </note>
  </refsect1>
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the insremot opcode. It uses the files <ulink url="examples/insremot.csd"><citetitle>insremot.csd</citetitle></ulink> and <ulink url="examples/insremotM.csd"><citetitle>insremotM.csd</citetitle></ulink>.

      <example>
        <title>Example of the insremot opcode.</title>
        <para>The simple example below shows the bilbar example played on a remote machine. The master machine is named "192.168.1.100" and the client "192.168.1.101". Start the client on the machine (it will wait to receive the events from the master machine) and then start the master. Here is the command on linux to start a client (csound -+rtaudio=alsa -odac -dm0 insremot.csd), and the command on the master machine will look like this (csound -+rtaudio=alsa -odac -dm0 insremotM.csd).</para>
        <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>

<xi:include href="examples-xml/insremot.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="examples-xml/insremotM.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See also</title>
    <para>
      <link linkend="insglobal"><citetitle>insglobal</citetitle></link>, <link linkend="midglobal"><citetitle>midglobal</citetitle></link>, <link linkend="midremot"><citetitle>midremot</citetitle></link>, <link linkend="remoteport"><citetitle>remoteport</citetitle></link>
    </para>
  </refsect1>
  
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Simon Schampijer</member>
        <member>2006</member>
      </simplelist>
    </para>
    <para>
      New in version 5.03
    </para>
  </refsect1>
</refentry>