| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-odac --env:SSDIR+=../../SourceMaterials |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 32 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
opcode FilePlay, a, SKoo |
| 12 |
;gives mono output (if file is stereo, just the first channel is used) |
| 13 |
Sfil, kspeed, iskip, iloop xin |
| 14 |
if filenchnls(Sfil) == 1 then |
| 15 |
aout diskin Sfil, kspeed, iskip, iloop |
| 16 |
else |
| 17 |
aout, a0 diskin Sfil, kspeed, iskip, iloop |
| 18 |
endif |
| 19 |
xout aout |
| 20 |
endop |
| 21 |
|
| 22 |
opcode FilePlay, aa, SKoo |
| 23 |
;gives stereo output (if file is mono, the channel is duplicated) |
| 24 |
Sfil, kspeed, iskip, iloop xin |
| 25 |
ichn filenchnls Sfil |
| 26 |
if filenchnls(Sfil) == 1 then |
| 27 |
aL diskin Sfil, kspeed, iskip, iloop |
| 28 |
aR = aL |
| 29 |
else |
| 30 |
aL, aR diskin Sfil, kspeed, iskip, iloop |
| 31 |
endif |
| 32 |
xout aL, aR |
| 33 |
endop |
| 34 |
|
| 35 |
instr 1 |
| 36 |
aMono FilePlay "fox.wav", 1 |
| 37 |
outs aMono, aMono |
| 38 |
endin |
| 39 |
|
| 40 |
instr 2 |
| 41 |
aL, aR FilePlay "fox.wav", 1 |
| 42 |
outs aL, aR |
| 43 |
endin |
| 44 |
|
| 45 |
</CsInstruments> |
| 46 |
<CsScore> |
| 47 |
i 1 0 4 |
| 48 |
i 2 4 4 |
| 49 |
</CsScore> |
| 50 |
</CsoundSynthesizer> |
| 51 |
;example by joachim heintz |