I have two Scripts, which I will run at the same time. In both Scripts are Instruments defined. First Script have three Instruments. Instrument one triggers Instrument 2 and 3. Instrument 1 gives events with a random Variable in Integers to Instrument 2 and 3. Instrument 2 generates Midi-Note-On Messages. Instrument 3 generates Midi-Off Messages. Both Instruments are so triggered taht 0.5 Seconds would be between both Messages. Both Instruments should be terminated when Message are created. And I knew both Instruments are needed because of the I Arguments on noteon and noteoff Opcodes.
Here the full script which is Source:
<Cabbage>
form caption("Sender") size(400, 300), colour(58, 110, 182), pluginid("def1")
keyboard bounds(8, 158, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kZahl init 0
kTrig metro 4
if kTrig == 1 then
if kZahl == 0 then
kran random 20, 100
kran = int(kran)
event "i", 2, 0, 1, kran
kZahl = 1
else
event "i", 3, 0, 1, kran
printk 0, 777
kZahl = 0
endif
endif
endin
instr 2
iNumb = p4
noteon 1, iNumb, 64
turnoff
endin
instr 3
iNumb = p4
noteoff 1, iNumb, 64
turnoff
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
</CsoundSynthesizer>
And this are the Destination Script:
<Cabbage>
form caption("Empfang") size(400, 300), colour(58, 110, 182), pluginid("def1")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kstatus, kchan, kdata1, kdata2 midiin
if kstatus == 128 then
printks "NoteOff mit Note = \n", 0, kdata1
elseif kstatus == 144 then
printks "NoteOn mit Note = \n", 0, kdata1
endif
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
i1 0 z
</CsScore>
</CsoundSynthesizer>
In my mind is that anything with the comandline-Flags / Options-Section is wron