| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-odac -m128 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
nchnls = 2 |
| 8 |
0dbfs = 1 |
| 9 |
ksmps = 32 |
| 10 |
seed 0 |
| 11 |
|
| 12 |
giArr[] fillarray 60, 68, 67, 66, 65, 64, 63 |
| 13 |
|
| 14 |
instr 1 |
| 15 |
iMidiNote = p4 |
| 16 |
iFreq mtof iMidiNote |
| 17 |
aPluck pluck .1, iFreq, iFreq, 0, 1 |
| 18 |
aOut linenr aPluck, 0, 1, .01 |
| 19 |
out aOut, aOut |
| 20 |
endin |
| 21 |
|
| 22 |
instr Trigger |
| 23 |
index = 0 |
| 24 |
while index < lenarray(giArr) do |
| 25 |
iInstrNum = nstrnum("Play")+index/10 |
| 26 |
schedule(iInstrNum,index+random:i(0,.5),5) |
| 27 |
index += 1 |
| 28 |
od |
| 29 |
endin |
| 30 |
|
| 31 |
instr Play |
| 32 |
iIndx = frac(p1)*10 //index is fractional part of instr number |
| 33 |
iFreq = mtof:i(giArr[round(iIndx)]) |
| 34 |
aPluck pluck .1, iFreq, iFreq, 0, 1 |
| 35 |
aOut linenr aPluck, 0, 1, .01 |
| 36 |
out aOut, aOut |
| 37 |
endin |
| 38 |
|
| 39 |
</CsInstruments> |
| 40 |
<CsScore> |
| 41 |
//traditional score |
| 42 |
t 0 90 |
| 43 |
i 1.0 0 -1 60 |
| 44 |
i 1.1 1 -1 65 |
| 45 |
i 1.2 2 -1 55 |
| 46 |
i 1.3 3 -1 70 |
| 47 |
i 1.4 4 -1 50 |
| 48 |
i 1.5 5 -1 75 |
| 49 |
|
| 50 |
i -1.4 7 1 0 |
| 51 |
i -1.1 8 1 0 |
| 52 |
i -1.5 9 1 0 |
| 53 |
i -1.0 10 1 0 |
| 54 |
i -1.3 11 1 0 |
| 55 |
i -1.2 12 1 0 |
| 56 |
|
| 57 |
//event generating instrument |
| 58 |
i "Trigger" 15 10 |
| 59 |
</CsScore> |
| 60 |
</CsoundSynthesizer> |
| 61 |
;example by joachim heintz |