Debian Codegraph @

src/Examples/CsoundQt/Getting Started/Realtime_Interaction/Keyboard_Input.csd

raw
1 /* Getting Started .. Realtime Interaction:
2 Keyboard Input
3 */
4
5 <CsoundSynthesizer>
6 <CsOptions>
7 </CsOptions>
8 <CsInstruments>
9
10 sr = 44100
11 ksmps = 128
12 nchnls = 1
13 0dbfs = 1
14
15 instr 1
16 kres, kkeydown sensekey
17 ; You have to check whether a key has bee pressed
18 ; When no key is pressed kres is -1
19 if kkeydown == 1 then
20 outvalue "keyvalue", kres
21 endif
22 endin
23
24 </CsInstruments>
25 <CsScore>
26 ; Run instrument 1 for ever
27 i 1 0 -1
28
29 f 0 3600
30 </CsScore>
31 </CsoundSynthesizer>
32 ; written by Andres Cabrera 2015
33
34
35
36
37
38
39
40
41
42
43
44
45
46 <bsbPanel>
47 <label>Widgets</label>
48 <objectName/>
49 <x>1013</x>
50 <y>279</y>
51 <width>563</width>
52 <height>397</height>
53 <visible>true</visible>
54 <uuid/>
55 <bgcolor mode="background">
56 <r>7</r>
57 <g>95</g>
58 <b>162</b>
59 </bgcolor>
60 <bsbObject type="BSBLabel" version="2">
61 <objectName/>
62 <x>28</x>
63 <y>9</y>
64 <width>205</width>
65 <height>42</height>
66 <uuid>{f6df122b-8c0c-4881-9ab1-8231ce732408}</uuid>
67 <visible>true</visible>
68 <midichan>0</midichan>
69 <midicc>0</midicc>
70 <description/>
71 <label>Keyboard Input</label>
72 <alignment>left</alignment>
73 <valignment>top</valignment>
74 <font>DejaVu Sans</font>
75 <fontsize>22</fontsize>
76 <precision>3</precision>
77 <color>
78 <r>255</r>
79 <g>255</g>
80 <b>255</b>
81 </color>
82 <bgcolor mode="nobackground">
83 <r>255</r>
84 <g>255</g>
85 <b>255</b>
86 </bgcolor>
87 <bordermode>noborder</bordermode>
88 <borderradius>1</borderradius>
89 <borderwidth>0</borderwidth>
90 </bsbObject>
91 <bsbObject type="BSBLabel" version="2">
92 <objectName/>
93 <x>28</x>
94 <y>51</y>
95 <width>204</width>
96 <height>122</height>
97 <uuid>{48e54cb9-ee21-4ae8-a4c1-7cce9b13b5c3}</uuid>
98 <visible>true</visible>
99 <midichan>0</midichan>
100 <midicc>0</midicc>
101 <description/>
102 <label>The "sensekey" opcode can receive keyboard input. You must make sure that either the widget panel or the console panel have focus for this to work!</label>
103 <alignment>left</alignment>
104 <valignment>top</valignment>
105 <font>DejaVu Sans</font>
106 <fontsize>14</fontsize>
107 <precision>3</precision>
108 <color>
109 <r>255</r>
110 <g>255</g>
111 <b>255</b>
112 </color>
113 <bgcolor mode="nobackground">
114 <r>255</r>
115 <g>255</g>
116 <b>255</b>
117 </bgcolor>
118 <bordermode>border</bordermode>
119 <borderradius>1</borderradius>
120 <borderwidth>1</borderwidth>
121 </bsbObject>
122 <bsbObject type="BSBScrollNumber" version="2">
123 <objectName>keyvalue</objectName>
124 <x>87</x>
125 <y>194</y>
126 <width>80</width>
127 <height>25</height>
128 <uuid>{866495c9-536f-460b-b7d9-ab6083980023}</uuid>
129 <visible>true</visible>
130 <midichan>0</midichan>
131 <midicc>0</midicc>
132 <description/>
133 <alignment>left</alignment>
134 <font>Arial</font>
135 <fontsize>10</fontsize>
136 <color>
137 <r>0</r>
138 <g>0</g>
139 <b>0</b>
140 </color>
141 <bgcolor mode="background">
142 <r>255</r>
143 <g>255</g>
144 <b>255</b>
145 </bgcolor>
146 <value>107.00000000</value>
147 <resolution>1.00000000</resolution>
148 <minimum>-999999999999.00000000</minimum>
149 <maximum>999999999999.00000000</maximum>
150 <bordermode>border</bordermode>
151 <borderradius>1</borderradius>
152 <borderwidth>1</borderwidth>
153 <randomizable group="0">false</randomizable>
154 <mouseControl act=""/>
155 </bsbObject>
156 </bsbPanel>
157 <bsbPresets>
158 </bsbPresets>
159 <EventPanel name="" tempo="60.00000000" loop="8.00000000" x="261" y="207" width="513" height="322" visible="false" loopStart="0" loopEnd="0"> </EventPanel>