Debian Codegraph @

src/Examples/CsoundQt/Widgets/Button_Widget.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 </CsOptions>
4 <CsInstruments>
5
6 sr = 44100
7 ksmps = 128
8 nchnls = 2
9 0dbfs = 1
10
11 instr 1 ;turned on by button event
12 asig oscils 0.1, 440, 0
13 outs asig, asig
14 endin
15
16
17 instr 2 ;turned on in the score
18 kvalue invalue "value" ;changes between 0 and 1000
19 asig oscil 0.1, kvalue, 1
20 outs asig,asig
21 endin
22
23 </CsInstruments>
24 <CsScore>
25 f 1 0 1024 10 1
26 i 2 0 3600
27 </CsScore>
28 </CsoundSynthesizer>
29 <bsbPanel>
30 <label>Widgets</label>
31 <objectName/>
32 <x>383</x>
33 <y>118</y>
34 <width>401</width>
35 <height>606</height>
36 <visible>true</visible>
37 <uuid/>
38 <bgcolor mode="background">
39 <r>212</r>
40 <g>224</g>
41 <b>230</b>
42 </bgcolor>
43 <bsbObject version="2" type="BSBLabel">
44 <objectName/>
45 <x>85</x>
46 <y>5</y>
47 <width>218</width>
48 <height>41</height>
49 <uuid>{2cb4b857-9f1f-4eff-8058-11ce0a604257}</uuid>
50 <visible>true</visible>
51 <midichan>0</midichan>
52 <midicc>-3</midicc>
53 <description/>
54 <label>Button Widget</label>
55 <alignment>center</alignment>
56 <valignment>top</valignment>
57 <font>Nimbus Sans [urw]</font>
58 <fontsize>24</fontsize>
59 <precision>3</precision>
60 <color>
61 <r>30</r>
62 <g>30</g>
63 <b>30</b>
64 </color>
65 <bgcolor mode="nobackground">
66 <r>0</r>
67 <g>0</g>
68 <b>0</b>
69 </bgcolor>
70 <bordermode>false</bordermode>
71 <borderradius>1</borderradius>
72 <borderwidth>0</borderwidth>
73 </bsbObject>
74 <bsbObject version="2" type="BSBLabel">
75 <objectName/>
76 <x>10</x>
77 <y>45</y>
78 <width>375</width>
79 <height>69</height>
80 <uuid>{a9056c84-91e8-4a49-9e7d-666460fb2b8a}</uuid>
81 <visible>true</visible>
82 <midichan>0</midichan>
83 <midicc>-3</midicc>
84 <description/>
85 <label>Buttons in CsoundQt can have two purposes. They can transmit a value when they are pressed and they can generate score events in realtime when they are pressed. Their exact function depends on the type of button.</label>
86 <alignment>left</alignment>
87 <valignment>top</valignment>
88 <font>Liberation Sans</font>
89 <fontsize>12</fontsize>
90 <precision>3</precision>
91 <color>
92 <r>0</r>
93 <g>0</g>
94 <b>0</b>
95 </color>
96 <bgcolor mode="background">
97 <r>184</r>
98 <g>195</g>
99 <b>200</b>
100 </bgcolor>
101 <bordermode>false</bordermode>
102 <borderradius>5</borderradius>
103 <borderwidth>0</borderwidth>
104 </bsbObject>
105 <bsbObject version="2" type="BSBLabel">
106 <objectName/>
107 <x>10</x>
108 <y>542</y>
109 <width>377</width>
110 <height>64</height>
111 <uuid>{a7da460d-cfe1-487c-8ec1-6fc05692d212}</uuid>
112 <visible>true</visible>
113 <midichan>0</midichan>
114 <midicc>-3</midicc>
115 <description/>
116 <label>There are three other type of buttons for buttons with images. Pictevent and Pictvalue are equivalent to Event and Value buttons but display a picture. The Pict button is simply a decoration.</label>
117 <alignment>left</alignment>
118 <valignment>top</valignment>
119 <font>Liberation Sans</font>
120 <fontsize>12</fontsize>
121 <precision>3</precision>
122 <color>
123 <r>0</r>
124 <g>0</g>
125 <b>0</b>
126 </color>
127 <bgcolor mode="background">
128 <r>184</r>
129 <g>195</g>
130 <b>200</b>
131 </bgcolor>
132 <bordermode>false</bordermode>
133 <borderradius>5</borderradius>
134 <borderwidth>0</borderwidth>
135 </bsbObject>
136 <bsbObject version="2" type="BSBLabel">
137 <objectName/>
138 <x>205</x>
139 <y>120</y>
140 <width>179</width>
141 <height>266</height>
142 <uuid>{f43311a3-c5f0-4368-925a-3ab5324658ac}</uuid>
143 <visible>true</visible>
144 <midichan>0</midichan>
145 <midicc>-3</midicc>
146 <description/>
147 <label>Event buttons apart from transmitiing a different value while they are pressed can also send score events to Csound. Any valid score event can be triggered by a button but preprocessor symbols like carry are not accepted. The event generated by this button is 'i 1 0 3'. It turns on instrument 1 immediately for 3 seconds.</label>
148 <alignment>left</alignment>
149 <valignment>top</valignment>
150 <font>Liberation Sans</font>
151 <fontsize>12</fontsize>
152 <precision>3</precision>
153 <color>
154 <r>0</r>
155 <g>0</g>
156 <b>0</b>
157 </color>
158 <bgcolor mode="background">
159 <r>184</r>
160 <g>195</g>
161 <b>200</b>
162 </bgcolor>
163 <bordermode>false</bordermode>
164 <borderradius>5</borderradius>
165 <borderwidth>0</borderwidth>
166 </bsbObject>
167 <bsbObject version="2" type="BSBLabel">
168 <objectName/>
169 <x>10</x>
170 <y>120</y>
171 <width>188</width>
172 <height>266</height>
173 <uuid>{16f25933-2318-4091-ab37-b57f1a656ab9}</uuid>
174 <visible>true</visible>
175 <midichan>0</midichan>
176 <midicc>-3</midicc>
177 <description/>
178 <label>Value type buttons transmit always 0 on their channels when they are not pressed. When they are pressed they transmit the value set in the preferences. The button above transmits a value of 1000 which is used to control the frequency of instrument 2.
179 Buttons can be set to "latch".</label>
180 <alignment>left</alignment>
181 <valignment>top</valignment>
182 <font>Liberation Sans</font>
183 <fontsize>12</fontsize>
184 <precision>3</precision>
185 <color>
186 <r>0</r>
187 <g>0</g>
188 <b>0</b>
189 </color>
190 <bgcolor mode="background">
191 <r>184</r>
192 <g>195</g>
193 <b>200</b>
194 </bgcolor>
195 <bordermode>false</bordermode>
196 <borderradius>5</borderradius>
197 <borderwidth>0</borderwidth>
198 </bsbObject>
199 <bsbObject version="2" type="BSBLabel">
200 <objectName/>
201 <x>15</x>
202 <y>507</y>
203 <width>167</width>
204 <height>29</height>
205 <uuid>{3e9f4268-b2f7-496f-94ea-a22e8f68736c}</uuid>
206 <visible>true</visible>
207 <midichan>0</midichan>
208 <midicc>-3</midicc>
209 <description/>
210 <label>Pict buttons</label>
211 <alignment>left</alignment>
212 <valignment>top</valignment>
213 <font>Arial</font>
214 <fontsize>20</fontsize>
215 <precision>3</precision>
216 <color>
217 <r>0</r>
218 <g>0</g>
219 <b>0</b>
220 </color>
221 <bgcolor mode="nobackground">
222 <r>255</r>
223 <g>255</g>
224 <b>255</b>
225 </bgcolor>
226 <bordermode>noborder</bordermode>
227 <borderradius>1</borderradius>
228 <borderwidth>0</borderwidth>
229 </bsbObject>
230 <bsbObject version="2" type="BSBLabel">
231 <objectName/>
232 <x>10</x>
233 <y>392</y>
234 <width>375</width>
235 <height>109</height>
236 <uuid>{2767b528-7849-4306-85be-7b0aeeffccef}</uuid>
237 <visible>true</visible>
238 <midichan>0</midichan>
239 <midicc>-3</midicc>
240 <description/>
241 <label>There are some reserved channels which can send information to CsoundQt instead of Csound. The channel '_Play' can start and stop Csound. The channel '_Stop' can start and stop Csound. The button must be of type value or pictvalue.</label>
242 <alignment>left</alignment>
243 <valignment>top</valignment>
244 <font>Liberation Sans</font>
245 <fontsize>12</fontsize>
246 <precision>3</precision>
247 <color>
248 <r>0</r>
249 <g>0</g>
250 <b>0</b>
251 </color>
252 <bgcolor mode="background">
253 <r>184</r>
254 <g>195</g>
255 <b>200</b>
256 </bgcolor>
257 <bordermode>false</bordermode>
258 <borderradius>5</borderradius>
259 <borderwidth>0</borderwidth>
260 </bsbObject>
261 <bsbObject version="2" type="BSBButton">
262 <objectName>value</objectName>
263 <x>55</x>
264 <y>280</y>
265 <width>100</width>
266 <height>30</height>
267 <uuid>{03723e12-b763-4641-b1ab-3ffdee02428d}</uuid>
268 <visible>true</visible>
269 <midichan>0</midichan>
270 <midicc>-3</midicc>
271 <description/>
272 <type>value</type>
273 <pressedValue>1000.00000000</pressedValue>
274 <stringvalue/>
275 <text>Value</text>
276 <image>/</image>
277 <eventLine>i1 0 10</eventLine>
278 <latch>false</latch>
279 <momentaryMidiButton>false</momentaryMidiButton>
280 <latched>false</latched>
281 <fontsize>10</fontsize>
282 </bsbObject>
283 <bsbObject version="2" type="BSBButton">
284 <objectName>button1</objectName>
285 <x>245</x>
286 <y>290</y>
287 <width>100</width>
288 <height>30</height>
289 <uuid>{e2702106-c0b8-47b9-8754-d87a2480b056}</uuid>
290 <visible>true</visible>
291 <midichan>0</midichan>
292 <midicc>-3</midicc>
293 <description/>
294 <type>event</type>
295 <pressedValue>1.00000000</pressedValue>
296 <stringvalue/>
297 <text>Event</text>
298 <image>/</image>
299 <eventLine>i 1 0 3</eventLine>
300 <latch>false</latch>
301 <momentaryMidiButton>false</momentaryMidiButton>
302 <latched>false</latched>
303 <fontsize>10</fontsize>
304 </bsbObject>
305 <bsbObject version="2" type="BSBButton">
306 <objectName>_Play</objectName>
307 <x>260</x>
308 <y>457</y>
309 <width>100</width>
310 <height>30</height>
311 <uuid>{9a1f4b9d-3757-4fb5-b522-0b6981bb9b4d}</uuid>
312 <visible>true</visible>
313 <midichan>0</midichan>
314 <midicc>-3</midicc>
315 <description/>
316 <type>value</type>
317 <pressedValue>1.00000000</pressedValue>
318 <stringvalue/>
319 <text>Play</text>
320 <image>/</image>
321 <eventLine>i1 0 10</eventLine>
322 <latch>false</latch>
323 <momentaryMidiButton>false</momentaryMidiButton>
324 <latched>false</latched>
325 <fontsize>10</fontsize>
326 </bsbObject>
327 <bsbObject version="2" type="BSBButton">
328 <objectName>value</objectName>
329 <x>30</x>
330 <y>315</y>
331 <width>150</width>
332 <height>30</height>
333 <uuid>{7df9afbe-0376-4602-8cb8-40a1877c4be3}</uuid>
334 <visible>true</visible>
335 <midichan>0</midichan>
336 <midicc>-3</midicc>
337 <description/>
338 <type>value</type>
339 <pressedValue>1000.00000000</pressedValue>
340 <stringvalue/>
341 <text>Value Latched</text>
342 <image>/</image>
343 <eventLine>i1 0 10</eventLine>
344 <latch>true</latch>
345 <momentaryMidiButton>false</momentaryMidiButton>
346 <latched>false</latched>
347 <fontsize>10</fontsize>
348 </bsbObject>
349 <bsbObject version="2" type="BSBButton">
350 <objectName/>
351 <x>30</x>
352 <y>350</y>
353 <width>150</width>
354 <height>30</height>
355 <uuid>{56eae0d9-14f8-40b9-9378-b80e731b8b41}</uuid>
356 <visible>true</visible>
357 <midichan>0</midichan>
358 <midicc>-3</midicc>
359 <description/>
360 <type>event</type>
361 <pressedValue>1000.00000000</pressedValue>
362 <stringvalue/>
363 <text>Event Latched</text>
364 <image>/</image>
365 <eventLine>i1 0 -10</eventLine>
366 <latch>true</latch>
367 <momentaryMidiButton>false</momentaryMidiButton>
368 <latched>false</latched>
369 <fontsize>10</fontsize>
370 </bsbObject>
371 </bsbPanel>
372 <bsbPresets>
373 </bsbPresets>