insremot

insremot — An opcode which can be used to implement a remote orchestra. This opcode will send note events from a source machine to one destination.

Description

With the insremot and insglobal 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 insremot opcode will send events from a source machine to one destination if you want to send events to many destinations (broadcast) use the insglobal opcode instead. These two opcodes can be used in combination.

Syntax

insremot idestination, isource, instrnum [,instrnum...] 

Initialization

idestination -- 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.

isource -- 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.

instrnum -- a list of instrument numbers which will be played on the destination machine

Performance

[Note] 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 may make 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, or on non-windows system other techniques. If a computer has more than one IP address there is no way to control which IP address is found (but see below). On non-windows systems the default network is eth0 or en0, and if that fails wlan0. (Since version 6.05) the network to be used can be set with an environment variable CS_ETHER.
[Note] Note
The remote operation does not allow the sending of strings at all.

Examples

Here is an example of the insremot opcode. It uses the files Play insremot.csd and Play insremotM.csd

Example 474. Example of the insremot opcode.

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).

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>

<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o insremot.wav -W ;;; for file output any platform
</CsOptions>

<CsInstruments>
nchnls = 1

insremot "192.168.1.100", "192.168.1.101", 1

instr 1
  aq barmodel 1, 1, p4, 0.001, 0.23, 5, p5, p6, p7
     out      aq
endin

</CsInstruments>

<CsScore>
f0 360

e
</CsScore>

</CsoundSynthesizer>
<CsoundSynthesizer>

<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o insremotM.wav -W ;;; for file output any platform
</CsOptions>

<CsInstruments>
nchnls = 1

insremot "192.168.1.100", "192.168.1.101", 1

instr 1
  aq barmodel 1, 1, p4, 0.001, 0.23, 5, p5, p6, p7
     out      aq
endin

</CsInstruments>

<CsScore>
i1 0 0.5 3 0.2 500 0.05
i1 0.5 0.5 -3 0.3 1000 0.05
i1 1.0 0.5 -3 0.4 1000 0.1
i1 1.5 4.0 -3 0.5 800 0.05
e
</CsScore>

</CsoundSynthesizer>


See also

insglobal, midglobal, midremot, remoteport

Credits

Author: Simon Schampijer
2006

New in version 5.03