From f7354554425e17757f31d81e26789ad20df852bf Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 21 Oct 2022 01:48:24 +0100 Subject: debugged, CPU usage reduced, progression formulated --- include/instruments_water.inc | 102 +++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 32 deletions(-) (limited to 'include/instruments_water.inc') diff --git a/include/instruments_water.inc b/include/instruments_water.inc index 6f3e19b..93efdfd 100755 --- a/include/instruments_water.inc +++ b/include/instruments_water.inc @@ -17,6 +17,7 @@ #include "sonics/sequencing_melodic_portamento.udo" #include "sonics/bussing.udo" #include "sonics/frequency_tools.udo" +#include "sonics/wavetables.udo" ; sound collections gisnd_waterpaddling[] sounddb_getcollection "Water.Paddling" @@ -27,37 +28,43 @@ instr play_waterpaddling1 ifileid = arr_random(gisnd_waterpaddling) ifn = gisounddb[ifileid][0] idur = gisounddb[ifileid][2] - p3 = random(4, 8) - ktime init 0 - ipitch = random(0.5, 0.9) - aL, aR mincer a(port(ktime, 1)), 1, ipitch, ifn, 0, 128 + kfreqshift init -100 + ipitch = random(0.5, 1.2) + ktime init random(0, idur) + aL, aR mincer a(port(ktime, 0.1, random(0, idur))), 1, ipitch, ifn, 0, pow(2, round(random(4, 7))) ;64 - if (random:k(0, 1) > 0.5) then + aL, aR freqshift1 aL, aR, port(kfreqshift, 0.2) + + if (random:k(0, 1) > 0.2) then ktime = random:k(0, idur) endif + if (random:k(0, 1) > 0.2) then + kfreqshift = random(-1000, -100) + endif + kamp linseg 1, p3*0.8, 1, p3*0.2, 0 - aL *= kamp * 0.7 - aR *= kamp * 0.7 + aL *= kamp * 1.8 + aR *= kamp * 1.8 if (random(0, 1) > 0.8) then - bus_mix("delay1", aL*0.3, aR*0.3) + bus_mix("delay1", aL*random(0, 0.3), aR*random(0, 0.3)) endif - if (random(0, 1) > 0.8) then - bus_mix("reverb1", aL, aR) + if (random(0, 1) > 0.3) then + bus_mix("reverb1", aL*random(0.2, 0.8), aR*random(0.2, 0.8)) endif if (random(0, 1) > 0.5) then - bus_mix("pvsamp1", aL, aR) + bus_mix("pvsamp1", aL*0.6, aR*0.6) endif bus_mix("master", aL, aR) endin -instr _play_waterbubbler_drop +instr _phrase_waterbubbler1_item ipitch = p4 iamp = p5 ioutmain = p6 @@ -72,8 +79,8 @@ instr _play_waterbubbler_drop ipan = random(0, 1) if (random(0, 1) > 0.5) then - aLr resony aL, table:k(0, gimel_freqs)*2, 4, 16, 4 - aRr resony aL, table:k(0, gimel_freqs)*2, 4, 16, 1 + aLr resony aL, table:k(0, gimel_freqs)*2, 4, 16, 10 + aRr resony aL, table:k(0, gimel_freqs)*2, 4, 16, 10 aL balance aLr, aL aR balance aRr, aR aL dcblock aL @@ -93,12 +100,12 @@ instr _play_waterbubbler_drop bus_mix("pvsamp1", aL, aR) endif - Schannel = (ioutmain == 1) ? "main" : "waterbubbler" + Schannel = (ioutmain == 1) ? "main" : "phrase_waterbubbler" bus_mix(Schannel, aL*(1-ipan), aR*ipan) endin -instr waterbubbler +instr phrase_waterbubbler1 ioutmain = p4 kamp linseg 0, p3*0.1, 1, p3*0.8, 1, p3*0.1, 0 iamp = random(0.25, 0.5) @@ -106,28 +113,30 @@ instr waterbubbler kfreq = abs:k(oscil:k(30, 0.01)) + 10 kmetro metro kfreq if (kmetro == 1) then - schedulek("_play_waterbubbler_drop", random:k(0, 0.2), 1, random:k(0.8, 1.2), random:k(0.5, 1)*kamp, ioutmain) + schedulek("_phrase_waterbubbler1_item", random:k(0, 0.2), 1, random:k(0.8, 1.2), random:k(0.5, 1)*kamp, ioutmain) endif endin -instr play_drop1 +instr note_drop1 ifileid = arr_random(gisnd_waterdrop) ifn = gisounddb[ifileid][0] idur = gisounddb[ifileid][2] ipitch = random(0.6, 1.3) p3 = idur / ipitch aL, aR loscil 1, ipitch, ifn, 1 - kamp linseg 1, p3*0.8, 1, p3*0.2, 0 - aL *= kamp - aR *= kamp + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + iamp = random(0.7, 1) + ipan = random(0, 1) + aL *= kamp * iamp * ipan + aR *= kamp * iamp * (1-ipan) bus_mix("pvsamp1", aL*random(0, 0.3), aR*random(0, 0.3)) bus_mix("reverb1", aL*random(0, 0.2), aR*random(0, 0.2)) bus_mix("master", aL, aR) endin -instr _play_droproll1_item +instr _phrase_droproll1_item ifileid = arr_random(gisnd_waterdrop) ifn = gisounddb[ifileid][0] idur = gisounddb[ifileid][2] @@ -142,7 +151,7 @@ instr _play_droproll1_item bus_mix("pvsamp1", aL*random(0, 0.5), aR*random(0, 0.5)) endin -instr play_droproll1 +instr phrase_droproll1 iamp = p4 ifreq1 = random(0.00001, 20) kmetrofreq expseg ifreq1, p3, 19.99 - ifreq1 @@ -150,7 +159,7 @@ instr play_droproll1 kamp linseg 0, p3*0.3, 1, p3*0.4, 1, p3*0.3, 0 kmetro metro kmetrofreq if (kmetro == 1) then - schedulek("_play_droproll1_item", random:k(0, 0.2), 1) + schedulek("_phrase_droproll1_item", random:k(0, 0.2), 1) endif aL, aR bus_read "droproll1_item" @@ -163,7 +172,35 @@ instr play_droproll1 endin -instr playdropstretch +instr transition_droplets1 + iriseratio = p4 + kamp expseg 0.00001, p3*iriseratio, 1, p3*(1-iriseratio), 0.00001 + kmetro metro 30 + if (kmetro == 1) then + schedulek("_phrase_droproll1_item", random:k(0, 0.2), 1) + endif + + aL, aR bus_read "droproll1_item" + aL *= kamp * 2.5 + aR *= kamp * 2.5 + bus_mix("reverb1", aL*0.43, aR*0.43) + bus_mix("master", aL, aR) +endin + + +instr transition_waterbubbler1 + ioutmain = p4 + iriseratio = p4 + kamp expseg 0.00001, p3*iriseratio, 1, p3*(1-iriseratio), 0.00001 + kfreq = abs:k(oscil:k(30, 0.01)) + 10 + kmetro metro kfreq + if (kmetro == 1) then + schedulek("_phrase_waterbubbler1_item", random:k(0, 0.2), 1, random:k(0.8, 1.2), random:k(0.5, 1)*kamp, 1) + endif +endin + + +instr phrase_dropstretch1 ireadpitch = p4 ido_reson = p5 ifades = p6 @@ -172,8 +209,9 @@ instr playdropstretch ifn = gisounddb[ifileid][0] idur = gisounddb[ifileid][2] istart = random(0, idur*0.2) - iend = random(idur*0.3, idur*0.5) - atime = abs(oscil(iend-istart, random(0.001, 0.1), gifnSine, random(0, 1))) ; + istart ; needed??? + iend = random(idur*0.4, idur*0.8) ; 0.3, 0.4 + atime = abs:a(oscil:a(iend-istart, random(0.001, 0.1), gifnSine, random(0, 1))) + kenv = abs:k(oscil:k(0.8, random(0.01, 0.1), gifnSine, random(0, 1))) + 0.2 aL, aR sndwarpst 1, atime, ireadpitch, ifn, istart, 441*random(1, 10), 44*random(1, 10), 8, gifnHalfSine, 1 @@ -182,14 +220,14 @@ instr playdropstretch else kamp linsegr 1, p3, 1, 2, 0 endif - aL *= kamp - aR *= kamp + aL *= kamp * kenv + aR *= kamp * kenv if (ido_reson == 1) then aLr resony aL, table:k(0, gimel_freqs)*2*iresonfreqratio, 2, 16, 10 - aRr resony aL, table:k(0, gimel_freqs)*4*iresonfreqratio, 2, 16, 10 - aL balance butterhp(aLr, 60), aL - aR balance butterhp(aRr, 60), aR + aRr resony aR, table:k(1, gimel_freqs)*2*iresonfreqratio, 2, 16, 10 ; *4* + aL balance butterhp(aLr, 50), aL + aR balance butterhp(aRr, 50), aR endif aL pareq aL, 1000, 0.4, 0.75 -- cgit v1.2.3