once $ "space" # gain 0.4

-- Legend of Main theme
do
-- region Utils
let modIndex = pF "modIndex"
let cF5 ch = cF 0.5 ch
let gDJF = (# djfbus 1 (range 0.15 0.99 "^49"))
let gRoom = (# roombus 2 (cF5 "51"))
let gSize = (# sizebus 3 (cF5 "52"))
let g = gDJF . gRoom . gSize
let gG = 2 * "^77"
let gM' l h ch  = gain (range l h (gG * ch))
let gM ch  = gM' ch 0 1
let ampb bus pat = (ampbus bus (gG * pat))
let midiOn ch pat = someCyclesBy ch pat
setcps (60/60/4)
-- endregion
d1 $ g
  -- FIXME(#94) d1 drives more controls than the grid gives it (BT1 only — BL1-3 are the family mutes). ^41 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^41 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d1's own control with gSel.
  $ midiOn "^41" (fast 2)
  $ midiOn "^41" (<| "k k k [<k!3 ~> <~ k>]")
  $ midiOff "^41" (<| "k . k(<3!3 5>,8)")
  $ "[jazz,cpu2]"
  -- # gM' 0 1.2 "^78"
d2 $ g
  $ midiOn "^42" (fast 2)
  $ "h*8"
  # "hh"
  -- # gM' 0 1.5 "^79"
d3 $ g
  $ midiOff "^43" (slow 2)
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^44 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^44 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^44 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^44 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  $ midiOn "^44" (slow 2)
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  -- FIXME(#94) d3 drives more controls than the grid gives it (BT3 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d3's own control with gSel.
  $ midiOn "^76" (loopAt 0.5)
  $ slice 8 "[0 <0 1> <0 0 2 2> <0!4 3!4>]*4"
  $ "breaks165"
  -- # gM' 0 1 "^80"
d4 $ g
  $ note ("a e . a ~ ~ <c6 e6 c6 e6 e6 e6 e6 c6>"
  - 24)
  # "bassWarsaw"
  # ampb 40 (range 0 0.45 "^81")
  # room 0.2
  # crushbus 41 (range 16 2.95 "^32")
d5 $ g
  $ note (cat [
    "a e . [~ . a] [a b c6 d6]",
    "e6 . ~ ~",
    "a e . [~ . a] [a b c6 d6]",
    "e6 . ~ ~",
    "a e . [~ . a] [a b c6 d6]",
    "e6 . ~ [e6*2]",
    "f6 . ~ g6 . a6 ~",
    "a6 a6 g6 f6 . g6 [~ f6] e6 ~",
    "[d6 ~ d6 e6] f6 . ~ [f6 . e6 d6]",
    "[c6 ~ c6 d6] e6 . ~ [e6 . d6 c6]",
    "[b5 ~ b5 cs6] ds6 . ~ fs6",
    "e6"
    ] - 12
    )
  # "FMRhodes1"
  # modIndex (range 1 15 "^33")
  # ampb 50 (range 0 0.45 "^82")







-- V0.1 Noel 2020
do
-- region Nova Utils
let gF = 1.5
let gG a = (gain (gF * "^77" * a)) -- gain Global
let gM' l h a = (gG (range l h a)) -- gain Modéré
let gM a = (gM' 0.2 0.8 a) -- gain Modéré doux
let gDelay = ((# delay 0.125) . (# delayfb (range 0 0.8 "^13")))
let gLPF = (# lpf (min 10000 ((range 200 19800 ("^49")))))
let gHPF = (# hpf (max 0 (min 10000 ((range "-9000" 9000 ("^49"))))))
let gDJF = (gLPF . gHPF)
let gCPS = (# cps ((range 60 124 "^13")/60/4))
-- let bpm = ("^13")
-- endregion Nova Utils
let g = id
let g = gDJF
-- setcps (92/60/4)
-- setcps 0.5
-- resetCycles
d1 $ g $ gCPS $ "k . <k k(<3 5>,8)>" # "reverbkick"
  # lpf 1000
  # gM' 0 1.4 "^78"
  # cps ((range 1 127 "^13")/60/4)
d2 $ g -- Break slow downtempo
  $ someCyclesBy "^74" -- Intro
  (slice 8 "0 4")
  $ someCyclesBy "^75" -- Laggy
  (slice 8 "0 1 4 3")
  -- FIXME(#94) d2 drives more controls than the grid gives it (BT2 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d2's own control with gSel.
  -- FIXME(#94) d2 drives more controls than the grid gives it (BT2 only — BL1-3 are the family mutes). ^76 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^76 for its new owner also moves this. NOT commented out: this is a `$`-step and something above it is a partial application waiting for it, so removing it would stop the whole block compiling. Fold it onto d2's own control with gSel.
  $ someCyclesBy "^76" -- Fulltime!
  (slice 8 "0 1 2 <3!2 ~ 3> 4 5 6 7*<1 <2 4>>")
  $ slice 8 ("0 1 2 1 3 <5!3 3> 2 <3 1>")
  $ "breaks125:4"
  # gM' 0 1.4 "^79"
d3 -- Drumroll Zelda
  $ g
  $ "d*2 . ~ d*<1!3 2> d*2 d*2"
  # "[drum:2,tech:13]"
  # gM' 0.2 1.4 "^80"
d4 $ g
  $ note ("<c4 bf3 af3 g3>")
  # "supersaw"
  # voice 0.1
  # gM "^81"
