-- Dimanche mineur: Tech breakbeat melancholic
resetCycles

do
let prog = "<d'maj d'major d'min <d'maj a'maj'2>>"
let progMin = "<d'maj'2 d'major'2 d'min'2 <d'min a'maj>>"
setcps (105/60/4)
let g = (whenmod 32 28 (# djf (slow 4 $ range 0.5 0.05 isaw)))
d1 $ g
  $ mask "<f!8 t!56>"
  $ whenmod 64 32 (<| "k k(<3!3 5>,8)")
  $ someCyclesBy "<t!32 f!32>" (<| "k*4")
  $ "[kick:5,jazz]"
  # lpf 2000
  # room 0
  # gain 1
d2 $ g
  $ mask "<f!4 t!28>"
  $ whenmod 64 32 (const
      $ slice 8 ("0 1 2*<1 2> <3!3 <~ [~ 3]>>")
      $ loopAt 2 $ "fbreak100"
      # gain (slow 32 $ range 0.85 1.5 saw)
  )
  $ fix (|* gain 0.95) (n 7)
  $ n (stack [
  "[4(5,8),4(<0!3 1>,8,7)]",
  "7 7 7 <7!3 [~ 7]>",
  ""
  ]) # "hh27"
  # gain 0.9
d3 -- Lifeline
  $ whenmod 32 30 (slow 2)
  $ whenmod 32 28 (slow 2)
  $ sometimesBy "0!7 <0 0.1>" (ply 2)
  $ "tech:4*4"
  # gain (slow 16 $ range 1.2 0.6 perlin)
d4 $ g -- Bass chill hypno
  $ mask "<f!8 t!56>"
  $ struct "t(5,8,<0!6 4!2>)"
  $ arp "<up!6 down!2>"
  $ note (prog)
  # "bassWarsaw"
  # octave 3
  # pan 0.2
  # legato "<1!3 2>"
  # room 0.5
  # gain (slow 32 $ range 0.95 0.75 (1 - cosine))
d5 $ g -- Rhodes+arp
  $ mask "<f!8 t!56>"
  $ mask "<t!16 f!11 t!5>" -- Complement sax
  $ whenmod 32 8 (off "h" (
    struct "t(12,16)"
    . arpeggiate
    . (|+ note "[0,12]")
    . (|+ pan 0.8)
    . (|* gain "<0.85 0.9 1 1.1>")
  ))
  $ note (prog
    + "<0!8 [0 <12 <-12 24>>]!8>" -- spread
  )
  # "FMRhodes1"
  # octave 3
  # gain (slow 8 $ range 1 1.16 saw)
d6 -- Fantômes
  $ mask "<f!24 t!8 f!16 t!16>"
  $ note (progMin)
  # "moogBass"
  # gain 0.75
  # pan 0.85
d7 -- Sax gauche
  $ mask "<f!16 t!16>"
  $ mask "<f!4 t t f f t!8>"
  $ note ("<<-2 0>!3 <0 2>>")
  # "sax:2"
  # pan 0.35
  # gain (slow 4 $ range 0.7 0.9 saw)
d8 -- Sax droit
  $ mask "<f!16 t!16>"
  $ mask "<f!4 f f t t t!8>"
  $ note ("<0 0 <4 7 [0,[12 12]]> 0>")
  # "sax:1"
  # pan 0.2
  # release 2
  # cut 8
  # gain (slow 4 $ range 0.75 1 saw)
d10 -- Kurt's random interjections
  $ mask "<f [f!3 t] f!30 [t!4 f f t f]*4>"
  $ off "[s|q|0.375|e]" (# crush 7)
  $ off "[h|1]" (# lpf 2000)
  $ "kurt" # n (irand 7)
  # gain (slow 17 $ range 0.85 1 perlin)
d9 -- Chopped winds
  $ mask "<f!3 t f!4 t!56>"
  $ someCyclesBy "<1!16 0!112>" (|* gain (slow 16 $ range 0.3 1 saw))
  $ whenmod 8 4 (chop "<16!3 8>")
  $ "space:3"
  # speed (range 0.35 "<1!12 1.5!4>" saw)
  # room 0.8 # sz 0.9
  # legato 4
  # pan 0.9
  # gain (slow 64 $ range 0.5 0.75 saw)
