| 1 |
; Csound Haiku I |
| 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 |
gicos = ftgen(0,0,131072,11,1) |
| 17 |
gasendL,gasendR init 0 |
| 18 |
|
| 19 |
indx = 0 |
| 20 |
while (indx < 6) do |
| 21 |
schedule("trombone",indx,99999) |
| 22 |
indx += 1 |
| 23 |
od |
| 24 |
|
| 25 |
instr trombone |
| 26 |
inote = random:i(54,66) |
| 27 |
knote init int(inote) |
| 28 |
if (metro(0.015) == 1) then |
| 29 |
reinit retrig |
| 30 |
endif |
| 31 |
retrig: |
| 32 |
inote1 init i(knote) |
| 33 |
inote2 = random:i(54,66) |
| 34 |
inote2 = int(inote2) |
| 35 |
inotemid = inote1 + (inote2-inote1)/2 |
| 36 |
idur = random:i(22.5,27.5) |
| 37 |
timout(0,idur,skip) |
| 38 |
knote = transeg:k(inote1,idur/2,2,inotemid,idur/2,-2,inote2) |
| 39 |
skip: rireturn |
| 40 |
kenv = linseg:k(0,25,0.05,p3-50,0.05,25,0) |
| 41 |
kdtn = jspline:k(0.05,0.4,0.8) |
| 42 |
kmul = rspline:k(0.3,0.82,0.04,0.2) |
| 43 |
kamp = rspline:k(0.02,3,0.05,0.1) |
| 44 |
a1 = gbuzz(kenv*kamp,mtof:k(knote)*semitone(kdtn),75,1,kmul^1.75,gicos) |
| 45 |
kpan = rspline:k(0,1,0.1,1) |
| 46 |
a1,a2 pan2 a1,kpan |
| 47 |
out(a1,a2) |
| 48 |
gasendL += a1 |
| 49 |
gasendR += a2 |
| 50 |
endin |
| 51 |
|
| 52 |
instr reverb |
| 53 |
aL,aR reverbsc gasendL,gasendR,0.85,10000 |
| 54 |
out(aL,aR) |
| 55 |
clear(gasendL,gasendR) |
| 56 |
endin |
| 57 |
schedule("reverb",0,-1) |
| 58 |
|
| 59 |
</CsInstruments> |
| 60 |
<CsScore> |
| 61 |
e 99999 |
| 62 |
</CsScore> |
| 63 |
</CsoundSynthesizer> |
| 64 |
|
| 65 |
|
| 66 |
<bsbPanel> |
| 67 |
<label>Widgets</label> |
| 68 |
<objectName/> |
| 69 |
<x>100</x> |
| 70 |
<y>100</y> |
| 71 |
<width>320</width> |
| 72 |
<height>240</height> |
| 73 |
<visible>true</visible> |
| 74 |
<uuid/> |
| 75 |
<bgcolor mode="background"> |
| 76 |
<r>240</r> |
| 77 |
<g>240</g> |
| 78 |
<b>240</b> |
| 79 |
</bgcolor> |
| 80 |
</bsbPanel> |
| 81 |
<bsbPresets> |
| 82 |
</bsbPresets> |