-- TODO WAVES :)
once $ "dr"

do
setcps (85/60/4)
let g1 = (# djfbus 1 (range 0.05 0.95 "^49"))
let g2 = (# djfbus 2 (range 0.05 0.95 "^29"))
let harmonic = pF "harmonic"
let gate = pF "gate"
d1
  $ g1
  $ midiOn "^41" (fast 2) -- TODO: Comment to Cooldown :')
  $ fix ((|* gain 0.5) . (# "kick:5")) ("c")
  $ fix ((|* gain 0.37) . (# "cpu2")) ("b")
  $ fix ((|* gain 0.8) . (# "jazz")) ("a")
  -- FIXME(#94) d1 drives more controls than the grid gives it (BT1 only — BL1-3 are the family mutes). ^42 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^42 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.
  -- FIXME(#94) d1 drives more controls than the grid gives it (BT1 only — BL1-3 are the family mutes). ^42 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^42 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 "^42" (<| "k . k <k [~ k]>") -- Jump?
  -- FIXME(#94) d1 drives more controls than the grid gives it (BT1 only — BL1-3 are the family mutes). ^43 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^43 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.
  -- FIXME(#94) d1 drives more controls than the grid gives it (BT1 only — BL1-3 are the family mutes). ^43 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^43 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 ("^43" - "^42") (<| "k k k <k [<[<~ k>]!16 ~!3 k ~!3 k k!3 ~ k!3 ~> k]>") -- RUN!
  $ "[a,b,c]"
  # legato 2
  # lpf 4000
  # room 0.85
  # dry 1
  # sz 0.8
  # midiG' "^78" 0 1.5
d2 $ g1 -- Snare cloc fantome
  $ whenmod 32 8 (fast 2)
  $ fix ((# rel "<0.18!7 0.45>") . (|* gain "<0.7!7 0.5>")) ("glitch")
  $ fix ((# begin 0.02) . (|* gain 0.84)) ("snare")
  $ "~ sn" # "[cpu:8,tech:5,snare:5,glitch:2]"
  # room ("<0.25!3 0.5>" + (slow 4 $ range 0 0.25 perlin))
  # dry 0.98
  # sz 0.9
  # midiG' "^79" 0 1.5
d3 $ g2
  $ someCyclesBy 0.2 (ply 2)
  $ midiOff "^43" (slow "<2!3 <1 2>>")
  $ ply "2 <2!3 [2|4|8]*4>"
  $ "h h h h*<1 2>"
  # "h2ogmhh" # n "1 <2 [2 1]>"
  # pan "<0.4 0.4 [0.4|0.6] <0.6 0.8>>"
  # midiG' "^80" 0 (range 0 1.2 "^16")
d7 $ g2 -- BREAKBEAT <3
  $ loopAt 2
  $ midiOn "^59" (mask "t(<3<5 8>>,8) t(<1 2>, 4) t?" . iter 4 . splice 8 (run 32) . (|> "breaks165"))
  $ midiOn "^91" (slice 8 (run 8))
  $ midiOff "^91" (slice 8 ("0 1 [2 5] <3 7*2>"))
  $ "break" # n "<21!32 22!8>"
  # midiG' "^80" 0 1.4
  # speed (range 0 2 "^35")
d4 $ g2 -- Bassline sub base
  $ note "[c3(<3!3 <1 5>>,8),[~!7 <<b3 ~> b3 b3 ~ ~ ~ b3>]] <c3 g3>"
  # "ikedaBass"
  # legato 2
  # att 0.1 # rel 2
  # room "<0.25!3 0>"
  # sz 0.8
  # midiG' "^81" 0 1.2
  # crushbus 41 (range 14 2 "^32")
  # panbus 42  (range 0.4 0.2 saw)
  # harmonic (range "-25" 25 (fast 8 saw))
  # cut 4
d5 $ g2 -- Bassline melodie
  $ note (
    "<c3 [c3@2 ~ c3 . <~ bf2> ~ ~ bf2 c3 bf2 g2@2]>"
    + 12
  )
  # "bassWarsaw"
  # legato 2
  # lfobus 50 (fast 4 sine)
  # midiG' "^82" 0 1
  # crushbus 51 (range 16 2.95 "^33")
  # octerbus 52 (range 0 "<0.4 0.5 0.9 1.2>" (fast "<4!3 8>" sine))
  # octersubbus 53 (range 0 8 ("^53" + 0.5 * (fast 16 cosine)))
  # panbus 54 (range 0.6 0.8 saw)
  # room 0.5 # sz 0.8
  # cut 5
d6 $ g2 -- Skank organ
  $ midiOn "^90" (
    superimpose (arp "<up up converge down>"
    . (|+ note "0*<2 <2 4> 4 8>"))
  )
  $ note ("~ 0*<2 2 1 2> ~ 0*<2!3 <1 2>>"
      + "<c5!2 [<f4!3 d5>, bf4]!2>*2"
      -- + "[0,12]"
      - 24
  )
  # "[<~!3 organTonewheel2>,organTonewheel3]"
  # pan (0.7 + 0.2 * perlin)
  # midiG' "^83" 0 1.3
  # sustain 0.35
  # room 0.85
  # sz 0.8
  # dry 1
d7 -- Dub piano un peu fou
  $ whenmod 16 8 (superimpose (|+ note "<7!7 <5 4>>"))
  $ note ("~ 0 ~ 0 ~ 0 ~ 0" + "[c <c!1 <bf <d g4>>>]")
  -- <c3 [c3@2 ~ c3 . <~ bf2> ~ ~ bf2 c3 bf2 g2@2]>"
  # "superpiano"
  # velocity 0.5
  # pan 0.8 # room 0.2 # dry 1.3
  # midiG' "^84" 0 1.3


  -- TODO: Why not?
  d2 $ f1 $ m -- Clave de l'été
  $ midiOn "^43" (fast 2)
  $ midiOn ("^75"-"^43") (fast 2)
  $ (|* gain ("0.75 1 1 1 0.75 1 1 1" * 1.7))
  $ "d ~ ~ d d ~ d <~!3 d>"
  # "snare:22"
  # midiG' "^79" 0 1.4
  # speed (range 0 2 "^51")
