do
setcps (160/60/4)
-- resetCycles
let gMute = (midiOn "^73" (mask "f*16"))
let gM = gMask . gMute
-- Harmonic foundation: 16-bar cycle (each chord = 2 bars)
-- Main Bbm/F vamp with Db/Ebm variation at the end
let rt = slow 2 "<bf3 f3 bf3 f3 bf3 f3 df3 ef3>"
d1 $ gF1 $ gM1 -- KICK: Deep 4otf house kick
  $ midiOn  "^42" (<| "k k k <k k*2 k [~ k]>")
  $ midiOff "^42" (<| "k")
  $ fix ((# att 0.01) . (# rel 0.5) . (# lpf 2000)) "kick:4"
  $ "[techno:0,808bd:2,kick:4]"
  # gain 1.3
d2 $ gF1 $ gM -- CLAP: h2o natural handclap, reverbed
  $ midiOn "^43" (<| "~ cp ~ [cp <~ cp>]")
  $ midiOff "^43" (<| "~ cp ~ <~ cp*<1 2>>")
  $ "h2ogmcp"
  -- # room (slow 32 $ range 0.3 0.6 saw)
  -- # sz (slow 32 $ range 0.1 0.45 cosine)
  # dry 1
  # gain 1.1
d3 $ gF1 $ gM -- HATS: h2o sparse offbeat + light flourish
  $ midiOn "^76" (ply 2) -- double time on button
  $ midiOff "^44" (mask "t(3,8)")
  -- n: 0-4 closed Hard→Soft, 5-9 open, 15-19 semi-open
  $ "~ h ~ h ~ h ~ <h!3 h*2>"
  # "h2ogmhh"
  # n "~ 3 ~ 2 ~ 4 ~ <3!3 [3 6]>" -- occasional open hat flourish
  # gain (1.5 * "~ 0.7 ~ 0.8 ~ 0.65 ~ <0.7!3 [0.7 0.5]>")
d4 $ gF3 $ gM3 
  $ loopAt 16 $ chop 8 
  $ "gfunk_lead:7"
  # gain 1.2 
  # room 0.3 
  # crushbus 41 (range 16 3.5 "^53")
  # lpfbus 42 (range 300 1200 "^33") 
d5 $ gF3 $ gM3 $ loopAt 16 $ chop 8 
 $ "gfunk_lead:7" 
 # octersubbus 51 (range 0 2.9 "^34")
 # hpf 1000
 # gain 1.3
d8 $ gF1 $ gM2 
  $ loopAt 2 $ chop 8 
  $ midiOn "^56" ((|* gain 1.2)  . loopAt 2 . (>| "jungle_breaks:19"))
  $ "jungle_breaks:74"
 
