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 "^43" (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 ("^76")  (slice 8 (run 8) . (loopAt 1) . (>| "breaks165"))
  $ novaOn ("^44")  (<|"h*8")
  $ novaOff ("^44") (<| "h*[8 . 8 <8 16 32 4>]")
  $ s "hh"
  # room "^52"
  # 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 "^57" (mask "t f t")
  $ slow 2
  $ novaOn "^89" (striate 2)
  $ note (iter 4 melody) -- Naif
  # "supersaw"
  # pan 0.6
  # rate (range 0 1 "^18")
  # resonance (range 0 0.9 "^34")
  # lfo (range 0 1 "^54")
  -- # resonance (range 0 0.9 "^54")
  # voice (range 0 1 "^33")
  # crush (range 16 2 "^53")
  # release 0.95
  # pan (range 0.5 1 "^18")
  # gM' 0.25 0.8 "^81"
  # phasr "^19"
  # phasdp "^20"
d5
  $ note (melody)
  # "bassWarsaw"
  # crush (range 12 4.2 "^54")
  # octave 3
  # pan (range 0 0.5 "^18")
  # gM' 0 1.2 "^82"
d6 -- continuous laser
  $ novaOn "^60" (off 1 (|* gain 0.8) . mask "<t f>")
  $ novaOn "^59" rev
  $ s "bd"
  >| speed (
    segment (range 16 128 "^35") $
    range
      (range 0 256 "^55")
      (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 "^54"))
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 "^18")))
d8 -- Trompette lancinante
  $ novaOn "^59" (mask "<f!3 t>")
  $ slow 2 $ note ("~ <a!7 g> <g d g bf> ~")
  # "brass:2" # gM' 0.2 0.55 ("^55")
  # 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
