-- See https://www.composernotes.com/sheet_music/Bach-Prelude-Cmajor-BWV846-Harmonic-Analysis.pdf

do
setcps (110/60/4)
let gMute = (midiOn "^73" (mask "f*16"))
let gM = gMask . gMute
d1 $ gF1 $ gM1
  $ midiOn  "^41" (<| "k k k k*2")
  $ midiOff "^41" (<| "k")
  $ fix ((|* gain 0.9) . (# lpf 1000)) "jazz"
  $ fix ((# att 0.02) . (# rel 0.5) . (# lpf 400)) "kick:4"
  $ "[808bd:1,808bd:2,jazz,kick:4]"
d2 $ gF1 $ gM $ "~ sn <~ [~ sn]> 0" # note "0 0 -1 0" # legato "1 1 0.75 1"
  # "[vec1_snare:28]" # note ("~ 0 <~ [~ -2]> 0" -2) # gain 1.2
  # room 0.4 # sz 0.1 # dry 1.1 # lpf 4000
d3 $ gF1 $ gM -- Hats ouverts legers
  -- 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" (ply 2)
  $ midiOff "^43" (mask "t(4,8,1)")
  $ "ho:0*8"
  # att (0.25 - (0.1 * perlin))
  # rel 0.05
  # gain (1.4 * "1 0.9 1 0.8 <0.9!3 1.05> 1")
d4 $ gF2 $ gM3
  $ superimpose ((# "vec1_acid:44")
  . (|* gain (range 0 1.2 "^32"))
  . (|+ note 24))
  $ midiOn "^76" (ply "1 2")
  $ midiOn "^44" (off 0.5 id)
  -- Progression 8 premieres Measures
  $ note ("<c3!4 b2!2 c3!2 c3!4 b2!4> <e3!2 d3!4 e3!2 e3!2 d3!4 c3!2>@7")
  # crushbus 41 (range 16 3.5 "^52")
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^33 now belongs to another orbit, so the line(s) below are COMMENTED OUT rather than left firing across columns. Nothing is lost — restore by removing the dashes once gSel folds this onto d4's own control.
  -- # octersubbus 42 (range 0 0.9 "^33")
  # "bassWarsaw"
  # gain 1.3
  # room 0.4
d5
  $ midiOn (1-"^33") (mask "t f")
  $ slow 2 $ note (
  cat [
  "[~ ~ g4 c5 e5 g4 c5 e5]*4", -- I
  "[~ ~ a4 d5 f5 a4 d5 f5]*4", -- ii7
  "[~ ~ g4 d5 f5 g4 d5 f5]*4", --
  "[~ ~ g4 c5 e5 g4 c5 e5]*4",
  "[~ ~ a5 e5 a6 a5 e5 a6]*4",
  "[~ ~ fs5 a5 d6 fs5 a5 d6]*4",
  "[~ ~ g5 d5 g6 g5 d5 g6]*4",
  "[~ ~ e5 g5 c6 e5 g5 c6]*4"
  ]
  )
  -- # "cs80leadMH"
  # "FMRhodes1"
  # modIndex (range 0 14 "^53")
  -- # cut 5
  # legato 0.4
  # room 0.7
d9 $ gF2 $ gM3
  $ slow 2
  $ note (
  cat [
  "g4*3 e5", -- I
  "a4*3 f5", -- ii7
  "g4*3 e5", --
  "g4*3 e5",
  "a5*3 a6",
  "fs5*3 d6",
  "g5*3 g6",
  "e5*3 c6"
  ]
  )
  -- # "cs80leadMH"
  # "moog:1"
  # room 0.7
  # octersub 0.4
  # gain 1.3
  # pan 0.6
  # cut 9
d8 $ gF1 $ gM
  $ midiOn ("^60" - "^92") (ply "1!2 <1!3 <2 1 1 2>>!2" . mask "f(4,8)")
  $ midiOn ("^36" - "^92") ((loopAt 1) . (# hpf 1500) . (# "jungle_breaks:45")) -- Clochettes?
  $ midiOn ("^56" - "^92") ((loopAt 1) . (# hpf 1500) . (# "jungle_breaks:30")) -- Clochettes?
  $ midiOn ("^92") ( -- Bouton Nassim <3
    slice 16 "[0 .. 7] . <[0 .. 7]!7 [0 1 . [2 3]]>"
    . loopAt 0.5 . (# "breaks165") . (# octersub 2)
  )
  $ chop 16
  $ loopAt 2
  $ "jungle_breaks:74"
  # room 0
  # gain 1.2
