| 1 |
; Csound Haiku III |
| 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 |
giImpulseWave = ftgen(0,0,4097,10,1,1/2,1/4,1/8) |
| 17 |
gitims = ftgen(0,0,128,-7,1,100,0.1) |
| 18 |
gamixL,gamixR,gasendL,gasendR init 0 |
| 19 |
|
| 20 |
instr start_sequences |
| 21 |
krate = rspline:k(0,1,0.1,2) |
| 22 |
krate = scale(krate^2,10,0.3) |
| 23 |
koct = rspline:k(4.3,9.5,0.1,1) |
| 24 |
kcps = cpsoct(koct) |
| 25 |
kpan = rspline:k(0.1,4,0.1,1) |
| 26 |
kamp = rspline:k(0.1,1,0.25,2) |
| 27 |
kwgoct1 = rspline:k(6,9,0.05,1) |
| 28 |
kwgoct2 = rspline:k(6,9,0.05,1) |
| 29 |
schedkwhennamed(metro(krate),0,0,"wguide2_note",0,4,kcps,kwgoct1,kwgoct2,kamp,kpan) |
| 30 |
endin |
| 31 |
schedule("start_sequences",0,-1) |
| 32 |
|
| 33 |
instr wguide2_note |
| 34 |
aenv = expon:a(1,10/p4,0.001) |
| 35 |
aimpulse = poscil:a(aenv-0.001,p4,giImpulseWave) |
| 36 |
ioct1 = random:i(5,11) |
| 37 |
ioct2 = random:i(5,11) |
| 38 |
aplk1 = transeg:a(1+rnd(0.2),0.1,-15,1) |
| 39 |
aplk2 = transeg:a(1+rnd(0.2),0.1,-15,1) |
| 40 |
idmptim = random:i(0.1,3) |
| 41 |
kcutoff = expseg:k(20000,p3-idmptim,20000,idmptim,200,1,200) |
| 42 |
awg2 = wguide2(aimpulse,cpsoct(p5)*aplk1,cpsoct(p6)*aplk2,kcutoff,kcutoff,0.27,0.23) |
| 43 |
awg2 = dcblock2(awg2) |
| 44 |
arel = linseg:a(1,p3-idmptim,1,idmptim,0) |
| 45 |
awg2 *= arel |
| 46 |
awg2 /= rnd(4)+3 |
| 47 |
aL,aR pan2 awg2,p8 |
| 48 |
gasendL += aL*0.05 |
| 49 |
gasendR += aR*0.05 |
| 50 |
gamixL += aL |
| 51 |
gamixR += aR |
| 52 |
endin |
| 53 |
|
| 54 |
instr spatialise |
| 55 |
adlytim1 = rspline:a(0.1,5,0.1,0.4) |
| 56 |
adlytim2 = rspline:a(0.1,5,0.1,0.4) |
| 57 |
aL = vdelay(gamixL,adlytim1,50) |
| 58 |
aR = vdelay(gamixR,adlytim2,50) |
| 59 |
out(aL,aR) |
| 60 |
gasendL += aL*0.05 |
| 61 |
gasendR += aR*0.05 |
| 62 |
clear(gamixL,gamixR) |
| 63 |
endin |
| 64 |
schedule("spatialise",0,-1) |
| 65 |
|
| 66 |
instr reverb |
| 67 |
aL,aR reverbsc gasendL,gasendR,0.95,10000 |
| 68 |
out(aL,aR) |
| 69 |
clear(gasendL,gasendR) |
| 70 |
endin |
| 71 |
schedule("reverb",0,-1) |
| 72 |
|
| 73 |
</CsInstruments> |
| 74 |
<CsScore> |
| 75 |
e 3600 |
| 76 |
</CsScore> |
| 77 |
</CsoundSynthesizer> |
| 78 |
<bsbPanel> |
| 79 |
<label>Widgets</label> |
| 80 |
<objectName/> |
| 81 |
<x>100</x> |
| 82 |
<y>100</y> |
| 83 |
<width>320</width> |
| 84 |
<height>240</height> |
| 85 |
<visible>true</visible> |
| 86 |
<uuid/> |
| 87 |
<bgcolor mode="background"> |
| 88 |
<r>240</r> |
| 89 |
<g>240</g> |
| 90 |
<b>240</b> |
| 91 |
</bgcolor> |
| 92 |
</bsbPanel> |
| 93 |
<bsbPresets> |
| 94 |
</bsbPresets> |