Debian Codegraph @

src/Examples/CsoundQt/Widgets/Menu_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 ; make sound
12 ktype invalue "type"
13 ktransp invalue "transp"
14 ktfactor tab ktransp, 1 ;map index to transposition factor
15 if (ktype == 0) then
16 axcite oscil 1, 1, 2
17 asig wgflute 0.1, 880*ktfactor, 0.32, 0.1, 0.1, 0.15, 5.925, 0.1, 2
18 elseif (ktype == 1) then
19 kenv xadsr 0.2, 0.2, 1, p3/2
20 asig vco2 kenv*0.1, 440*ktfactor
21 elseif (ktype == 2) then
22 asig shaker 0.5, 880*ktfactor, 64*ktfactor, 0.7, 3, 0
23 endif
24 outs asig*0.3, asig*0.3
25 endin
26
27 instr 2 ;randomize
28 itype = rnd(3)
29 itransp = rnd(3)
30 outvalue "type", int(itype)
31 outvalue "transp", int(itransp)
32 event "i", 1, 0, 2
33 turnoff ;send values only once
34 endin
35
36 </CsInstruments>
37 <CsScore>
38 f 1 0 8 -2 2 1 0.5 ;Transp factors (octave up, none, octave down)
39 f 2 0 16384 10 1
40
41 f 0 3600
42 </CsScore>
43 </CsoundSynthesizer>
44
45
46
47
48 <bsbPanel>
49 <label>Widgets</label>
50 <objectName/>
51 <x>654</x>
52 <y>238</y>
53 <width>357</width>
54 <height>279</height>
55 <visible>true</visible>
56 <uuid/>
57 <bgcolor mode="background">
58 <r>177</r>
59 <g>191</g>
60 <b>200</b>
61 </bgcolor>
62 <bsbObject type="BSBLabel" version="2">
63 <objectName/>
64 <x>83</x>
65 <y>6</y>
66 <width>197</width>
67 <height>41</height>
68 <uuid>{2d5f32c3-fe84-423c-bf3a-c17e7e332060}</uuid>
69 <visible>true</visible>
70 <midichan>0</midichan>
71 <midicc>-3</midicc>
72 <description/>
73 <label>Menu Widget</label>
74 <alignment>left</alignment>
75 <valignment>top</valignment>
76 <font>Arial</font>
77 <fontsize>24</fontsize>
78 <precision>3</precision>
79 <color>
80 <r>0</r>
81 <g>0</g>
82 <b>0</b>
83 </color>
84 <bgcolor mode="nobackground">
85 <r>191</r>
86 <g>204</g>
87 <b>234</b>
88 </bgcolor>
89 <bordermode>noborder</bordermode>
90 <borderradius>1</borderradius>
91 <borderwidth>0</borderwidth>
92 </bsbObject>
93 <bsbObject type="BSBLabel" version="2">
94 <objectName/>
95 <x>23</x>
96 <y>50</y>
97 <width>291</width>
98 <height>104</height>
99 <uuid>{f6d0f932-fa22-486e-8167-b37311d339c2}</uuid>
100 <visible>true</visible>
101 <midichan>0</midichan>
102 <midicc>-3</midicc>
103 <description/>
104 <label>Menu widgets can show menus with user defined elements. The elements are set as a comma separated list in the properties.The menu widget transmits the index of the currently selected item counting from 0. The current index can also be set from Csound</label>
105 <alignment>left</alignment>
106 <valignment>top</valignment>
107 <font>Liberation Sans</font>
108 <fontsize>12</fontsize>
109 <precision>3</precision>
110 <color>
111 <r>0</r>
112 <g>0</g>
113 <b>0</b>
114 </color>
115 <bgcolor mode="background">
116 <r>160</r>
117 <g>172</g>
118 <b>180</b>
119 </bgcolor>
120 <bordermode>false</bordermode>
121 <borderradius>5</borderradius>
122 <borderwidth>0</borderwidth>
123 </bsbObject>
124 <bsbObject type="BSBDropdown" version="2">
125 <objectName>type</objectName>
126 <x>90</x>
127 <y>170</y>
128 <width>80</width>
129 <height>30</height>
130 <uuid>{941b60cb-e13f-45c3-b7c3-cba6c825c8bf}</uuid>
131 <visible>true</visible>
132 <midichan>0</midichan>
133 <midicc>0</midicc>
134 <description/>
135 <bsbDropdownItemList>
136 <bsbDropdownItem>
137 <name>wgflute</name>
138 <value>0</value>
139 <stringvalue/>
140 </bsbDropdownItem>
141 <bsbDropdownItem>
142 <name>saw</name>
143 <value>1</value>
144 <stringvalue/>
145 </bsbDropdownItem>
146 <bsbDropdownItem>
147 <name>shaker</name>
148 <value>2</value>
149 <stringvalue/>
150 </bsbDropdownItem>
151 </bsbDropdownItemList>
152 <selectedIndex>0</selectedIndex>
153 <randomizable group="0">false</randomizable>
154 </bsbObject>
155 <bsbObject type="BSBButton" version="2">
156 <objectName>button1</objectName>
157 <x>185</x>
158 <y>170</y>
159 <width>160</width>
160 <height>30</height>
161 <uuid>{ada21fd8-091b-4dc6-bc5f-b140c2284ef5}</uuid>
162 <visible>true</visible>
163 <midichan>0</midichan>
164 <midicc>0</midicc>
165 <description/>
166 <type>event</type>
167 <pressedValue>1.00000000</pressedValue>
168 <stringvalue/>
169 <text>Make sound</text>
170 <image>/</image>
171 <eventLine>i1 0 2</eventLine>
172 <latch>false</latch>
173 <momentaryMidiButton>false</momentaryMidiButton>
174 <latched>false</latched>
175 <fontsize>10</fontsize>
176 </bsbObject>
177 <bsbObject type="BSBDropdown" version="2">
178 <objectName>transp</objectName>
179 <x>90</x>
180 <y>205</y>
181 <width>80</width>
182 <height>30</height>
183 <uuid>{39df8add-fa10-4f77-a705-e163fc12ee36}</uuid>
184 <visible>true</visible>
185 <midichan>0</midichan>
186 <midicc>0</midicc>
187 <description/>
188 <bsbDropdownItemList>
189 <bsbDropdownItem>
190 <name>12</name>
191 <value>0</value>
192 <stringvalue/>
193 </bsbDropdownItem>
194 <bsbDropdownItem>
195 <name>0</name>
196 <value>1</value>
197 <stringvalue/>
198 </bsbDropdownItem>
199 <bsbDropdownItem>
200 <name>-12</name>
201 <value>2</value>
202 <stringvalue/>
203 </bsbDropdownItem>
204 </bsbDropdownItemList>
205 <selectedIndex>0</selectedIndex>
206 <randomizable group="0">false</randomizable>
207 </bsbObject>
208 <bsbObject type="BSBButton" version="2">
209 <objectName>button1</objectName>
210 <x>185</x>
211 <y>205</y>
212 <width>160</width>
213 <height>30</height>
214 <uuid>{64b6bf1d-6215-4db6-8d37-8f14cf2fcb38}</uuid>
215 <visible>true</visible>
216 <midichan>0</midichan>
217 <midicc>0</midicc>
218 <description/>
219 <type>event</type>
220 <pressedValue>1.00000000</pressedValue>
221 <stringvalue/>
222 <text>Randomize and play</text>
223 <image>/</image>
224 <eventLine>i2 0 1</eventLine>
225 <latch>false</latch>
226 <momentaryMidiButton>false</momentaryMidiButton>
227 <latched>false</latched>
228 <fontsize>10</fontsize>
229 </bsbObject>
230 <bsbObject type="BSBLabel" version="2">
231 <objectName/>
232 <x>35</x>
233 <y>175</y>
234 <width>56</width>
235 <height>25</height>
236 <uuid>{78057116-2f3b-472a-bd12-7aa070157cb6}</uuid>
237 <visible>true</visible>
238 <midichan>0</midichan>
239 <midicc>-3</midicc>
240 <description/>
241 <label>Sound</label>
242 <alignment>right</alignment>
243 <valignment>top</valignment>
244 <font>Arial</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="nobackground">
253 <r>255</r>
254 <g>255</g>
255 <b>255</b>
256 </bgcolor>
257 <bordermode>noborder</bordermode>
258 <borderradius>1</borderradius>
259 <borderwidth>0</borderwidth>
260 </bsbObject>
261 <bsbObject type="BSBLabel" version="2">
262 <objectName/>
263 <x>15</x>
264 <y>210</y>
265 <width>80</width>
266 <height>25</height>
267 <uuid>{c3561f00-6a33-4e0a-8274-6b876f838c1b}</uuid>
268 <visible>true</visible>
269 <midichan>0</midichan>
270 <midicc>-3</midicc>
271 <description/>
272 <label>Transposition</label>
273 <alignment>right</alignment>
274 <valignment>top</valignment>
275 <font>Arial</font>
276 <fontsize>12</fontsize>
277 <precision>3</precision>
278 <color>
279 <r>0</r>
280 <g>0</g>
281 <b>0</b>
282 </color>
283 <bgcolor mode="nobackground">
284 <r>255</r>
285 <g>255</g>
286 <b>255</b>
287 </bgcolor>
288 <bordermode>noborder</bordermode>
289 <borderradius>1</borderradius>
290 <borderwidth>0</borderwidth>
291 </bsbObject>
292 </bsbPanel>
293 <bsbPresets>
294 </bsbPresets>