aboutsummaryrefslogtreecommitdiff
path: root/site/udo/fnml/transitional/base.udo
diff options
context:
space:
mode:
authorRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
committerRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
commit9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 (patch)
tree291bd79ce340e67affa755a8a6b4f6a83cce93ea /site/udo/fnml/transitional/base.udo
downloadapps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.gz
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.bz2
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.zip
initial
Diffstat (limited to 'site/udo/fnml/transitional/base.udo')
-rwxr-xr-xsite/udo/fnml/transitional/base.udo141
1 files changed, 141 insertions, 0 deletions
diff --git a/site/udo/fnml/transitional/base.udo b/site/udo/fnml/transitional/base.udo
new file mode 100755
index 0000000..ba40fbc
--- /dev/null
+++ b/site/udo/fnml/transitional/base.udo
@@ -0,0 +1,141 @@
+#ifndef UDO_FNML_TRANSITIONBASE
+#define UDO_FNML_TRANSITIONBASE ##
+
+instr fnm_transitionplayer
+ if (gifirsttransition == 1) then
+ StransInstrument = "fnm_trans5"
+ gifirsttransition = 0
+ else
+ StransInstrument = arr_random(gSfnm_transitionitems)
+ endif
+ schedule StransInstrument, 0, 36000
+
+ kreleasing init 0
+ if (release:k() == 1 && kreleasing == 0) then
+ turnoff2 StransInstrument, 0, 1
+ kreleasing = 1
+ endif
+ aL, aR bus_read "fnm_transition"
+ bus_mix("master", aL, aR)
+endin
+
+instr fnm_sectionplayer
+ SnoteInstrument = arr_random(gSfnm_chorditems)
+ SbassInstrument = arr_random(gSfnm_bassitems)
+ SaugInstrument = arr_random(gSfnm_augmentitems)
+ iplaybass = (random(0, 1) >= 0.44) ? 1 : 0
+ iplayaugment = (random(0, 1) >= 0.34) ? 1 : 0
+
+
+ if (random(0, 1) >= 0.5) then
+ ifadeintime = random(0.1, 3)
+ else
+ ifadeintime = 0
+ endif
+ index = 0
+ while (index < table:i(0, gimel_current_notes)) do
+ inoteaugment = (random(0, 1) >= 0.7) ? 12 : 0
+ schedule SnoteInstrument, 0, p3, table:i(index+1, gimel_current_notes) + inoteaugment, ifadeintime
+ index += 1
+ od
+ if (iplaybass == 1) then
+ ibassnoteindex = round(random(1, 3))
+ schedule SbassInstrument, 0, p3, table:i(ibassnoteindex, gimel_current_notes) - 24
+ endif
+ if (iplayaugment == 1) then
+ schedule SaugInstrument, 0, p3
+ endif
+
+ aL, aR bus_read "fnm_chordnote"
+ if (random(0, 1) > 0.6) then
+ aLc, aRc simplechorus aL, aR, 0.004, 0.001
+ aL += aLc
+ aR += aRc
+ endif
+ aL butterhp aL, 120
+ aR butterhp aR, 120
+
+ if (iplaybass == 1) then
+ aLb, aRb bus_read "fnm_chordbass"
+ aL += aLb
+ aR += aRb
+ endif
+
+ if (iplayaugment == 1) then
+ aLa, aRa bus_read "fnm_augment"
+ aL += aLa
+ aR += aRa
+ endif
+
+ kamp linseg 1, p3, 1, 0.1, 0
+ aL *= kamp
+ aR *= kamp
+
+ kduck = port(gkduck, 0.1)
+ aL *= (1 - kduck)
+ aR *= (1 - kduck)
+ bus_mix("master", aL*0.8, aR*0.8)
+
+ kreleasing init 0
+ if (release:k() == 1 && kreleasing == 0) then
+ turnoff2 SnoteInstrument, 0, 1
+ if (iplaybass == 1) then
+ turnoff2 SbassInstrument, 0, 1
+ endif
+ if (iplayaugment == 1) then
+ turnoff2 SaugInstrument, 0, 1
+ endif
+ kreleasing = 1
+ endif
+endin
+
+
+instr fnm_sectionmanager
+ gkmel_pause = 1
+
+ ksectionstart init 0.01
+ ksectionchange = 0
+ ktransitioner = chnget:k("fnm_transition")
+ kadvance = chnget:k("fnm_advance")
+ krepeat = chnget:k("fnm_repeat")
+
+ if (changed:k(ktransitioner) == 1) then
+ if (ktransitioner == 0) then
+ turnoff2 "fnm_transitionplayer", 0, 1
+ if (random:k(0, 1) > 0.5) then ; have ultimate transition
+ if (random:k(0, 1) > 0.5) then ; no other output during ultimate transition
+ turnoff2 "fnm_sectionplayer", 0, 1
+ endif
+ gkutransitiontime = random:k(0.2, 1)
+ schedulek("fnm_ultimatetransitionplayer", 0, gkutransitiontime)
+ ksectionstart = gkutransitiontime
+ else
+ gkutransitiontime = 0
+ ksectionstart = 0.01
+ endif
+ ksectionchange = 1
+ else
+ schedulek("fnm_transitionplayer", 0, 36000)
+ endif
+ endif
+
+ if (ksectionchange == 1 || (changed:k(kadvance) == 1 && kadvance == 1) || (changed:k(krepeat) == 1 && krepeat == 1)) then
+ if (krepeat == 1) then
+ ksectionstart = 0
+ endif
+ turnoff2 "fnm_sectionplayer", 0, 1
+ if (krepeat != 1) then
+ gkmel_advance_trig = 1
+ endif
+ schedulek("fnm_sectionplayer", ksectionstart, 36000)
+ endif
+
+ kreleasing init 0
+ if (release:k() == 1 && kreleasing == 0) then
+ turnoff2 "fnm_sectionplayer", 0, 1
+ kreleasing = 1
+ endif
+
+endin
+
+#end \ No newline at end of file