resetCycles

setcps (120/60/4)

do
let fmamp op = pF ("amp" ++ show op)
let fmratio op = pF ("ratio" ++ show op)
let fmdetune op = pF ("detune" ++ show op)
let fmmod opa opb = pF ("mod" ++ show opa ++ show opb)
let fmfeedback = pF "feedback"
let fmeglevel op step = pF ("eglevel" ++ show op ++ show step)
let fmegrate op step = pF ("egrate" ++ show op ++ show step)
let fmparam function (x:xs) = foldr (#) (function 1 x) (zipWith function [2..] xs)
let fmamps = fmparam fmamp
let fmratios = fmparam fmratio
let fmdetunes = fmparam fmdetune
let envrate op = fmparam (fmegrate op)
let envlevel op = fmparam (fmeglevel op)
let prog = "<c4'maj g4'maj a4'min f4'maj a4'min c4'maj>"
let breakPont = whenmod 64 48 (# djf (slow 16 $ range 0.5 0.95 isaw))
let breakDJF = whenmod 32 20 (# djf (slow 12 $ range 0.5 0.05 isaw))
let break40 = mask "<t!40 f!8 t!8>"
let g = breakDJF . breakPont
let gM = ((# djf "<0.5!20 0.4!12 0.5!16 0.6!16>")) -- Lighter breaks
let gOutDeg = (whenmod 256 128 (degradeBy ("0 0.5!15" * (slow 128 saw))))
let gOut = (gOutDeg)
d1 $ g
  $ break40
  $ mask "<f!8 t!120>" -- Intro périodique
  $ someCyclesBy "<f!32 t!8 f!8 f!16>" (<| "k . k(<3 3 5 [5 8]>,8)")
  $ someCyclesBy "<f!2 t f t!28>" (<| "k k k <k!4 [~ k]!3 k*2>")
  $ "[jazz,bd,cpu]"
  # room 0.31 # sz 0.5 # dry 0.9
  # lpf 3000
  # gain (slow 32 $ range 0.45 0.6 saw)
d2 $ g
  $ mask "<f!16 t!112>" -- Intro périodique
  $ mask "<t!40 f!6 t [f . t f] t!8>"
  $ whenmod 8 6 (# n "7 . <0 [7 1]>")
  $ "hh([8 <[8 [8|12]]!3 <4 [4 16]>>],8)"
  # gain (0.33 + 0.1 * (fast 4 perlin))
  # pan "0.2 0.4"
d3 $ gM -- Modulated bassline
  $ slow 2
  $ off "h" (arp "converge <down!3 up>" . (|* gain 0.75))
  $ n (
    prog
    - 12
  )
  # "superfm"
  # fmamps [1,"<0!4 1!4>","<0 0.25 0.5 0.75>",0,0,0]
  # envlevel 1 [slow 8 "<0.5 0.7 0.8 0.9 1!4>", (slow 16 $ range 1 6 saw), 0, 0, 0, 0]
  # fmmod 1 1 1.1
  # fmmod 2 1 1.9
  # fmmod 2 1 "<0!8 0.098!8>"
  # envrate  1 [1, 0.1, 0.1, 0, 0, 0]
  # envlevel 2 [1, 0, 0, 0, 0, 0]
  # envrate  2 [1, 0.3, 0.7, 0, 0, 0]
  # envlevel 3 [1, 0.2, 0, 0, 0, 0]
  # envrate  3 [10, 0.5, 0.4, 0, 0, 0]
  # envlevel 4 [(slow 32 $ range 0.5 1 sine), (slow 32 $ range 0.5 1 cosine), 0, 0, 0, 0]
  # legato 2
  # release 2.8
  # gain 0.5
  # fmfeedback ("<0!32 1!96>" * (slow 128 $ "<0!4 1!124>" * (range 0 5.8 (sine/4 + perlin))))
  # pan 0.2
  # hpf 500
d4 $ gOut -- Réplique Aigue
  $ break40
  $ slow 2
  $ struct "t t(<5!3 3>,16)"
  $ n (
    arp "up down"
    $ off "<h q>" id
    (fast 6 $ prog + 12)
  )
  # "superfm"
  # fmamps [1,"<0!4 1!4>","<0 0.25 0.5 0.75>",0,0,0]
  # envlevel 1 [slow 8 "<0.5 0.7 0.8 0.9 1!4>", (slow 16 $ range 1 6 saw), 0, 0, 0, 0]
  # fmmod 1 1 1.1
  # fmmod 2 1 1.9
  # fmmod 2 1 "<0!8 0.098!8>"
  # envrate  1 [1, 0.1, 0.1, 0, 0, 0]
  # envlevel 2 [1, 0, 0, 0, 0, 0]
  # envrate  2 [1, 0.3, 0.7, 0, 0, 0]
  # envlevel 3 [1, 0.2, 0, 0, 0, 0]
  # envrate  3 [10, 0.5, 0.4, 0, 0, 0]
  # envlevel 4 [(slow 32 $ range 0.5 1 sine), (slow 32 $ range 0.5 1 cosine), 0, 0, 0, 0]
  # cut 4
  # gain (range 0 0.48 (0.5 + 0.25 * (slow 16 saw) + 0.05 * perlin))
  # pan (slow 16 $ range 0.6 0.9 sine)
  # hpf 1500
d5 $ g $ gOut -- Snare roll
  $ mask "<f!8 t!48 f!8 t!8 t!48>" -- Intro périodique
  $ often (ply "1 <2 0.5>")
  $ stut 8 0.8 ("<s e [e s] [s e]>")
  $ "~ . s"
  # "808sd:1"
  # gain (slow 8 $ range 0.32 "<0.35!16 0.5!16>" saw)
  # room 0.2
  # dry 1.1
  # hpf 3500
d6 -- CHOIR <3
  $ gM $ gOut
  $ superimpose (|+ note 12)
  $ note (prog - 24) -- Baseline
  # "moogBass"
  # gain (slow 32 $ range 0.25 0.305 saw)
  # room 0.4
  # pan 0.75
d7 -- Solists <3
  $ gM $ gOut
  $ whenmod 128 64 (striate "1 . 2 4" . ply "<1!8 2!8 4!8 1!8>")
  $ struct "t(<3 3 5 [5 <2 [8 <8 16>]>]>,8)"
  $ note ("0*4"
   + (arp "pinkyup" prog + "0 <7 5>")
   ) -- Baseline
  # "moogBass"
  # gain (0.12 + 0.1 * (slow 16 $ range 0.5 1 saw))
  # room 0.4
  # pan 0.85
