import Sound.Tidal.ParVagues.Control

once $ "dr"

resetCycles

-- Lucy Rode
do
  let chord = "ds3'major7'6"
  let chorus = pF "chorus"
  let mix = pF "mix"
  let modIndex = pF "modIndex" -- 0.2
  let vibrato = pF "vibrato"
  let g  = (# djfbus 1 (range 0.02 0.98 "^49"))
  let g2 = (# djfbus 2 (range 0.1 0.9 "^50"))
  setcps (60/60/4)
  d1 $ g -- Beat
    $ fast 2
    $ midiOn "^41" (<|  "k k k <k!3 <k k*2>>")
    $ midiOn "^42" (<| "k . k <~ [<~ k> <k ~>]>")-- RubADub
    $ midiNo "^41" "^42" (<| "<k <k*2 k(3,8)>>")
    $ "[jazz,kick:5]"
    # midiG' "^78" 0 1.5
  d2 $ g -- Break
    $ midiOn "^43" (scramble 4 . often (ply 2))
    $ midiOn "^75" (struct "t*[8 16]")
    $ slice 4 (run 8)
    $ loopAt 1
    $ "break:15"
    # pan 0.35
    # cut 2
    # speed (range 0 2 "^51")
    # midiG' "^79" 0 1.6
  d3 $ g -- Drumroll
    $ midiOn "^44" (ply 2)
    $ midiOn "^76" (ply 2)
    $ midiOn "^41" (
      (# room 0.4)
      . (# dry (slow 64 $ range 0.5 1.5 perlin))
    )
    $ whenmod 4 3 (fast "<2 4 [4 8] 8>")
    $ fast "2 4"
    $ "[drum:2,dr]"
    # pan 0.7
    # midiG' "^80" 0 1.8
  d4 $ g2 -- Bassline pompée
    $ midiOn "^89" (chop 2)
    $ midiOn "^57" (ply 2)
    $ note (scale "aeolian" (
      "0*8"
      |+ (fast 4 $ arp "up"
      "<ds3'major7'4!2 <ds3'major7'4 [ds3'major7'4|ds3'major7'6]> ds3'major7'8>")
      + "<0!6 7!2>"
    ))
    # "bassWarsaw"
    # crushbus 41 (range 10 2 "^53")
    # room 0.4
    # pan 0.2
    # midiG' "^81" 0 1.8
  d6 $ g2 --Rhodes arps
    $ midiOn "^58" (+| note (arp "converge up" "[0,12,0,12]*8"))
    $ juxBy 0.8 (
      (# modIndex 15)
      . (# cut 61)
    )
    $ note (scale "aeolian" (
      (arp "up" chord)
      +| "0*<2 4 4 2> 7(3,8)"
    ))
    # "FMRhodes1"
    # cut 6
    # midiG' "^82" 0 1.8
    # room 0.2 # dry 2 # sz 0.8
    # pan 0.8
    # crush (range 10 3.7 "^54")
    # modIndex (range 0 4.19 "^34")
  d7 $ g2 -- Hope's Hammond
    $ ("0.125" ~>)
    $ fast 2
    $ midiOn "^59" (
      sometimesBy "^35" (superimpose
        (# voice 7) . (|* gain 0.8)
        . (|- note 12)
      )
      . sometimesBy (1 - "^35") (|* gain 0.65)
      . fast 2
      . (|+ note 12)
    )
    $ note (("[0 12 0 <~!6 12!2>]" |+ (slow 2 $ arpeggiate chord)))
    # "superhammond"
    # voice 6
    # octave 6
    # room 0.5 # sz 0.6
    # pan 0.74
    # sustain (range 0.125 0.5 "^55")
    # midiG' "^83" 0 1
  d10 $ g -- Le clap des abysses
    $ "~ c ~ [c*<1 2> ~]" # "cp"
    # room 0 # sz 0 # dry 1
    # note "-4"
    # midiG' "^84" 0 1.2
