| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
;csound -R -W -s -o Xanadu.wav temp.orc temp.sco |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 1 |
| 8 |
nchnls = 2 |
| 9 |
;-------------------------------------------------------- |
| 10 |
;Instrument 1 : plucked strings chorused left/right and |
| 11 |
; pitch-shifted and delayed taps thru exponential |
| 12 |
; functions, and delayed. |
| 13 |
;-------------------------------------------------------- |
| 14 |
|
| 15 |
instr 1 |
| 16 |
ishift = .00666667 ;shift it 8/1200. |
| 17 |
ipch = cpspch(p5) ;convert parameter 5 to cps. |
| 18 |
ioct = octpch(p5) ;convert parameter 5 to oct. |
| 19 |
kvib oscil 1/120, ipch/50, 1 ;vibrato |
| 20 |
ag pluck 2000, cpsoct(ioct+kvib), 1000, 1, 1 |
| 21 |
agleft pluck 2000, cpsoct(ioct+ishift), 1000, 1, 1 |
| 22 |
agright pluck 2000, cpsoct(ioct-ishift), 1000, 1, 1 |
| 23 |
kf1 expon .1, p3, 1.0 ;exponential from 0.1 to 1.0 |
| 24 |
kf2 expon 1.0, p3, .1 ;exponential from 1.0 to 0.1 |
| 25 |
adump delayr 2.0 ;set delay line of 2.0 sec |
| 26 |
atap1 deltapi kf1 ;tap delay line with kf1 func. |
| 27 |
atap2 deltapi kf2 ;tap delay line with kf2 func. |
| 28 |
ad1 deltap 2.0 ;delay 2 sec. |
| 29 |
ad2 deltap 1.1 ;delay 1.1 sec. |
| 30 |
delayw ag ;put ag signal into delay line. |
| 31 |
outs agleft+atap1+ad1, agright+atap2+ad2 |
| 32 |
endin |
| 33 |
;------------------------------------------------------------- |
| 34 |
;Instrument 2 : plucked strings chorused left/right and |
| 35 |
; pitch-shifted with fixed delayed taps. |
| 36 |
;------------------------------------------------------------ |
| 37 |
|
| 38 |
instr 2 |
| 39 |
ishift = .00666667 ;shift it 8/1200. |
| 40 |
ipch = cpspch(p5) ;convert parameter 5 to cps. |
| 41 |
ioct = octpch(p5) ;convert parameter 5 to oct. |
| 42 |
kvib oscil 1/120, ipch/50, 1 ;vibrato |
| 43 |
ag pluck 1000, cpsoct(ioct+kvib), 1000, 1, 1 |
| 44 |
agleft pluck 1000, cpsoct(ioct+ishift), 1000, 1, 1 |
| 45 |
agright pluck 1000, cpsoct(ioct-ishift), 1000, 1, 1 |
| 46 |
adump delayr 0.3 ;set delay line of 0.3 sec |
| 47 |
ad1 deltap 0.1 ;delay 100 msec. |
| 48 |
ad2 deltap 0.2 ;delay 200 msec. |
| 49 |
delayw ag ;put ag sign into del line. |
| 50 |
outs agleft+ad1, agright+ad2 |
| 51 |
endin |
| 52 |
;----------------------------------------------------------- |
| 53 |
;Instrument 3 : New FM algorithm, modified to produce large timbre |
| 54 |
; shifts using modulation of I and r. Detuned chorusing employed. |
| 55 |
;----------------------------------------------------------- |
| 56 |
instr 3 |
| 57 |
ishift = .00666667 ;shift it 8/1200. |
| 58 |
ipch = cpspch(p5) ;convert parameter 5 to cps. |
| 59 |
ioct = octpch(p5) ;convert parameter 5 to oct. |
| 60 |
kadsr linseg 0, p3/3, 1.0, p3/3, 1.0, p3/3, 0 ;ADSR envelope |
| 61 |
kmodi linseg 0, p3/3, 5, p3/3, 3, p3/3, 0 ;ADSR envelope for I |
| 62 |
kmodr linseg p6, p3, p7 ;r moves from p6->p7 in p3 sec. |
| 63 |
a1 = kmodi*(kmodr-1/kmodr)/2 |
| 64 |
a1ndx = abs(a1*2/20) ;a1*2 is normalized from 0-1. |
| 65 |
a2 = kmodi*(kmodr+1/kmodr)/2 |
| 66 |
a3 tablei a1ndx, 3, 1 ;lookup tbl in f3, normal index |
| 67 |
ao1 oscil a1, ipch, 2 ;cosine |
| 68 |
a4 = exp(-0.5*a3+ao1) |
| 69 |
ao2 oscil a2*ipch, ipch, 2 ;cosine |
| 70 |
aoutl oscil 1000*kadsr*a4, ao2+cpsoct(ioct+ishift), 1 ;fnl outleft |
| 71 |
aoutr oscil 1000*kadsr*a4, ao2+cpsoct(ioct-ishift), 1 ;fnl outright |
| 72 |
outs aoutl, aoutr |
| 73 |
endin |
| 74 |
|
| 75 |
</CsInstruments> |
| 76 |
<CsScore> |
| 77 |
; Score for final project in Digital Audio Processing |
| 78 |
; --------------------------------------------------- |
| 79 |
|
| 80 |
; Piece entitled : X A N A D U (short version) |
| 81 |
; Joseph T. Kung, 12/12/88 |
| 82 |
|
| 83 |
; The first part of the score will specify all function |
| 84 |
; tables used in the piece. The second part specifies |
| 85 |
; the instruments and notes. The latter is divided into |
| 86 |
; 7 sections, each playing a chord on a different |
| 87 |
; instrument. |
| 88 |
; The chords are uncommon guitar chords that use the open |
| 89 |
; B and E strings often. These will be transposed by |
| 90 |
; octaves on some chords. |
| 91 |
|
| 92 |
; Each instrument will play a chord for 15 seconds. The |
| 93 |
; timbre |
| 94 |
; of the instrument will change in that interval and join |
| 95 |
; with the next instrument/chord sequence. Instrument 3 |
| 96 |
; uses a modified FM synthesis technique. This is joined |
| 97 |
; by an additional plucked-string instrument |
| 98 |
; (instruments 1 and 2). |
| 99 |
|
| 100 |
; The Function Tables |
| 101 |
; ------------------- |
| 102 |
;All functions are post-normalized (max value is 1) if p4 is |
| 103 |
;POSITIVE. |
| 104 |
|
| 105 |
f1 0 8192 10 1 ;sine wave |
| 106 |
f2 0 8192 11 1 ;cosine wave |
| 107 |
f3 0 8192 -12 20.0 ;unscaled ln(I(x)) from 0 to 20.0 |
| 108 |
|
| 109 |
;----------------------------------------------------------- |
| 110 |
|
| 111 |
;----- This section comprises all the new FM sounds ----------- |
| 112 |
|
| 113 |
;F#7addB chord on a guitar |
| 114 |
i3 0 15 0 7.06 2.0 0.2 ;F# |
| 115 |
i3 . . . 8.01 . . ;C# above |
| 116 |
i3 . . . 8.06 . . ;F# octave above 1st one |
| 117 |
i3 . . . 8.10 . . ;Bb next one up |
| 118 |
i3 . . . 8.11 . . ;B |
| 119 |
i3 . . . 9.04 . . ;E |
| 120 |
|
| 121 |
;D6add9 chord on a guitar |
| 122 |
i3 7.5 15 0 6.02 1.7 0.5 ;D |
| 123 |
i3 . . . 6.09 . . ;A above |
| 124 |
i3 . . . 7.02 . . ;D octave above 1st one |
| 125 |
i3 . . . 7.06 . . ;F# next one up |
| 126 |
i3 . . . 6.11 . . ;B |
| 127 |
i3 . . . 7.04 . . ;E |
| 128 |
|
| 129 |
;Bmajadd11 chord on a guitar |
| 130 |
i3 15 15 0 7.11 1.4 0.8 ;B |
| 131 |
i3 . . . 8.06 . . ;F# above |
| 132 |
i3 . . . 8.11 . . ;B octave above 1st one |
| 133 |
i3 . . . 9.03 . . ;D# next one up |
| 134 |
i3 . . . 8.11 . . ;B |
| 135 |
i3 . . . 9.04 . . ;E; |
| 136 |
|
| 137 |
;Amajadd9 chord on a guitar |
| 138 |
i3 22.5 15 0 6.09 1.1 1.1 ;A |
| 139 |
i3 . . . 7.04 . . ;E above |
| 140 |
i3 . . . 8.09 . . ;A octave above 1st one |
| 141 |
i3 . . . 8.01 . . ;C# next one up |
| 142 |
i3 . . . 7.11 . . ;B |
| 143 |
i3 . . . 8.04 . . ;E |
| 144 |
|
| 145 |
;Bmajadd11 chord on a guitar |
| 146 |
i3 30 15 0 6.11 0.8 1.4 ;B |
| 147 |
i3 . . . 7.06 . . ;F# above |
| 148 |
i3 . . . 7.11 . . ;B octave above 1st one |
| 149 |
i3 . . . 8.03 . . ;D# next one up |
| 150 |
i3 . . . 7.11 . . ;B |
| 151 |
i3 . . . 8.04 . . ;E; |
| 152 |
|
| 153 |
;Gmaj6 chord on a guitar |
| 154 |
i3 37.5 15 0 5.07 0.5 1.7 ;G |
| 155 |
i3 . . . 6.02 . . ;D above |
| 156 |
i3 . . . 6.07 . . ;G octave above 1st one |
| 157 |
i3 . . . 6.11 . . ;B on G string |
| 158 |
i3 . . . 6.11 . . ;B |
| 159 |
i3 . . . 7.04 . . ;E |
| 160 |
|
| 161 |
;F#7addB chord on a guitar |
| 162 |
i3 45 15 0 7.06 0.2 2.0 ;F# |
| 163 |
i3 . . . 8.01 . . ;C# above |
| 164 |
i3 . . . 8.06 . . ;F# octave above 1st one |
| 165 |
i3 . . . 8.10 . . ;Bb next one up |
| 166 |
i3 . . . 8.11 . . ;B |
| 167 |
i3 . . . 9.04 . . ;E |
| 168 |
|
| 169 |
; This section adds the plucked chords to the beginning of each |
| 170 |
; section. |
| 171 |
|
| 172 |
;F#7addB chord on a guitar |
| 173 |
i1 0 10 0 8.06 ;F# |
| 174 |
i1 0.1 . . 9.01 ;C# above |
| 175 |
i1 0.2 . . 9.06 ;F# octave above 1st one |
| 176 |
i1 0.3 . . 9.10 ;Bb next one up |
| 177 |
i1 0.4 . . 9.11 ;B |
| 178 |
i1 0.5 . . 10.04 ;E |
| 179 |
|
| 180 |
;D6add9 chord on a guitar |
| 181 |
i2 7.5 10 0 8.02 ;D |
| 182 |
i2 7.6 . . 8.09 ;A above |
| 183 |
i2 7.7 . . 9.02 ;D octave above 1st one |
| 184 |
i2 7.8 . . 9.06 ;F# next one up |
| 185 |
i2 7.9 . . 9.11 ;B |
| 186 |
i2 8.0 . . 10.04 ;E |
| 187 |
|
| 188 |
;Bmajadd11 chord on a guitar |
| 189 |
i2 15 10 0 8.11 ;B |
| 190 |
i2 15.1 . . 9.06 ;F# above |
| 191 |
i2 15.2 . . 9.11 ;B octave above 1st one |
| 192 |
i2 15.3 . . 10.03 ;D# next one up |
| 193 |
i2 15.4 . . 9.11 ;B |
| 194 |
i2 15.5 . . 10.04 ;E; |
| 195 |
|
| 196 |
;Amajadd9 chord on a guitar |
| 197 |
i2 22.5 10 0 8.09 ;A |
| 198 |
i2 22.6 . . 9.04 ;E above |
| 199 |
i2 22.7 . . 10.09 ;A octave above 1st one |
| 200 |
i2 22.8 . . 10.01 ;C# next one up |
| 201 |
i2 22.9 . . 9.11 ;B |
| 202 |
i2 23.0 . . 10.04 ;E |
| 203 |
|
| 204 |
;Bmajadd11 chord on a guitar |
| 205 |
i2 30 10 0 8.11 ;B |
| 206 |
i2 30.1 . . 9.06 ;F# above |
| 207 |
i2 30.2 . . 9.11 ;B octave above 1st one |
| 208 |
i2 30.3 . . 10.03 ;D# next one up |
| 209 |
i2 30.4 . . 9.11 ;B |
| 210 |
i2 30.5 . . 10.04 ;E; |
| 211 |
|
| 212 |
;Gmaj6 chord on a guitar |
| 213 |
i2 37.5 10 0 8.07 ;G |
| 214 |
i2 37.6 . . 9.02 ;D above |
| 215 |
i2 37.7 . . 9.07 ;G octave above 1st one |
| 216 |
i2 37.8 . . 9.11 ;B on G string |
| 217 |
i2 37.9 . . 9.11 ;B |
| 218 |
i2 38.0 . . 10.04 ;E |
| 219 |
|
| 220 |
;F#7addB chord on a guitar |
| 221 |
i1 45 10 0 9.06 ;F# |
| 222 |
i1 45.1 . . 10.01 ;C# above |
| 223 |
i1 45.2 . . 10.06 ;F# octave above 1st one |
| 224 |
i1 45.3 . . 10.10 ;Bb next one up |
| 225 |
i1 45.4 . . 10.11 ;B |
| 226 |
i1 45.5 . . 11.04 ;E |
| 227 |
e |
| 228 |
|
| 229 |
</CsScore> |
| 230 |
</CsoundSynthesizer> |
| 231 |
<bsbPanel> |
| 232 |
<label>Widgets</label> |
| 233 |
<objectName/> |
| 234 |
<x>391</x> |
| 235 |
<y>132</y> |
| 236 |
<width>454</width> |
| 237 |
<height>477</height> |
| 238 |
<visible>true</visible> |
| 239 |
<uuid/> |
| 240 |
<bgcolor mode="nobackground"> |
| 241 |
<r>230</r> |
| 242 |
<g>221</g> |
| 243 |
<b>213</b> |
| 244 |
</bgcolor> |
| 245 |
<bsbObject type="BSBLabel" version="2"> |
| 246 |
<objectName/> |
| 247 |
<x>5</x> |
| 248 |
<y>5</y> |
| 249 |
<width>431</width> |
| 250 |
<height>381</height> |
| 251 |
<uuid>{4db41777-5f89-4859-b4bd-8cbf0be5c649}</uuid> |
| 252 |
<visible>true</visible> |
| 253 |
<midichan>0</midichan> |
| 254 |
<midicc>-3</midicc> |
| 255 |
<description/> |
| 256 |
<label>; Score for final project in Digital Audio Processing |
| 257 |
; --------------------------------------------------- |
| 258 |
|
| 259 |
; Piece entitled : X A N A D U (short version) |
| 260 |
; Joseph T. Kung, 12/12/88 |
| 261 |
|
| 262 |
; The first part of the score will specify all function |
| 263 |
; tables used in the piece. The second part specifies |
| 264 |
; the instruments and notes. The latter is divided into |
| 265 |
; 7 sections, each playing a chord on a different |
| 266 |
; instrument. |
| 267 |
; The chords are uncommon guitar chords that use the open |
| 268 |
; B and E strings often. These will be transposed by |
| 269 |
; octaves on some chords. |
| 270 |
|
| 271 |
; Each instrument will play a chord for 15 seconds. The |
| 272 |
; timbre |
| 273 |
; of the instrument will change in that interval and join |
| 274 |
; with the next instrument/chord sequence. Instrument 3 |
| 275 |
; uses a modified FM synthesis technique. This is joined |
| 276 |
; by an additional plucked-string instrument |
| 277 |
; (instruments 1 and 2).</label> |
| 278 |
<alignment>left</alignment> |
| 279 |
<valignment>top</valignment> |
| 280 |
<font>DejaVu Sans</font> |
| 281 |
<fontsize>14</fontsize> |
| 282 |
<precision>3</precision> |
| 283 |
<color> |
| 284 |
<r>0</r> |
| 285 |
<g>0</g> |
| 286 |
<b>0</b> |
| 287 |
</color> |
| 288 |
<bgcolor mode="background"> |
| 289 |
<r>255</r> |
| 290 |
<g>255</g> |
| 291 |
<b>255</b> |
| 292 |
</bgcolor> |
| 293 |
<bordermode>border</bordermode> |
| 294 |
<borderradius>5</borderradius> |
| 295 |
<borderwidth>4</borderwidth> |
| 296 |
</bsbObject> |
| 297 |
<bsbObject type="BSBButton" version="2"> |
| 298 |
<objectName>_Play</objectName> |
| 299 |
<x>108</x> |
| 300 |
<y>401</y> |
| 301 |
<width>100</width> |
| 302 |
<height>30</height> |
| 303 |
<uuid>{192c01d7-a5de-4662-b202-1603730eb47c}</uuid> |
| 304 |
<visible>true</visible> |
| 305 |
<midichan>0</midichan> |
| 306 |
<midicc>0</midicc> |
| 307 |
<description/> |
| 308 |
<type>value</type> |
| 309 |
<pressedValue>1.00000000</pressedValue> |
| 310 |
<stringvalue/> |
| 311 |
<text>Start</text> |
| 312 |
<image>/</image> |
| 313 |
<eventLine>i1 0 10</eventLine> |
| 314 |
<latch>false</latch> |
| 315 |
<latched>false</latched> |
| 316 |
<fontsize>10</fontsize> |
| 317 |
</bsbObject> |
| 318 |
<bsbObject type="BSBButton" version="2"> |
| 319 |
<objectName>_Pause</objectName> |
| 320 |
<x>228</x> |
| 321 |
<y>401</y> |
| 322 |
<width>158</width> |
| 323 |
<height>32</height> |
| 324 |
<uuid>{c4002dba-d687-4354-b91a-67822e7777c7}</uuid> |
| 325 |
<visible>true</visible> |
| 326 |
<midichan>0</midichan> |
| 327 |
<midicc>0</midicc> |
| 328 |
<description/> |
| 329 |
<type>value</type> |
| 330 |
<pressedValue>1.00000000</pressedValue> |
| 331 |
<stringvalue/> |
| 332 |
<text>Pause/Resume</text> |
| 333 |
<image>/</image> |
| 334 |
<eventLine>i1 0 10</eventLine> |
| 335 |
<latch>false</latch> |
| 336 |
<latched>false</latched> |
| 337 |
<fontsize>10</fontsize> |
| 338 |
</bsbObject> |
| 339 |
</bsbPanel> |
| 340 |
<bsbPresets> |
| 341 |
</bsbPresets> |