| 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 |
| 12 |
|
| 13 |
Sin invalue "instring" |
| 14 |
outvalue "display", Sin |
| 15 |
|
| 16 |
Sline invalue "lineedit" |
| 17 |
klevel invalue "level" |
| 18 |
kdur invalue "dur" |
| 19 |
kcomp strcmpk Sline, "-" |
| 20 |
; trigger notes only when line is not empty |
| 21 |
ktrig = (kcomp != 0? 1: 0) |
| 22 |
kchr strchark Sline, 1 |
| 23 |
schedkwhen ktrig, 0.05, 10, 2, 0, kdur, kchr, klevel |
| 24 |
outvalue "lineedit", "-" ;empty line edit widget |
| 25 |
endin |
| 26 |
|
| 27 |
instr 2 |
| 28 |
idur = p3 |
| 29 |
ilevel = p5 |
| 30 |
icps = 440 * 2^((p4 - 100)/12) |
| 31 |
aout oscils ilevel, icps, 0 |
| 32 |
aenv adsr 0.2*idur, 0.2*idur, 0.7, 0.3*idur |
| 33 |
outs aout*aenv, aout*aenv |
| 34 |
endin |
| 35 |
|
| 36 |
</CsInstruments> |
| 37 |
<CsScore> |
| 38 |
i 1 0 3600 |
| 39 |
e |
| 40 |
</CsScore> |
| 41 |
</CsoundSynthesizer> |
| 42 |
<bsbPanel> |
| 43 |
<label>Widgets</label> |
| 44 |
<objectName/> |
| 45 |
<x>0</x> |
| 46 |
<y>0</y> |
| 47 |
<width>284</width> |
| 48 |
<height>433</height> |
| 49 |
<visible>true</visible> |
| 50 |
<uuid/> |
| 51 |
<bgcolor mode="background"> |
| 52 |
<r>194</r> |
| 53 |
<g>204</g> |
| 54 |
<b>210</b> |
| 55 |
</bgcolor> |
| 56 |
<bsbObject version="2" type="BSBLabel"> |
| 57 |
<objectName/> |
| 58 |
<x>8</x> |
| 59 |
<y>225</y> |
| 60 |
<width>276</width> |
| 61 |
<height>199</height> |
| 62 |
<uuid>{b37e9f05-df2d-4a31-ab50-f93173624086}</uuid> |
| 63 |
<visible>true</visible> |
| 64 |
<midichan>0</midichan> |
| 65 |
<midicc>-3</midicc> |
| 66 |
<description/> |
| 67 |
<label>The Line Edit Widget can also be used to receive strings from Csound. Put the keyboard focus on the line edit widget below and type on the ASCII keyboard.</label> |
| 68 |
<alignment>left</alignment> |
| 69 |
<valignment>top</valignment> |
| 70 |
<font>Liberation Sans</font> |
| 71 |
<fontsize>12</fontsize> |
| 72 |
<precision>3</precision> |
| 73 |
<color> |
| 74 |
<r>42</r> |
| 75 |
<g>46</g> |
| 76 |
<b>50</b> |
| 77 |
</color> |
| 78 |
<bgcolor mode="background"> |
| 79 |
<r>166</r> |
| 80 |
<g>176</g> |
| 81 |
<b>180</b> |
| 82 |
</bgcolor> |
| 83 |
<bordermode>false</bordermode> |
| 84 |
<borderradius>5</borderradius> |
| 85 |
<borderwidth>0</borderwidth> |
| 86 |
</bsbObject> |
| 87 |
<bsbObject version="2" type="BSBLineEdit"> |
| 88 |
<objectName>lineedit</objectName> |
| 89 |
<x>205</x> |
| 90 |
<y>305</y> |
| 91 |
<width>25</width> |
| 92 |
<height>25</height> |
| 93 |
<uuid>{eca8b99c-5d0e-4bd0-adb5-199c226b5305}</uuid> |
| 94 |
<visible>true</visible> |
| 95 |
<midichan>0</midichan> |
| 96 |
<midicc>-3</midicc> |
| 97 |
<description/> |
| 98 |
<label>-</label> |
| 99 |
<alignment>left</alignment> |
| 100 |
<font>Arial</font> |
| 101 |
<fontsize>12</fontsize> |
| 102 |
<precision>3</precision> |
| 103 |
<color> |
| 104 |
<r>0</r> |
| 105 |
<g>0</g> |
| 106 |
<b>0</b> |
| 107 |
</color> |
| 108 |
<bgcolor mode="nobackground"> |
| 109 |
<r>232</r> |
| 110 |
<g>232</g> |
| 111 |
<b>232</b> |
| 112 |
</bgcolor> |
| 113 |
<background>nobackground</background> |
| 114 |
</bsbObject> |
| 115 |
<bsbObject version="2" type="BSBKnob"> |
| 116 |
<objectName>level</objectName> |
| 117 |
<x>50</x> |
| 118 |
<y>346</y> |
| 119 |
<width>50</width> |
| 120 |
<height>49</height> |
| 121 |
<uuid>{d6a1bbac-0b3f-49ba-b281-6a31c464d7b4}</uuid> |
| 122 |
<visible>true</visible> |
| 123 |
<midichan>0</midichan> |
| 124 |
<midicc>-3</midicc> |
| 125 |
<description/> |
| 126 |
<minimum>0.05000000</minimum> |
| 127 |
<maximum>0.50000000</maximum> |
| 128 |
<value>0.23198000</value> |
| 129 |
<mode>lin</mode> |
| 130 |
<mouseControl act="">continuous</mouseControl> |
| 131 |
<resolution>0.01000000</resolution> |
| 132 |
<randomizable group="0">false</randomizable> |
| 133 |
<color> |
| 134 |
<r>245</r> |
| 135 |
<g>124</g> |
| 136 |
<b>0</b> |
| 137 |
</color> |
| 138 |
<textcolor>#512900</textcolor> |
| 139 |
<border>0</border> |
| 140 |
<borderColor>#512900</borderColor> |
| 141 |
<showvalue>true</showvalue> |
| 142 |
<flatstyle>true</flatstyle> |
| 143 |
<integerMode>false</integerMode> |
| 144 |
</bsbObject> |
| 145 |
<bsbObject version="2" type="BSBLabel"> |
| 146 |
<objectName/> |
| 147 |
<x>44</x> |
| 148 |
<y>306</y> |
| 149 |
<width>156</width> |
| 150 |
<height>26</height> |
| 151 |
<uuid>{f9f54980-38ff-4721-97d6-8afa7a524711}</uuid> |
| 152 |
<visible>true</visible> |
| 153 |
<midichan>0</midichan> |
| 154 |
<midicc>-3</midicc> |
| 155 |
<description/> |
| 156 |
<label>Put keyboard focus here >>></label> |
| 157 |
<alignment>left</alignment> |
| 158 |
<valignment>top</valignment> |
| 159 |
<font>Liberation Sans</font> |
| 160 |
<fontsize>12</fontsize> |
| 161 |
<precision>3</precision> |
| 162 |
<color> |
| 163 |
<r>0</r> |
| 164 |
<g>0</g> |
| 165 |
<b>0</b> |
| 166 |
</color> |
| 167 |
<bgcolor mode="nobackground"> |
| 168 |
<r>255</r> |
| 169 |
<g>255</g> |
| 170 |
<b>255</b> |
| 171 |
</bgcolor> |
| 172 |
<bordermode>false</bordermode> |
| 173 |
<borderradius>1</borderradius> |
| 174 |
<borderwidth>0</borderwidth> |
| 175 |
</bsbObject> |
| 176 |
<bsbObject version="2" type="BSBLabel"> |
| 177 |
<objectName/> |
| 178 |
<x>51</x> |
| 179 |
<y>390</y> |
| 180 |
<width>49</width> |
| 181 |
<height>24</height> |
| 182 |
<uuid>{2cd5cd9d-6ca7-4350-b274-ef793f5dedce}</uuid> |
| 183 |
<visible>true</visible> |
| 184 |
<midichan>0</midichan> |
| 185 |
<midicc>-3</midicc> |
| 186 |
<description/> |
| 187 |
<label>Level</label> |
| 188 |
<alignment>center</alignment> |
| 189 |
<valignment>top</valignment> |
| 190 |
<font>Arial</font> |
| 191 |
<fontsize>12</fontsize> |
| 192 |
<precision>3</precision> |
| 193 |
<color> |
| 194 |
<r>0</r> |
| 195 |
<g>0</g> |
| 196 |
<b>0</b> |
| 197 |
</color> |
| 198 |
<bgcolor mode="nobackground"> |
| 199 |
<r>255</r> |
| 200 |
<g>255</g> |
| 201 |
<b>255</b> |
| 202 |
</bgcolor> |
| 203 |
<bordermode>noborder</bordermode> |
| 204 |
<borderradius>1</borderradius> |
| 205 |
<borderwidth>0</borderwidth> |
| 206 |
</bsbObject> |
| 207 |
<bsbObject version="2" type="BSBHSlider"> |
| 208 |
<objectName>dur</objectName> |
| 209 |
<x>128</x> |
| 210 |
<y>358</y> |
| 211 |
<width>109</width> |
| 212 |
<height>19</height> |
| 213 |
<uuid>{7b7e5745-622f-411c-97d8-b4136ee2b401}</uuid> |
| 214 |
<visible>true</visible> |
| 215 |
<midichan>0</midichan> |
| 216 |
<midicc>-3</midicc> |
| 217 |
<description/> |
| 218 |
<minimum>0.20000000</minimum> |
| 219 |
<maximum>2.00000000</maximum> |
| 220 |
<value>1.30642202</value> |
| 221 |
<mode>lin</mode> |
| 222 |
<mouseControl act="jump">continuous</mouseControl> |
| 223 |
<resolution>-1.00000000</resolution> |
| 224 |
<randomizable group="0">true</randomizable> |
| 225 |
</bsbObject> |
| 226 |
<bsbObject version="2" type="BSBLabel"> |
| 227 |
<objectName/> |
| 228 |
<x>158</x> |
| 229 |
<y>376</y> |
| 230 |
<width>60</width> |
| 231 |
<height>22</height> |
| 232 |
<uuid>{0f74a0f5-f1a9-4ef5-962c-e1753a6e6cc5}</uuid> |
| 233 |
<visible>true</visible> |
| 234 |
<midichan>0</midichan> |
| 235 |
<midicc>-3</midicc> |
| 236 |
<description/> |
| 237 |
<label>duration</label> |
| 238 |
<alignment>left</alignment> |
| 239 |
<valignment>top</valignment> |
| 240 |
<font>Arial</font> |
| 241 |
<fontsize>12</fontsize> |
| 242 |
<precision>3</precision> |
| 243 |
<color> |
| 244 |
<r>0</r> |
| 245 |
<g>0</g> |
| 246 |
<b>0</b> |
| 247 |
</color> |
| 248 |
<bgcolor mode="nobackground"> |
| 249 |
<r>255</r> |
| 250 |
<g>255</g> |
| 251 |
<b>255</b> |
| 252 |
</bgcolor> |
| 253 |
<bordermode>noborder</bordermode> |
| 254 |
<borderradius>1</borderradius> |
| 255 |
<borderwidth>0</borderwidth> |
| 256 |
</bsbObject> |
| 257 |
<bsbObject version="2" type="BSBLabel"> |
| 258 |
<objectName/> |
| 259 |
<x>8</x> |
| 260 |
<y>46</y> |
| 261 |
<width>276</width> |
| 262 |
<height>170</height> |
| 263 |
<uuid>{187b22e7-31c4-4f4c-bb47-168034be6765}</uuid> |
| 264 |
<visible>true</visible> |
| 265 |
<midichan>0</midichan> |
| 266 |
<midicc>-3</midicc> |
| 267 |
<description/> |
| 268 |
<label>The Line Edit Widget can be used to pass strings from the widget panel to the csound program.</label> |
| 269 |
<alignment>left</alignment> |
| 270 |
<valignment>top</valignment> |
| 271 |
<font>Liberation Sans</font> |
| 272 |
<fontsize>12</fontsize> |
| 273 |
<precision>3</precision> |
| 274 |
<color> |
| 275 |
<r>28</r> |
| 276 |
<g>29</g> |
| 277 |
<b>30</b> |
| 278 |
</color> |
| 279 |
<bgcolor mode="background"> |
| 280 |
<r>166</r> |
| 281 |
<g>176</g> |
| 282 |
<b>180</b> |
| 283 |
</bgcolor> |
| 284 |
<bordermode>false</bordermode> |
| 285 |
<borderradius>5</borderradius> |
| 286 |
<borderwidth>0</borderwidth> |
| 287 |
</bsbObject> |
| 288 |
<bsbObject version="2" type="BSBLineEdit"> |
| 289 |
<objectName>instring</objectName> |
| 290 |
<x>15</x> |
| 291 |
<y>105</y> |
| 292 |
<width>262</width> |
| 293 |
<height>27</height> |
| 294 |
<uuid>{b3c2f590-724b-404e-8eac-a32bc9bf0185}</uuid> |
| 295 |
<visible>true</visible> |
| 296 |
<midichan>0</midichan> |
| 297 |
<midicc>-3</midicc> |
| 298 |
<description/> |
| 299 |
<label>bar</label> |
| 300 |
<alignment>left</alignment> |
| 301 |
<font>Arial</font> |
| 302 |
<fontsize>12</fontsize> |
| 303 |
<precision>3</precision> |
| 304 |
<color> |
| 305 |
<r>0</r> |
| 306 |
<g>0</g> |
| 307 |
<b>0</b> |
| 308 |
</color> |
| 309 |
<bgcolor mode="nobackground"> |
| 310 |
<r>232</r> |
| 311 |
<g>232</g> |
| 312 |
<b>232</b> |
| 313 |
</bgcolor> |
| 314 |
<background>nobackground</background> |
| 315 |
</bsbObject> |
| 316 |
<bsbObject version="2" type="BSBLabel"> |
| 317 |
<objectName>display</objectName> |
| 318 |
<x>15</x> |
| 319 |
<y>142</y> |
| 320 |
<width>261</width> |
| 321 |
<height>64</height> |
| 322 |
<uuid>{546df023-1aa4-43be-919e-c873c18a3ec7}</uuid> |
| 323 |
<visible>true</visible> |
| 324 |
<midichan>0</midichan> |
| 325 |
<midicc>-3</midicc> |
| 326 |
<description/> |
| 327 |
<label>bar</label> |
| 328 |
<alignment>left</alignment> |
| 329 |
<valignment>top</valignment> |
| 330 |
<font>Liberation Mono</font> |
| 331 |
<fontsize>18</fontsize> |
| 332 |
<precision>3</precision> |
| 333 |
<color> |
| 334 |
<r>230</r> |
| 335 |
<g>230</g> |
| 336 |
<b>230</b> |
| 337 |
</color> |
| 338 |
<bgcolor mode="background"> |
| 339 |
<r>42</r> |
| 340 |
<g>46</g> |
| 341 |
<b>50</b> |
| 342 |
</bgcolor> |
| 343 |
<bordermode>false</bordermode> |
| 344 |
<borderradius>5</borderradius> |
| 345 |
<borderwidth>0</borderwidth> |
| 346 |
</bsbObject> |
| 347 |
<bsbObject version="2" type="BSBLabel"> |
| 348 |
<objectName/> |
| 349 |
<x>27</x> |
| 350 |
<y>8</y> |
| 351 |
<width>226</width> |
| 352 |
<height>38</height> |
| 353 |
<uuid>{f252e58c-f68b-4d35-a641-077bd7762802}</uuid> |
| 354 |
<visible>true</visible> |
| 355 |
<midichan>0</midichan> |
| 356 |
<midicc>-3</midicc> |
| 357 |
<description/> |
| 358 |
<label>Line Edit Widget</label> |
| 359 |
<alignment>center</alignment> |
| 360 |
<valignment>top</valignment> |
| 361 |
<font>Arial</font> |
| 362 |
<fontsize>24</fontsize> |
| 363 |
<precision>3</precision> |
| 364 |
<color> |
| 365 |
<r>0</r> |
| 366 |
<g>0</g> |
| 367 |
<b>0</b> |
| 368 |
</color> |
| 369 |
<bgcolor mode="nobackground"> |
| 370 |
<r>255</r> |
| 371 |
<g>255</g> |
| 372 |
<b>255</b> |
| 373 |
</bgcolor> |
| 374 |
<bordermode>noborder</bordermode> |
| 375 |
<borderradius>1</borderradius> |
| 376 |
<borderwidth>0</borderwidth> |
| 377 |
</bsbObject> |
| 378 |
</bsbPanel> |
| 379 |
<bsbPresets> |
| 380 |
</bsbPresets> |