| 1 |
/* Getting Started .. Realtime Interaction: Widgets 2 |
| 2 |
|
| 3 |
Make the Widgets-panel visible, by clicking the Widgets symbol in the menu or pressing (Alt+1). |
| 4 |
|
| 5 |
*/ |
| 6 |
|
| 7 |
<CsoundSynthesizer> |
| 8 |
<CsOptions> |
| 9 |
</CsOptions> |
| 10 |
<CsInstruments> |
| 11 |
|
| 12 |
sr = 44100 |
| 13 |
ksmps = 128 |
| 14 |
nchnls = 2 |
| 15 |
0dbfs = 1 |
| 16 |
|
| 17 |
instr 1 |
| 18 |
kfreq invalue "freq" ; Quotes are needed here |
| 19 |
asig oscil 0.1, kfreq, 1 |
| 20 |
outs asig, asig |
| 21 |
endin |
| 22 |
</CsInstruments> |
| 23 |
<CsScore> |
| 24 |
f 1 0 1024 10 1 ;Sine wave for table 1 |
| 25 |
i 1 0 300 ; Play for 300 seconds |
| 26 |
e |
| 27 |
</CsScore> |
| 28 |
</CsoundSynthesizer> |
| 29 |
; written by Andres Cabrera |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
<bsbPanel> |
| 38 |
<label>Widgets</label> |
| 39 |
<objectName/> |
| 40 |
<x>1013</x> |
| 41 |
<y>279</y> |
| 42 |
<width>563</width> |
| 43 |
<height>397</height> |
| 44 |
<visible>true</visible> |
| 45 |
<uuid/> |
| 46 |
<bgcolor mode="background"> |
| 47 |
<r>7</r> |
| 48 |
<g>95</g> |
| 49 |
<b>162</b> |
| 50 |
</bgcolor> |
| 51 |
<bsbObject type="BSBLabel" version="2"> |
| 52 |
<objectName/> |
| 53 |
<x>14</x> |
| 54 |
<y>12</y> |
| 55 |
<width>209</width> |
| 56 |
<height>38</height> |
| 57 |
<uuid>{19774345-2e9f-4969-bf1e-dcb12478dea6}</uuid> |
| 58 |
<visible>true</visible> |
| 59 |
<midichan>0</midichan> |
| 60 |
<midicc>-3</midicc> |
| 61 |
<description/> |
| 62 |
<label>Using Widgets</label> |
| 63 |
<alignment>left</alignment> |
| 64 |
<valignment>top</valignment> |
| 65 |
<font>Helvetica</font> |
| 66 |
<fontsize>26</fontsize> |
| 67 |
<precision>3</precision> |
| 68 |
<color> |
| 69 |
<r>241</r> |
| 70 |
<g>241</g> |
| 71 |
<b>241</b> |
| 72 |
</color> |
| 73 |
<bgcolor mode="nobackground"> |
| 74 |
<r>255</r> |
| 75 |
<g>255</g> |
| 76 |
<b>255</b> |
| 77 |
</bgcolor> |
| 78 |
<bordermode>noborder</bordermode> |
| 79 |
<borderradius>1</borderradius> |
| 80 |
<borderwidth>0</borderwidth> |
| 81 |
</bsbObject> |
| 82 |
<bsbObject type="BSBLabel" version="2"> |
| 83 |
<objectName/> |
| 84 |
<x>10</x> |
| 85 |
<y>50</y> |
| 86 |
<width>365</width> |
| 87 |
<height>93</height> |
| 88 |
<uuid>{61b4de03-c3bd-49a6-9e54-2f027c7d8b0d}</uuid> |
| 89 |
<visible>true</visible> |
| 90 |
<midichan>0</midichan> |
| 91 |
<midicc>-3</midicc> |
| 92 |
<description/> |
| 93 |
<label>You can receive Widget values in the Csound orchestra using "channels". You use channel names to identify them, and you must set the channel name in the Widget and in the orchestra's invalue opcode.</label> |
| 94 |
<alignment>left</alignment> |
| 95 |
<valignment>top</valignment> |
| 96 |
<font>Helvetica</font> |
| 97 |
<fontsize>14</fontsize> |
| 98 |
<precision>3</precision> |
| 99 |
<color> |
| 100 |
<r>241</r> |
| 101 |
<g>241</g> |
| 102 |
<b>241</b> |
| 103 |
</color> |
| 104 |
<bgcolor mode="nobackground"> |
| 105 |
<r>255</r> |
| 106 |
<g>255</g> |
| 107 |
<b>255</b> |
| 108 |
</bgcolor> |
| 109 |
<bordermode>noborder</bordermode> |
| 110 |
<borderradius>1</borderradius> |
| 111 |
<borderwidth>0</borderwidth> |
| 112 |
</bsbObject> |
| 113 |
<bsbObject type="BSBLabel" version="2"> |
| 114 |
<objectName/> |
| 115 |
<x>10</x> |
| 116 |
<y>200</y> |
| 117 |
<width>380</width> |
| 118 |
<height>220</height> |
| 119 |
<uuid>{ba0489e8-4f09-443d-bd82-4a57532c1e31}</uuid> |
| 120 |
<visible>true</visible> |
| 121 |
<midichan>0</midichan> |
| 122 |
<midicc>-3</midicc> |
| 123 |
<description/> |
| 124 |
<label>Enter the slider's properties by right-clicking (or control-clicking) and selecting "Properties". This will open the Widget Properties dialog, which will allow you to set the Widget's channel name. Set the channel name to "freq" (without the quotes). |
| 125 |
Now run Csound, and notice how the widget is controlling the frequency of the oscillator!</label> |
| 126 |
<alignment>left</alignment> |
| 127 |
<valignment>top</valignment> |
| 128 |
<font>Nimbus Sans [urw]</font> |
| 129 |
<fontsize>14</fontsize> |
| 130 |
<precision>3</precision> |
| 131 |
<color> |
| 132 |
<r>241</r> |
| 133 |
<g>241</g> |
| 134 |
<b>241</b> |
| 135 |
</color> |
| 136 |
<bgcolor mode="nobackground"> |
| 137 |
<r>255</r> |
| 138 |
<g>255</g> |
| 139 |
<b>255</b> |
| 140 |
</bgcolor> |
| 141 |
<bordermode>true</bordermode> |
| 142 |
<borderradius>1</borderradius> |
| 143 |
<borderwidth>1</borderwidth> |
| 144 |
</bsbObject> |
| 145 |
<bsbObject type="BSBHSlider" version="2"> |
| 146 |
<objectName>slider</objectName> |
| 147 |
<x>10</x> |
| 148 |
<y>160</y> |
| 149 |
<width>366</width> |
| 150 |
<height>21</height> |
| 151 |
<uuid>{2d44d97e-66cb-491f-bb9e-d9e6f20e16f5}</uuid> |
| 152 |
<visible>true</visible> |
| 153 |
<midichan>0</midichan> |
| 154 |
<midicc>-3</midicc> |
| 155 |
<description/> |
| 156 |
<minimum>300.00000000</minimum> |
| 157 |
<maximum>1000.00000000</maximum> |
| 158 |
<value>449.18032787</value> |
| 159 |
<mode>lin</mode> |
| 160 |
<mouseControl act="jump">continuous</mouseControl> |
| 161 |
<resolution>-1.00000000</resolution> |
| 162 |
<randomizable group="0">false</randomizable> |
| 163 |
</bsbObject> |
| 164 |
<bsbObject type="BSBLabel" version="2"> |
| 165 |
<objectName/> |
| 166 |
<x>10</x> |
| 167 |
<y>425</y> |
| 168 |
<width>380</width> |
| 169 |
<height>51</height> |
| 170 |
<uuid>{56667bda-b29d-49dc-a2d0-560ec1aa5f6c}</uuid> |
| 171 |
<visible>true</visible> |
| 172 |
<midichan>0</midichan> |
| 173 |
<midicc>-3</midicc> |
| 174 |
<description/> |
| 175 |
<label>You can change a slider's range in its properties dialog, if you want a broader or smaller range.</label> |
| 176 |
<alignment>left</alignment> |
| 177 |
<valignment>top</valignment> |
| 178 |
<font>Nimbus Sans [urw]</font> |
| 179 |
<fontsize>14</fontsize> |
| 180 |
<precision>3</precision> |
| 181 |
<color> |
| 182 |
<r>241</r> |
| 183 |
<g>241</g> |
| 184 |
<b>241</b> |
| 185 |
</color> |
| 186 |
<bgcolor mode="nobackground"> |
| 187 |
<r>255</r> |
| 188 |
<g>255</g> |
| 189 |
<b>255</b> |
| 190 |
</bgcolor> |
| 191 |
<bordermode>true</bordermode> |
| 192 |
<borderradius>1</borderradius> |
| 193 |
<borderwidth>1</borderwidth> |
| 194 |
</bsbObject> |
| 195 |
</bsbPanel> |
| 196 |
<bsbPresets> |
| 197 |
</bsbPresets> |
| 198 |
<EventPanel name="Events" tempo="60.00000000" loop="8.00000000" x="320" y="218" width="604" height="322" visible="false" loopStart="0" loopEnd="0"> </EventPanel> |