Debian Codegraph @

src/Examples/CsoundQt/Useful/Monome_basic.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ;Linux options with JACK
4 ;-d -odac:system:playback_ -+rtaudio=jack
5
6 ;OSX options
7 ;-odac -d -b 128 -B 128
8 </CsOptions>
9 <CsInstruments>
10 /*
11 Basic Monome Patch in Csound
12 By Paul Batchelor
13
14 Monomeserial must be started first before running the csd with all the default
15 ports and "monome" hostname.
16
17 Tested on Slackware Linux 13.37 in the Spring of 2013
18
19 */
20 sr = 96000
21 ksmps = 1
22 nchnls = 2
23 0dbfs = 1
24
25 gihandle OSCinit 8000
26 gisine ftgen 0, 0, 4096, 10, 1
27 gadel init 0
28
29 instr OSC_listen
30 kx init 0
31 ky init 0
32 ks init 0
33
34
35 nxtmsg:
36 kk OSClisten gihandle, "/monome/press", "iii", kx, ky, ks
37 if (kk == 0) goto ex
38 event "i", "LED", 0, 0.001, kx, ky, ks
39 if (ks == 1) then
40 event "i", 1, 0, 0.4, kx, ky, ks
41 endif
42 kgoto nxtmsg
43 ex:
44
45 endin
46
47 instr LED
48 OSCsend 1, "localhost", 8080, "/monome/led", "iii", p4, p5, p6
49 endin
50
51 instr 1
52 ix = p4
53 iy = p5
54 is = p6
55
56 icps = cpsmidinn(60 + 2 * ix + iy)
57
58 kenv expseg 1, p3, 0.00001
59
60 a1 foscili 0.4 * kenv, icps, 2, 3, 3 * kenv, gisine
61 outs a1, a1
62 gadel = gadel + a1
63 endin
64
65 instr delay
66 adel init 0
67 adel delay gadel + (adel * 0.3), 0.3
68 adel butlp adel, 4000
69 outs adel, adel
70 gadel = 0
71 endin
72
73 </CsInstruments>
74 <CsScore>
75 i"OSC_listen" 0 1500
76 i"delay" 0 1500
77 </CsScore>
78 </CsoundSynthesizer>
79 <bsbPanel>
80 <label>Widgets</label>
81 <objectName/>
82 <x>100</x>
83 <y>100</y>
84 <width>320</width>
85 <height>240</height>
86 <visible>true</visible>
87 <uuid/>
88 <bgcolor mode="nobackground">
89 <r>255</r>
90 <g>255</g>
91 <b>255</b>
92 </bgcolor>
93 </bsbPanel>
94 <bsbPresets>
95 </bsbPresets>