| 1 |
/* Getting Started .. Realtime Interaction: Widgets |
| 2 |
|
| 3 |
Rember to open the Widget Panel. |
| 4 |
|
| 5 |
The last example demonstrated how an instrument receives values from the Widget Panel. |
| 6 |
It's also possible to send values to the Widgets, by using 'outvalue' opcode in the instrument. |
| 7 |
|
| 8 |
Now, you can display values, automate faders and much more.. |
| 9 |
*/ |
| 10 |
|
| 11 |
<CsoundSynthesizer> |
| 12 |
<CsOptions> |
| 13 |
</CsOptions> |
| 14 |
<CsInstruments> |
| 15 |
|
| 16 |
sr = 44100 |
| 17 |
ksmps = 128 |
| 18 |
nchnls = 1 |
| 19 |
0dbfs = 1 |
| 20 |
|
| 21 |
instr 1 ; Move Fader |
| 22 |
kMoveUp linseg 0, 3, 1, 1, 1, 0.5, 0 |
| 23 |
outvalue "movefader", kMoveUp |
| 24 |
endin |
| 25 |
|
| 26 |
</CsInstruments> |
| 27 |
<CsScore> |
| 28 |
i 1 0 5 |
| 29 |
e |
| 30 |
</CsScore> |
| 31 |
</CsoundSynthesizer> |
| 32 |
; written by Alex Hofmann (Dec. 2009) - Incontri HMT-Hannover |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
<bsbPanel> |
| 43 |
<label>Widgets</label> |
| 44 |
<objectName/> |
| 45 |
<x>1013</x> |
| 46 |
<y>279</y> |
| 47 |
<width>563</width> |
| 48 |
<height>397</height> |
| 49 |
<visible>true</visible> |
| 50 |
<uuid/> |
| 51 |
<bgcolor mode="background"> |
| 52 |
<r>7</r> |
| 53 |
<g>95</g> |
| 54 |
<b>162</b> |
| 55 |
</bgcolor> |
| 56 |
<bsbObject version="2" type="BSBLabel"> |
| 57 |
<objectName/> |
| 58 |
<x>28</x> |
| 59 |
<y>9</y> |
| 60 |
<width>205</width> |
| 61 |
<height>42</height> |
| 62 |
<uuid>{f6df122b-8c0c-4881-9ab1-8231ce732408}</uuid> |
| 63 |
<visible>true</visible> |
| 64 |
<midichan>0</midichan> |
| 65 |
<midicc>-3</midicc> |
| 66 |
<label>2. Run Csound !</label> |
| 67 |
<alignment>left</alignment> |
| 68 |
<font>Lucida Grande</font> |
| 69 |
<fontsize>22</fontsize> |
| 70 |
<precision>3</precision> |
| 71 |
<color> |
| 72 |
<r>255</r> |
| 73 |
<g>255</g> |
| 74 |
<b>255</b> |
| 75 |
</color> |
| 76 |
<bgcolor mode="nobackground"> |
| 77 |
<r>255</r> |
| 78 |
<g>255</g> |
| 79 |
<b>255</b> |
| 80 |
</bgcolor> |
| 81 |
<bordermode>noborder</bordermode> |
| 82 |
<borderradius>1</borderradius> |
| 83 |
<borderwidth>1</borderwidth> |
| 84 |
</bsbObject> |
| 85 |
<bsbObject version="2" type="BSBVSlider"> |
| 86 |
<objectName>movefader</objectName> |
| 87 |
<x>42</x> |
| 88 |
<y>59</y> |
| 89 |
<width>19</width> |
| 90 |
<height>151</height> |
| 91 |
<uuid>{97473a58-3afe-41e6-89b5-32fee930e624}</uuid> |
| 92 |
<visible>true</visible> |
| 93 |
<midichan>0</midichan> |
| 94 |
<midicc>-3</midicc> |
| 95 |
<minimum>0.00000000</minimum> |
| 96 |
<maximum>1.00000000</maximum> |
| 97 |
<value>0.41721900</value> |
| 98 |
<mode>lin</mode> |
| 99 |
<mouseControl act="jump">continuous</mouseControl> |
| 100 |
<resolution>-1.00000000</resolution> |
| 101 |
<randomizable group="0">false</randomizable> |
| 102 |
</bsbObject> |
| 103 |
<bsbObject version="2" type="BSBDisplay"> |
| 104 |
<objectName>movefader</objectName> |
| 105 |
<x>39</x> |
| 106 |
<y>236</y> |
| 107 |
<width>80</width> |
| 108 |
<height>25</height> |
| 109 |
<uuid>{f9e76a39-a96a-4123-8d85-aeae35f1042b}</uuid> |
| 110 |
<visible>true</visible> |
| 111 |
<midichan>0</midichan> |
| 112 |
<midicc>-3</midicc> |
| 113 |
<label>0.4172</label> |
| 114 |
<alignment>left</alignment> |
| 115 |
<font>Lucida Grande</font> |
| 116 |
<fontsize>10</fontsize> |
| 117 |
<precision>3</precision> |
| 118 |
<color> |
| 119 |
<r>255</r> |
| 120 |
<g>255</g> |
| 121 |
<b>255</b> |
| 122 |
</color> |
| 123 |
<bgcolor mode="nobackground"> |
| 124 |
<r>255</r> |
| 125 |
<g>255</g> |
| 126 |
<b>255</b> |
| 127 |
</bgcolor> |
| 128 |
<bordermode>border</bordermode> |
| 129 |
<borderradius>1</borderradius> |
| 130 |
<borderwidth>1</borderwidth> |
| 131 |
</bsbObject> |
| 132 |
<bsbObject version="2" type="BSBLabel"> |
| 133 |
<objectName/> |
| 134 |
<x>82</x> |
| 135 |
<y>68</y> |
| 136 |
<width>122</width> |
| 137 |
<height>135</height> |
| 138 |
<uuid>{48e54cb9-ee21-4ae8-a4c1-7cce9b13b5c3}</uuid> |
| 139 |
<visible>true</visible> |
| 140 |
<midichan>0</midichan> |
| 141 |
<midicc>-3</midicc> |
| 142 |
<label>If you hover over a widget, a tooltip will appear displaying the channel, the widget is using.</label> |
| 143 |
<alignment>left</alignment> |
| 144 |
<font>Lucida Grande</font> |
| 145 |
<fontsize>14</fontsize> |
| 146 |
<precision>3</precision> |
| 147 |
<color> |
| 148 |
<r>255</r> |
| 149 |
<g>255</g> |
| 150 |
<b>255</b> |
| 151 |
</color> |
| 152 |
<bgcolor mode="nobackground"> |
| 153 |
<r>255</r> |
| 154 |
<g>255</g> |
| 155 |
<b>255</b> |
| 156 |
</bgcolor> |
| 157 |
<bordermode>border</bordermode> |
| 158 |
<borderradius>1</borderradius> |
| 159 |
<borderwidth>1</borderwidth> |
| 160 |
</bsbObject> |
| 161 |
<bsbObject version="2" type="BSBLabel"> |
| 162 |
<objectName/> |
| 163 |
<x>37</x> |
| 164 |
<y>263</y> |
| 165 |
<width>163</width> |
| 166 |
<height>152</height> |
| 167 |
<uuid>{2a904b93-45cb-42af-9b9a-018f5eddd2d1}</uuid> |
| 168 |
<visible>true</visible> |
| 169 |
<midichan>0</midichan> |
| 170 |
<midicc>-3</midicc> |
| 171 |
<label>Widgets with the same channel, alter each other! This can be used, to display the faders value, or make exact adjustments in a scrollnumber box with the mouse.</label> |
| 172 |
<alignment>left</alignment> |
| 173 |
<font>Lucida Grande</font> |
| 174 |
<fontsize>14</fontsize> |
| 175 |
<precision>3</precision> |
| 176 |
<color> |
| 177 |
<r>255</r> |
| 178 |
<g>255</g> |
| 179 |
<b>255</b> |
| 180 |
</color> |
| 181 |
<bgcolor mode="nobackground"> |
| 182 |
<r>255</r> |
| 183 |
<g>255</g> |
| 184 |
<b>255</b> |
| 185 |
</bgcolor> |
| 186 |
<bordermode>noborder</bordermode> |
| 187 |
<borderradius>1</borderradius> |
| 188 |
<borderwidth>1</borderwidth> |
| 189 |
</bsbObject> |
| 190 |
<bsbObject version="2" type="BSBScrollNumber"> |
| 191 |
<objectName>movefader</objectName> |
| 192 |
<x>118</x> |
| 193 |
<y>388</y> |
| 194 |
<width>80</width> |
| 195 |
<height>25</height> |
| 196 |
<uuid>{01d6f97a-d9ea-4064-9d3f-ee588e34d384}</uuid> |
| 197 |
<visible>true</visible> |
| 198 |
<midichan>0</midichan> |
| 199 |
<midicc>-3</midicc> |
| 200 |
<alignment>left</alignment> |
| 201 |
<font>Lucida Grande</font> |
| 202 |
<fontsize>10</fontsize> |
| 203 |
<color> |
| 204 |
<r>0</r> |
| 205 |
<g>0</g> |
| 206 |
<b>0</b> |
| 207 |
</color> |
| 208 |
<bgcolor mode="background"> |
| 209 |
<r>255</r> |
| 210 |
<g>255</g> |
| 211 |
<b>255</b> |
| 212 |
</bgcolor> |
| 213 |
<value>0.41720000</value> |
| 214 |
<resolution>0.00010000</resolution> |
| 215 |
<minimum>-999999999999.00000000</minimum> |
| 216 |
<maximum>99999999999999.00000000</maximum> |
| 217 |
<bordermode>border</bordermode> |
| 218 |
<borderradius>1</borderradius> |
| 219 |
<borderwidth>1</borderwidth> |
| 220 |
<randomizable group="0">false</randomizable> |
| 221 |
<mouseControl act="continuous"/> |
| 222 |
</bsbObject> |
| 223 |
<bsbObject version="2" type="BSBLabel"> |
| 224 |
<objectName/> |
| 225 |
<x>38</x> |
| 226 |
<y>216</y> |
| 227 |
<width>112</width> |
| 228 |
<height>21</height> |
| 229 |
<uuid>{9c8a2bf9-a45c-452d-bc3f-73b0a8ee5bb3}</uuid> |
| 230 |
<visible>true</visible> |
| 231 |
<midichan>0</midichan> |
| 232 |
<midicc>-3</midicc> |
| 233 |
<label>Display the value:</label> |
| 234 |
<alignment>left</alignment> |
| 235 |
<font>Lucida Grande</font> |
| 236 |
<fontsize>10</fontsize> |
| 237 |
<precision>3</precision> |
| 238 |
<color> |
| 239 |
<r>255</r> |
| 240 |
<g>255</g> |
| 241 |
<b>255</b> |
| 242 |
</color> |
| 243 |
<bgcolor mode="nobackground"> |
| 244 |
<r>255</r> |
| 245 |
<g>255</g> |
| 246 |
<b>255</b> |
| 247 |
</bgcolor> |
| 248 |
<bordermode>noborder</bordermode> |
| 249 |
<borderradius>1</borderradius> |
| 250 |
<borderwidth>1</borderwidth> |
| 251 |
</bsbObject> |
| 252 |
</bsbPanel> |
| 253 |
<bsbPresets> |
| 254 |
</bsbPresets> |
| 255 |
<EventPanel name="" tempo="60.00000000" loop="8.00000000" x="261" y="207" width="513" height="322" visible="true" loopStart="0" loopEnd="0"> </EventPanel> |