| 1 |
; Csound Haiku V |
| 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 |
gasendL init 0 |
| 18 |
gasendR init 0 |
| 19 |
|
| 20 |
instr start_sequences |
| 21 |
iBaseRate = random:i(1,2.5) |
| 22 |
indx = 0 |
| 23 |
while (indx < 4) do |
| 24 |
schedule("sound_instr",indx/4*iBaseRate,3600*24*7,iBaseRate,0.9,0.03,0.06,7,0.5,1) |
| 25 |
indx += 1 |
| 26 |
od |
| 27 |
ktrig1 = metro(iBaseRate/64) |
| 28 |
schedkwhennamed(ktrig1,0,0,"sound_instr",1/iBaseRate,64/iBaseRate,iBaseRate/16,0.996,0.003,0.01,3,0.7,1) |
| 29 |
schedkwhennamed(ktrig1,0,0,"sound_instr",2/iBaseRate,64/iBaseRate,iBaseRate/16,0.996,0.003,0.01,4,0.7,1) |
| 30 |
ktrig2 = metro(iBaseRate/72) |
| 31 |
schedkwhennamed(ktrig2,0,0,"sound_instr",3/iBaseRate,72/iBaseRate,iBaseRate/20,0.996,0.003,0.01,5,0.7,1) |
| 32 |
schedkwhennamed(ktrig2,0,0,"sound_instr",4/iBaseRate,72/iBaseRate,iBaseRate/20,0.996,0.003,0.01,6,0.7,1) |
| 33 |
endin |
| 34 |
schedule("start_sequences",0,-1) |
| 35 |
|
| 36 |
instr sound_instr |
| 37 |
if (metro(p4) == 1) then |
| 38 |
reinit PULSE |
| 39 |
endif |
| 40 |
PULSE: |
| 41 |
icps = cpsoct(random:i(7.3,10.5)) |
| 42 |
aptr = linseg:a(0,1/icps,1) |
| 43 |
rireturn |
| 44 |
a1 = tablei:a(aptr,gisine,1) |
| 45 |
kamp = rspline:k(0.2,0.7,0.1,0.8) |
| 46 |
a1 *= kamp^3 |
| 47 |
kphsoct = rspline:k(6,10,p6,p7) |
| 48 |
isep = random:i(0.5,0.75) |
| 49 |
ksep = transeg:k(isep+1,0.02,-50,isep) |
| 50 |
kfeedback = rspline:k(0.85,0.99,0.01,0.1) |
| 51 |
aphs2 = phaser2(a1,cpsoct(kphsoct),0.3,p8,p10,isep,p5) |
| 52 |
iChoRate = random:i(0.5,2) |
| 53 |
aDlyMod = oscili:a(0.0005,iChoRate,gisine) |
| 54 |
acho = vdelay3(aphs2+a1,(aDlyMod+0.0005+0.0001)*1000,100) |
| 55 |
aphs2 = sum(aphs2,acho) |
| 56 |
aphs2 = butlp(aphs2,1000) |
| 57 |
kenv = linseg:k(1,p3-4,1,4,0) |
| 58 |
kpan = rspline:k(0,1,0.1,0.8) |
| 59 |
kattrel = linsegr:k(1,1,0) |
| 60 |
a1,a2 pan2 aphs2*kenv*p9*kattrel,kpan |
| 61 |
a1 = delay(a1,rnd(0.01)+0.0001) |
| 62 |
a2 = delay(a2,rnd(0.01)+0.0001) |
| 63 |
ksend = rspline:k(0.2,0.7,0.05,0.1) ^ 2 |
| 64 |
out(a1*(1-ksend),a2*(1-ksend)) |
| 65 |
gasendL += a1*ksend |
| 66 |
gasendR += a2*ksend |
| 67 |
endin |
| 68 |
|
| 69 |
instr reverb |
| 70 |
aL,aR reverbsc gasendL,gasendR,0.85,5000 |
| 71 |
out(aL,aR) |
| 72 |
clear(gasendL,gasendR) |
| 73 |
endin |
| 74 |
schedule("reverb",0,-1) |
| 75 |
|
| 76 |
</CsInstruments> |
| 77 |
<CsScore> |
| 78 |
e 3600 |
| 79 |
</CsScore> |
| 80 |
</CsoundSynthesizer> |
| 81 |
<bsbPanel> |
| 82 |
<label>Widgets</label> |
| 83 |
<objectName/> |
| 84 |
<x>100</x> |
| 85 |
<y>100</y> |
| 86 |
<width>320</width> |
| 87 |
<height>240</height> |
| 88 |
<visible>true</visible> |
| 89 |
<uuid/> |
| 90 |
<bgcolor mode="background"> |
| 91 |
<r>240</r> |
| 92 |
<g>240</g> |
| 93 |
<b>240</b> |
| 94 |
</bgcolor> |
| 95 |
</bsbPanel> |
| 96 |
<bsbPresets> |
| 97 |
</bsbPresets> |