| 1 |
;Csound Haiku - IV |
| 2 |
;Iain McCurdy, 2011. |
| 3 |
|
| 4 |
<CsoundSynthesizer> |
| 5 |
<CsOptions> |
| 6 |
-odac |
| 7 |
</CsOptions> |
| 8 |
<CsInstruments> |
| 9 |
|
| 10 |
sr = 44100 |
| 11 |
ksmps = 32 |
| 12 |
nchnls = 2 |
| 13 |
0dbfs = 1 |
| 14 |
|
| 15 |
gisine ftgen 0, 0, 4096, 10, 1 |
| 16 |
gioctfn ftgen 0, 0, 4096, -19, 1, 0.5, 270, 0.5 |
| 17 |
gasendL init 0 |
| 18 |
gasendR init 0 |
| 19 |
ginotes ftgen 0, 0, -100, -17, 0, 8.00, 10, 8.03, 15, 8.04, 25, 8.05, 50, 8.07, 60, 8.08, 73, 8.09, 82, 8.11 |
| 20 |
|
| 21 |
seed 0 |
| 22 |
|
| 23 |
instr trigger_notes |
| 24 |
krate rspline 0.04, 0.15, 0.05, 0.1 |
| 25 |
ktrig metro krate |
| 26 |
gktrans init 0 |
| 27 |
gktrans trandom ktrig,-1, 1 |
| 28 |
gktrans = semitone(gktrans) |
| 29 |
idur = 15 |
| 30 |
schedkwhen ktrig, 0, 0, "hboscil_note", rnd(2), idur |
| 31 |
schedkwhen ktrig, 0, 0, "hboscil_note", rnd(2), idur |
| 32 |
schedkwhen ktrig, 0, 0, "hboscil_note", rnd(2), idur |
| 33 |
schedkwhen ktrig, 0, 0, "hboscil_note", rnd(2), idur |
| 34 |
endin |
| 35 |
|
| 36 |
instr hboscil_note |
| 37 |
ipch table int(rnd(100)),ginotes |
| 38 |
icps = cpspch(ipch)*i(gktrans)*semitone(rnd(0.5)-0.25) |
| 39 |
kamp expseg 0.001,0.02,0.2,p3-0.01,0.001 |
| 40 |
ktonemoddep jspline 0.01,0.05,0.2 |
| 41 |
ktonemodrte jspline 6,0.1,0.2 |
| 42 |
ktone oscil ktonemoddep,ktonemodrte,gisine |
| 43 |
kbrite rspline -2,3,0.0002,3 |
| 44 |
ibasfreq init icps |
| 45 |
ioctcnt init 2 |
| 46 |
iphs init 0 |
| 47 |
a1 hsboscil kamp, ktone, kbrite, ibasfreq, gisine, gioctfn, ioctcnt, iphs |
| 48 |
amod oscil 1, ibasfreq*3.47, gisine |
| 49 |
arm = a1*amod |
| 50 |
kmix expseg 0.001, 0.01, rnd(1), rnd(3)+0.3, 0.001 |
| 51 |
a1 ntrpol a1, arm, kmix |
| 52 |
a1 pareq a1/10, 400, 15, .707 |
| 53 |
a1 tone a1, 500 |
| 54 |
kpanrte jspline 5, 0.05, 0.1 |
| 55 |
kpandep jspline 0.9, 0.2, 0.4 |
| 56 |
kpan oscil kpandep, kpanrte, gisine |
| 57 |
a1,a2 pan2 a1, kpan |
| 58 |
a1 delay a1, rnd(0.1) |
| 59 |
a2 delay a2, rnd(0.1) |
| 60 |
kenv linsegr 1, 1, 0 |
| 61 |
a1 = a1*kenv |
| 62 |
a2 = a2*kenv |
| 63 |
outs a1, a2 |
| 64 |
gasendL = gasendL+a1/5 |
| 65 |
gasendR = gasendR+a2/5 |
| 66 |
endin |
| 67 |
|
| 68 |
instr reverb |
| 69 |
aL, aR reverbsc gasendL, gasendR, 0.9, 10000 |
| 70 |
outs aL, aR |
| 71 |
clear gasendL, gasendR |
| 72 |
endin |
| 73 |
|
| 74 |
</CsInstruments> |
| 75 |
<CsScore> |
| 76 |
f 0 3600 |
| 77 |
i "trigger_notes" 0 3600 |
| 78 |
i "reverb" 0 3600 |
| 79 |
|
| 80 |
e |
| 81 |
</CsScore> |
| 82 |
</CsoundSynthesizer> |