d1
  $ note "c" # "supersaw" # gain 0.7

do
-- region Nova Utils
let gG a = (gain ("^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 20000 ("^49")))))
let gHPF = (# hpf (max 0 (min 9000 ((range "-9000" 9000 ("^49"))))))
let gDJF = (gLPF . gHPF)
-- let gDelay = ((# delay "[0 0.5]/2") . (# orbit 1))
-- let gDelay = ("^29")
let novaOn  ch pat = (sometimesBy ch pat)
let novaOff ch pat = sometimesBy (1 - ch) (pat)
-- endregion Nova Utils
let g = (gDJF)
let melody = scale "aeolian" (whenmod 16 12 rev "0 2 0 <3 <4 5>>*<2 4>")
let gDelayD = (# delay (range 0 0.99 "^13"))
let gDelayFB = (# delayfb (range 0 0.9 "^29"))
let gDelay = (gDelayD . gDelayFB . (# delayt 0.25) . (# orbit 2) . novaOn "^90" (# silence))
setcps (140/60/4) -- keep it between 110-190 BPM. You won't be sorry you did.
-- resetCycles
d1
  $ g -- Kick
  $ novaOn  "^73" (<| "~ ~ k ~") -- 1D
  $ novaOn  "^74" (<| "k*2") -- 2D
  $ novaOn  "^41" (<| "k*3 k*3 k*3 <k*3 [k ~ <~!3 k>]>") -- TRANSE
  $ "k k k k"
  # "[jazz]"
  -- # room 0.05
  # gM' 0 1.05 "^78"
d2 -- Clap contretemps
  $ (# lpf 5000)
  $ g -- Snare
  -- $ (|/ lpf 2)
  -- $ (|- lpf 1000)
  $ novaOn "^42" (fast 2)
  $ superimpose ((# "cp"))
  $ "~ c"
  # "glitch:2"
  -- # "[snare:50,snare:4]"
  # orbit 1
  # gM' 0.2 1 "^79"
d3 $ g -- Hats
  -- $ every' 4 3 (
  --   sometimesBy "0 . 1 0!3" ((# "ho:2") . (|* gain 0.9))
  --   . sometimesBy "0 . 0 1 0 0" (|* gain 0)
  -- )
  $ novaOn ("^43")  (slice 8 (run 8) . (loopAt 1) . (>| "breaks165"))
  -- 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.
  $ novaOn ("^44")  (<|"h*8")
  $ novaOff ("^44") (<| "h*[8 . 8 <8 16 32 4>]")
  $ s "hh"
  # room "^31"
  -- FIXME(#54) d3 drives more controls than the grid gives it (B3 only (C1-3 are the family gF filters)). ^32 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 d3's own control.
  -- # sz "^32"
  # dry (range 0 2 "^16")
  # pan (range 0 1 "^15")
  # cut 3
  # orbit 3
  # gM' 0.2 1 "^80"
d4 $ g -- Lead synth
  $ novaOn "^44" (mask "t f t")
  $ slow 2
  $ novaOn "^76" (striate 2)
  $ note (iter 4 melody) -- Naif
  # "supersaw"
  # pan 0.6
  # rate (range 0 1 "^32")
  # resonance (range 0 0.9 "^52")
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^54 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.
  -- # lfo (range 0 1 "^54")
  -- -- # resonance (range 0 0.9 "^54")
  -- 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.
  -- # voice (range 0 1 "^33")
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^53 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.
  -- # crush (range 16 2 "^53")
  # release 0.95
  # pan (range 0.5 1 "^32")
  # gM' 0.25 0.8 "^81"
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^19 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.
  -- # phasr "^19"
  -- FIXME(#54) d4 drives more controls than the grid gives it (B4 + C4). ^20 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.
  -- # phasdp "^20"
d5
  $ note (melody)
  # "bassWarsaw"
  # crush (range 12 4.2 "^33")
  # octave 3
  # pan (range 0 0.5 "^53")
  # gM' 0 1.2 "^82"
d6 -- continuous laser
  $ novaOn "^58" (off 1 (|* gain 0.8) . mask "<t f>")
  $ novaOn "^90" rev
  -- FIXME(#54) d6 drives more controls than the grid gives it (B6 + C6). ^34 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^34 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 d6's own control with gSel.
  -- FIXME(#54) d6 drives more controls than the grid gives it (B6 + C6). ^36 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^36 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 d6's own control with gSel.
  -- FIXME(#54) d6 drives more controls than the grid gives it (B6 + C6). ^56 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^56 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 d6's own control with gSel.
  -- FIXME(#54) d6 drives more controls than the grid gives it (B6 + C6). ^36 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^36 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 d6's own control with gSel.
  -- FIXME(#54) d6 drives more controls than the grid gives it (B6 + C6). ^56 now belongs to another orbit, so this step STILL FIRES ACROSS COLUMNS — turning ^56 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 d6's own control with gSel.
  $ s "bd"
  >| speed (
    segment (range 16 128 "^34") $
    range
      (range 0 256 "^54")
      (range 0 256 "^56")
    (slow (range 0.1 2 "^36") saw)
  )
  # note (-48)
  # gM' 0.5 0.85 "^83"




--- TODO HISTORIQUE
d5 $ g $ gDelay -- Skank Piano
  $ whenmod 4 3 (sometimesBy "0 1 . 0" (
    (# note "[d5,g4,b4]") . (|* gain 0.8)
  ))
  $ "<[~ p*<1 1 1 <1 2>> ~ p*<1 1 2 1>]>"
  -- TODO FIX ALIGNMENT CONTRETEMPS DE LA REPETITION
  -- $ "<[~ p  p] [~ [p <~ p*<1 2>>] . ~ p]>"
  # "superpiano"
  # note chords
  # velocity 0.6
  # sustain 0.34
  # release 0.8
  # room 0.13 # sz 0.4
  # pan 0.4
  # gM' 0 1 ("^82" * (range 0.25 1.5 "^33"))
d6 $ g $ gDelay-- Skank Hammond
  $ ("0.125" ~>)
  $ fast 2
  $ note (("[0 12 0 <~!6 12!2>]" |+ (slow 2 chords)))
  # "superhammond"
  # gM' 0 0.6 ("[0 0.25 0 0]" |+ "^82" * (range 0 0.9 "^34"))
  # voice 6
  # octave 6
  # sustain 0.25
d7
  $ g $ gDelay -- Skank Guitar
  $ note "[~ <a'min!2 e'min!2>]*2"
  # "pluck:5"
  # octave 5
  # gM' 0 1 ("^82" * ((range 0.25 1.5 "^35")))
d8 -- Trompette lancinante
  $ novaOn "^60" (mask "<f!3 t>")
  $ slow 2 $ note ("~ <a!7 g> <g d g bf> ~")
  # "brass:2" # gM' 0.2 0.55 ("^36")
  # cut 8 # room 0.1
d9 -- CP
  $ sometimesBy "^59" (fast 2)
  $ (# lpf 2000)
  $ g
  $ whenmod 4 2 (superimpose ((# "clap") . (# lpf 4500) . (|* gain 0.8)))
  $ fast 2
  $ "~ cp"
  # gM' 0 1.1 "^83"
  # room 0.2
  # dry 0.9
  # lpf 2000
