import Sound.Tidal.ParVagues.Control


-- Dark Money: Downtempo dark minor LoFi
do
setcps (60/60/4)
let modIndex = pF "modIndex"
let whenIntro    pat = someCyclesBy "<t!8 f!24>" pat
let whenNotIntro pat = someCyclesBy "<f!8 t!24>" pat
let whenBrk      pat = whenmod 16 10 pat
let whenNotBrk   pat = someCyclesBy "<t!10 f!6>" pat
let whenBrkLPF  = whenBrk (# lpf "<400 200 100 50 0 0>")
let gDJF = (# djfbus 1 (range 0.05 0.95 "^49"))
let g = (gDJF)
d1 $ g -- Kick
  -- $ whenBrkLPF
  $ whenNotBrk (# sz "<0.8 0.9 0.95 0.99>")
  $ midiOn  "^41" (<| "k*2 k*2 k*2 k*<2 4>")
  $ midiOff "^41" (<| "k . k(<3 <5!3 [5 8]>>,8,<0!5 3 0 3>)" )
  $ midiOn "^41" (superimpose (# "kick:5"))
  $ midiOff "^41" (superimpose (# "reverbkick"))
  $ "[reverbkick,jazz]"
  # legato 2 # cut 1
  # midiG' "^78" 0 1.2
d2 $ g -- Contretemps snare
  -- $ whenBrkLPF
  $ midiOn "^43" (fast "<2 2 4 2>")
  $ whenmod 16 8 (fast 2)
  $ whenmod 8 6 (mask "<f [f t]>")
  $ superimpose (# hpf 500)
  $ "~ s"
  # "snare:20"
  # midiG' "^79" 0 1.2
d3 $ g  -- Drumroll fantôme
  $ midiOn "^76" (fast "<2!3 4>")
  $ midiOn "^44" (fast "2")
  $ whenBrk (slow "<2 2 4 4 8 8 16 16>")
  $ fast ("8" * "<[2 1!7] 1!3> <2 [2 1] [2 . 1 2] [2 4]>")
  $ "drum:2"
  # room 0.6 # sz 0.9 # dry 1.01
  # midiG' "^80" 0 1.8
d5 $ g  -- Bassline {hypno,aqua}tique
  $ swing 2
  $ whenNotBrk (off "<e q> . <q h>" (|+ note 7))
  $ struct "t*<[1 0] 2 4 [12 . 8]>"
  $ note ("fs a" - 24)
  # "bassWarsaw"
  # crushbus 51 (range 10 5.2 "^53")
  # midiG' "^81" 0 1.5
d6 $ g  -- FMRhodes Arps <3
  -- $ midiOff
  $ note ("fs a"
  |+| "0 . <7 [7 12] [12 7] 12*4>(<2 <3 5>>,8)"
  + "0 12"
  - 24
  )
  # "FMRhodes1"
  # modIndex (range 0 15 "^34")
  # crushbus 51 (range 10 5.2 "^53")
  # midiG' "^82" 0 1.3
d10
  $ "~ clap:1"
  # note (range "-12" 12 "^55")
  # midiG' "^83" 0 1.5
d4 $ g -- Toy bogdan
  $ every' 16 15 (>| "~ ~ ~ bogdan:4") -- Money
  $ every' 8 5 ((>| "~ ~ ~ bogdan:2") . (|* gain 0.8))
  $ "~ bogdan"
  # room 0.5
  # legato 2
  # hpf 200
  # midiG' "^84" 0.5 1.4