| 1 |
; Csound Haiku IV |
| 2 |
; Iain McCurdy 2011 |
| 3 |
; small code modifcations by joachim heintz 2024 |
| 4 |
|
| 5 |
<CsoundSynthesizer> |
| 6 |
<CsOptions> |
| 7 |
-odac -m128 |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
sr = 44100 |
| 11 |
ksmps = 32 |
| 12 |
nchnls = 2 |
| 13 |
0dbfs = 1 |
| 14 |
seed 0 |
| 15 |
|
| 16 |
gisine = ftgen(0,0,4096,10,1) |
| 17 |
gioctfn = ftgen(0,0,4096,-19,1,0.5,270,0.5) |
| 18 |
gasendL,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 |
instr trigger_notes |
| 22 |
ktrig = metro(rspline:k(0.05,0.12,0.05,0.1)) |
| 23 |
gktrans = semitone(trandom(ktrig,-1,1)) |
| 24 |
idur = 15 |
| 25 |
schedkwhen(ktrig,0,0,"hboscil_note",rnd(2),idur) |
| 26 |
schedkwhen(ktrig,0,0,"hboscil_note",rnd(2),idur) |
| 27 |
schedkwhen(ktrig,0,0,"hboscil_note",rnd(2),idur) |
| 28 |
schedkwhen(ktrig,0,0,"hboscil_note",rnd(2),idur) |
| 29 |
endin |
| 30 |
schedule("trigger_notes",0,-1) |
| 31 |
|
| 32 |
instr hboscil_note |
| 33 |
ipch = table:i(int(rnd(100)),ginotes) |
| 34 |
icps = cpspch(ipch)*i(gktrans)*semitone(rnd(0.5)-0.25) |
| 35 |
kamp = expseg:k(0.001,0.02,0.2,p3-0.01,0.001) |
| 36 |
ktonemoddep = jspline:k(0.01,0.05,0.2) |
| 37 |
ktonemodrte = jspline:k(6,0.1,0.2) |
| 38 |
ktone = oscil:a(ktonemoddep,ktonemodrte,gisine) |
| 39 |
kbrite = rspline:k(-2,3,0.0002,3) |
| 40 |
ibasfreq init icps |
| 41 |
ioctcnt init 2 |
| 42 |
iphs init 0 |
| 43 |
a1 = hsboscil:a(kamp,ktone,kbrite,ibasfreq,gisine,gioctfn,ioctcnt,iphs) |
| 44 |
amod = oscil:a(1,ibasfreq*3.47,gisine) |
| 45 |
arm = a1*amod |
| 46 |
kmix = expseg:k(0.001,0.01,rnd(1),rnd(3)+0.3,0.001) |
| 47 |
a1 = ntrpol:a(a1,arm,kmix) |
| 48 |
a1 = pareq:a(a1/10,400,15,0.707) |
| 49 |
a1 = tone(a1,500) |
| 50 |
kpanrte = jspline:k(5,0.05,0.1) |
| 51 |
kpandep = jspline:k(0.9,0.2,0.4) |
| 52 |
kpan = oscil:k(kpandep,kpanrte,gisine) |
| 53 |
a1,a2 pan2 a1,kpan |
| 54 |
a1 = delay(a1,rnd(0.1)) |
| 55 |
a2 = delay(a2,rnd(0.1)) |
| 56 |
kenv = linsegr:k(1,1,0) |
| 57 |
a1 *= kenv |
| 58 |
a2 *= kenv |
| 59 |
out(a1,a2) |
| 60 |
gasendL += a1/6 |
| 61 |
gasendR += a2/6 |
| 62 |
endin |
| 63 |
|
| 64 |
instr reverb |
| 65 |
aL,aR reverbsc gasendL,gasendR,0.95,10000 |
| 66 |
out(aL,aR) |
| 67 |
clear(gasendL,gasendR) |
| 68 |
endin |
| 69 |
schedule("reverb",0,-1) |
| 70 |
|
| 71 |
</CsInstruments> |
| 72 |
<CsScore> |
| 73 |
</CsScore> |
| 74 |
</CsoundSynthesizer> |
| 75 |
<bsbPanel> |
| 76 |
<label>Widgets</label> |
| 77 |
<objectName/> |
| 78 |
<x>100</x> |
| 79 |
<y>100</y> |
| 80 |
<width>320</width> |
| 81 |
<height>240</height> |
| 82 |
<visible>true</visible> |
| 83 |
<uuid/> |
| 84 |
<bgcolor mode="background"> |
| 85 |
<r>240</r> |
| 86 |
<g>240</g> |
| 87 |
<b>240</b> |
| 88 |
</bgcolor> |
| 89 |
</bsbPanel> |
| 90 |
<bsbPresets> |
| 91 |
</bsbPresets> |