Debian Codegraph @

src/Examples/FLOSS Manual Examples/08 Other Communication/08A03_Send_receive_array.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -m 128
4 </CsOptions>
5 <CsInstruments>
6
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 giPortHandle OSCinit 47120
13
14 instr Send
15 kSendTrigger init 0
16 kArray[] fillarray 1, 2, 3, 4, 5, 6, 7
17 if metro(1)==1 then
18 kSendTrigger += 1
19 kArray *= 2
20 endif
21 OSCsend kSendTrigger, "", 47120, "/exmp_3/array", "A", kArray
22 endin
23
24 instr Receive
25 kReceiveArray[] init 7
26 kGotIt OSClisten giPortHandle, "/exmp_3/array", "A", kReceiveArray
27 if kGotIt == 1 then
28 printarray kReceiveArray
29 endif
30 endin
31
32 </CsInstruments>
33 <CsScore>
34 i "Receive" 0 3
35 i "Send" 0 3
36 </CsScore>
37 </CsoundSynthesizer>
38 ;example by joachim heintz