| 1 |
;Written by Iain McCurdy |
| 2 |
|
| 3 |
;Modified for QuteCsound by René, February 2011 |
| 4 |
;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817 |
| 5 |
|
| 6 |
;Notes on modifications from original csd: |
| 7 |
|
| 8 |
|
| 9 |
;my flags on Ubuntu: -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0 |
| 10 |
<CsoundSynthesizer> |
| 11 |
<CsOptions> |
| 12 |
|
| 13 |
</CsOptions> |
| 14 |
<CsInstruments> |
| 15 |
sr = 44100 ;SAMPLE RATE |
| 16 |
ksmps = 10 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE |
| 17 |
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO) |
| 18 |
0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH |
| 19 |
|
| 20 |
|
| 21 |
instr 1 |
| 22 |
kpan invalue "Pan" |
| 23 |
kgain invalue "Gain" |
| 24 |
kmode invalue "Mode" |
| 25 |
|
| 26 |
asig pinkish kgain ;GENERATE PINK NOISE |
| 27 |
|
| 28 |
kSwitch changed kmode ;GENERATE A MOMENTARY '1' PULSE IN OUTPUT 'kSwitch' IF ANY OF THE SCANNED INPUT VARIABLES CHANGE |
| 29 |
if kSwitch=1 then ;IF I-RATE VARIABLE CHANGE TRIGGER IS '1'... |
| 30 |
reinit UPDATE ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE' |
| 31 |
endif |
| 32 |
UPDATE: |
| 33 |
a1, a2 pan2 asig, kpan , i(kmode) ;APPLY PANNING TO INPUT SIGNAL gasig USING THE MODE SELECTED BY i(gkmode) |
| 34 |
rireturn ;RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES |
| 35 |
outs a1, a2 ;SEND AUDIO SIGNAL TO OUTPUTS |
| 36 |
endin |
| 37 |
</CsInstruments> |
| 38 |
<CsScore> |
| 39 |
f 0 3600 ;REAL TIME FOR 1 HOUR |
| 40 |
</CsScore> |
| 41 |
</CsoundSynthesizer> |
| 42 |
<bsbPanel> |
| 43 |
<label>Widgets</label> |
| 44 |
<objectName/> |
| 45 |
<x>72</x> |
| 46 |
<y>179</y> |
| 47 |
<width>400</width> |
| 48 |
<height>200</height> |
| 49 |
<visible>true</visible> |
| 50 |
<uuid/> |
| 51 |
<bgcolor mode="background"> |
| 52 |
<r>241</r> |
| 53 |
<g>226</g> |
| 54 |
<b>185</b> |
| 55 |
</bgcolor> |
| 56 |
<bsbObject version="2" type="BSBLabel"> |
| 57 |
<objectName/> |
| 58 |
<x>2</x> |
| 59 |
<y>2</y> |
| 60 |
<width>514</width> |
| 61 |
<height>290</height> |
| 62 |
<uuid>{049f4dd4-ff71-4d6d-9157-43c84efad8a4}</uuid> |
| 63 |
<visible>true</visible> |
| 64 |
<midichan>0</midichan> |
| 65 |
<midicc>0</midicc> |
| 66 |
<label>pan2</label> |
| 67 |
<alignment>center</alignment> |
| 68 |
<font>Liberation Sans</font> |
| 69 |
<fontsize>18</fontsize> |
| 70 |
<precision>3</precision> |
| 71 |
<color> |
| 72 |
<r>255</r> |
| 73 |
<g>255</g> |
| 74 |
<b>255</b> |
| 75 |
</color> |
| 76 |
<bgcolor mode="background"> |
| 77 |
<r>5</r> |
| 78 |
<g>27</g> |
| 79 |
<b>150</b> |
| 80 |
</bgcolor> |
| 81 |
<bordermode>border</bordermode> |
| 82 |
<borderradius>5</borderradius> |
| 83 |
<borderwidth>2</borderwidth> |
| 84 |
</bsbObject> |
| 85 |
<bsbObject version="2" type="BSBButton"> |
| 86 |
<objectName/> |
| 87 |
<x>10</x> |
| 88 |
<y>10</y> |
| 89 |
<width>100</width> |
| 90 |
<height>30</height> |
| 91 |
<uuid>{9d29ab85-85e6-462e-8761-1ac91e1af325}</uuid> |
| 92 |
<visible>true</visible> |
| 93 |
<midichan>0</midichan> |
| 94 |
<midicc>0</midicc> |
| 95 |
<type>event</type> |
| 96 |
<pressedValue>1.00000000</pressedValue> |
| 97 |
<stringvalue/> |
| 98 |
<text> ON / OFF</text> |
| 99 |
<image>/</image> |
| 100 |
<eventLine>i 1 0 -1</eventLine> |
| 101 |
<latch>true</latch> |
| 102 |
<latched>false</latched> |
| 103 |
</bsbObject> |
| 104 |
<bsbObject version="2" type="BSBLabel"> |
| 105 |
<objectName/> |
| 106 |
<x>9</x> |
| 107 |
<y>125</y> |
| 108 |
<width>100</width> |
| 109 |
<height>30</height> |
| 110 |
<uuid>{3ebc1139-1fdb-48dc-9150-49ee8dfdbd4a}</uuid> |
| 111 |
<visible>true</visible> |
| 112 |
<midichan>0</midichan> |
| 113 |
<midicc>0</midicc> |
| 114 |
<label>Gain</label> |
| 115 |
<alignment>left</alignment> |
| 116 |
<font>Liberation Sans</font> |
| 117 |
<fontsize>10</fontsize> |
| 118 |
<precision>3</precision> |
| 119 |
<color> |
| 120 |
<r>255</r> |
| 121 |
<g>255</g> |
| 122 |
<b>255</b> |
| 123 |
</color> |
| 124 |
<bgcolor mode="nobackground"> |
| 125 |
<r>255</r> |
| 126 |
<g>255</g> |
| 127 |
<b>255</b> |
| 128 |
</bgcolor> |
| 129 |
<bordermode>noborder</bordermode> |
| 130 |
<borderradius>1</borderradius> |
| 131 |
<borderwidth>1</borderwidth> |
| 132 |
</bsbObject> |
| 133 |
<bsbObject version="2" type="BSBHSlider"> |
| 134 |
<objectName>Gain</objectName> |
| 135 |
<x>9</x> |
| 136 |
<y>102</y> |
| 137 |
<width>500</width> |
| 138 |
<height>27</height> |
| 139 |
<uuid>{2cf97843-5b49-438e-8034-62a459597e86}</uuid> |
| 140 |
<visible>true</visible> |
| 141 |
<midichan>0</midichan> |
| 142 |
<midicc>0</midicc> |
| 143 |
<minimum>0.00000000</minimum> |
| 144 |
<maximum>1.00000000</maximum> |
| 145 |
<value>0.46000000</value> |
| 146 |
<mode>lin</mode> |
| 147 |
<mouseControl act="jump">continuous</mouseControl> |
| 148 |
<resolution>-1.00000000</resolution> |
| 149 |
<randomizable group="0">false</randomizable> |
| 150 |
</bsbObject> |
| 151 |
<bsbObject version="2" type="BSBDisplay"> |
| 152 |
<objectName>Gain</objectName> |
| 153 |
<x>449</x> |
| 154 |
<y>125</y> |
| 155 |
<width>60</width> |
| 156 |
<height>30</height> |
| 157 |
<uuid>{e54486c5-f9aa-4d0e-9a67-6506dae3c790}</uuid> |
| 158 |
<visible>true</visible> |
| 159 |
<midichan>0</midichan> |
| 160 |
<midicc>0</midicc> |
| 161 |
<label>0.460</label> |
| 162 |
<alignment>right</alignment> |
| 163 |
<font>Liberation Sans</font> |
| 164 |
<fontsize>9</fontsize> |
| 165 |
<precision>3</precision> |
| 166 |
<color> |
| 167 |
<r>255</r> |
| 168 |
<g>255</g> |
| 169 |
<b>255</b> |
| 170 |
</color> |
| 171 |
<bgcolor mode="nobackground"> |
| 172 |
<r>255</r> |
| 173 |
<g>255</g> |
| 174 |
<b>255</b> |
| 175 |
</bgcolor> |
| 176 |
<bordermode>noborder</bordermode> |
| 177 |
<borderradius>1</borderradius> |
| 178 |
<borderwidth>1</borderwidth> |
| 179 |
</bsbObject> |
| 180 |
<bsbObject version="2" type="BSBLabel"> |
| 181 |
<objectName/> |
| 182 |
<x>9</x> |
| 183 |
<y>72</y> |
| 184 |
<width>100</width> |
| 185 |
<height>30</height> |
| 186 |
<uuid>{78a7e9cd-fb57-421c-8e1f-40b60a90dfc0}</uuid> |
| 187 |
<visible>true</visible> |
| 188 |
<midichan>0</midichan> |
| 189 |
<midicc>0</midicc> |
| 190 |
<label>Pan</label> |
| 191 |
<alignment>left</alignment> |
| 192 |
<font>Liberation Sans</font> |
| 193 |
<fontsize>10</fontsize> |
| 194 |
<precision>3</precision> |
| 195 |
<color> |
| 196 |
<r>255</r> |
| 197 |
<g>255</g> |
| 198 |
<b>255</b> |
| 199 |
</color> |
| 200 |
<bgcolor mode="nobackground"> |
| 201 |
<r>255</r> |
| 202 |
<g>255</g> |
| 203 |
<b>255</b> |
| 204 |
</bgcolor> |
| 205 |
<bordermode>noborder</bordermode> |
| 206 |
<borderradius>1</borderradius> |
| 207 |
<borderwidth>1</borderwidth> |
| 208 |
</bsbObject> |
| 209 |
<bsbObject version="2" type="BSBHSlider"> |
| 210 |
<objectName>Pan</objectName> |
| 211 |
<x>9</x> |
| 212 |
<y>49</y> |
| 213 |
<width>500</width> |
| 214 |
<height>27</height> |
| 215 |
<uuid>{4b5d3fba-55d0-43d1-a94a-457bc9144a31}</uuid> |
| 216 |
<visible>true</visible> |
| 217 |
<midichan>0</midichan> |
| 218 |
<midicc>0</midicc> |
| 219 |
<minimum>0.00000000</minimum> |
| 220 |
<maximum>1.00000000</maximum> |
| 221 |
<value>0.44400000</value> |
| 222 |
<mode>lin</mode> |
| 223 |
<mouseControl act="jump">continuous</mouseControl> |
| 224 |
<resolution>-1.00000000</resolution> |
| 225 |
<randomizable group="0">false</randomizable> |
| 226 |
</bsbObject> |
| 227 |
<bsbObject version="2" type="BSBDisplay"> |
| 228 |
<objectName>Pan</objectName> |
| 229 |
<x>449</x> |
| 230 |
<y>72</y> |
| 231 |
<width>60</width> |
| 232 |
<height>30</height> |
| 233 |
<uuid>{58265963-6245-459e-8071-9ed8bba850a4}</uuid> |
| 234 |
<visible>true</visible> |
| 235 |
<midichan>0</midichan> |
| 236 |
<midicc>0</midicc> |
| 237 |
<label>0.444</label> |
| 238 |
<alignment>right</alignment> |
| 239 |
<font>Liberation Sans</font> |
| 240 |
<fontsize>9</fontsize> |
| 241 |
<precision>3</precision> |
| 242 |
<color> |
| 243 |
<r>255</r> |
| 244 |
<g>255</g> |
| 245 |
<b>255</b> |
| 246 |
</color> |
| 247 |
<bgcolor mode="nobackground"> |
| 248 |
<r>255</r> |
| 249 |
<g>255</g> |
| 250 |
<b>255</b> |
| 251 |
</bgcolor> |
| 252 |
<bordermode>noborder</bordermode> |
| 253 |
<borderradius>1</borderradius> |
| 254 |
<borderwidth>1</borderwidth> |
| 255 |
</bsbObject> |
| 256 |
<bsbObject version="2" type="BSBLabel"> |
| 257 |
<objectName/> |
| 258 |
<x>150</x> |
| 259 |
<y>147</y> |
| 260 |
<width>78</width> |
| 261 |
<height>29</height> |
| 262 |
<uuid>{d7f5620d-8a05-4982-8edb-af45fcc4611c}</uuid> |
| 263 |
<visible>true</visible> |
| 264 |
<midichan>0</midichan> |
| 265 |
<midicc>0</midicc> |
| 266 |
<label>Mode:</label> |
| 267 |
<alignment>right</alignment> |
| 268 |
<font>Liberation Sans</font> |
| 269 |
<fontsize>10</fontsize> |
| 270 |
<precision>3</precision> |
| 271 |
<color> |
| 272 |
<r>255</r> |
| 273 |
<g>255</g> |
| 274 |
<b>255</b> |
| 275 |
</color> |
| 276 |
<bgcolor mode="nobackground"> |
| 277 |
<r>255</r> |
| 278 |
<g>255</g> |
| 279 |
<b>255</b> |
| 280 |
</bgcolor> |
| 281 |
<bordermode>noborder</bordermode> |
| 282 |
<borderradius>1</borderradius> |
| 283 |
<borderwidth>1</borderwidth> |
| 284 |
</bsbObject> |
| 285 |
<bsbObject version="2" type="BSBDropdown"> |
| 286 |
<objectName>Mode</objectName> |
| 287 |
<x>230</x> |
| 288 |
<y>145</y> |
| 289 |
<width>131</width> |
| 290 |
<height>28</height> |
| 291 |
<uuid>{8cb109df-26ac-4941-807e-460eed6fc48a}</uuid> |
| 292 |
<visible>true</visible> |
| 293 |
<midichan>0</midichan> |
| 294 |
<midicc>0</midicc> |
| 295 |
<bsbDropdownItemList> |
| 296 |
<bsbDropdownItem> |
| 297 |
<name>Equal Power</name> |
| 298 |
<value>0</value> |
| 299 |
<stringvalue/> |
| 300 |
</bsbDropdownItem> |
| 301 |
<bsbDropdownItem> |
| 302 |
<name> Root Square</name> |
| 303 |
<value>1</value> |
| 304 |
<stringvalue/> |
| 305 |
</bsbDropdownItem> |
| 306 |
<bsbDropdownItem> |
| 307 |
<name> Linear</name> |
| 308 |
<value>2</value> |
| 309 |
<stringvalue/> |
| 310 |
</bsbDropdownItem> |
| 311 |
</bsbDropdownItemList> |
| 312 |
<selectedIndex>2</selectedIndex> |
| 313 |
<randomizable group="0">false</randomizable> |
| 314 |
</bsbObject> |
| 315 |
<bsbObject version="2" type="BSBLabel"> |
| 316 |
<objectName/> |
| 317 |
<x>9</x> |
| 318 |
<y>179</y> |
| 319 |
<width>501</width> |
| 320 |
<height>110</height> |
| 321 |
<uuid>{cb746b47-8fae-4a67-a248-b3caaa7d4853}</uuid> |
| 322 |
<visible>true</visible> |
| 323 |
<midichan>0</midichan> |
| 324 |
<midicc>0</midicc> |
| 325 |
<label>-------------------------------------------------------------------------------------------------------------------------- |
| 326 |
The pan2 opcode provides a simple way to implement panning using one of three available methods. The method provided are equal power (harmonic), square root and linear. |
| 327 |
Source sound in this example is pink noise. |
| 328 |
</label> |
| 329 |
<alignment>left</alignment> |
| 330 |
<font>Liberation Sans</font> |
| 331 |
<fontsize>14</fontsize> |
| 332 |
<precision>3</precision> |
| 333 |
<color> |
| 334 |
<r>255</r> |
| 335 |
<g>255</g> |
| 336 |
<b>255</b> |
| 337 |
</color> |
| 338 |
<bgcolor mode="nobackground"> |
| 339 |
<r>255</r> |
| 340 |
<g>255</g> |
| 341 |
<b>255</b> |
| 342 |
</bgcolor> |
| 343 |
<bordermode>noborder</bordermode> |
| 344 |
<borderradius>1</borderradius> |
| 345 |
<borderwidth>1</borderwidth> |
| 346 |
</bsbObject> |
| 347 |
</bsbPanel> |
| 348 |
<bsbPresets> |
| 349 |
</bsbPresets> |
| 350 |
<EventPanel name="" tempo="60.00000000" loop="8.00000000" x="913" y="162" width="655" height="346" visible="true" loopStart="0" loopEnd="0"> </EventPanel> |