import Sound.Tidal.ParVagues.Control

--
do
let gF = midiDJF "^49" 200 9800 0 2000
let gLeslie = ((# leslie "^29") . (# lsize (range 0 2.5 "^30"))  .(# lrate 6.7))
let linput = pI "linput"
let lname = pS "lname"
let g = gF . gLeslie
setcps (120/60/4)
d1 $ g
  $ midiOff "^41" (mask "<f f [t f] t t!28>")
  $ midiOn "^41"  (<| "k*4" )
  $ midiOff "^41" (<| "k [~!6 <k!3 ~>] . k*2 ~" )
  $ "[jazz,bd]"
  # midiG' "^78" 0 0.75
d2 $ g
  $ fast "<0!4 0 [0 1] 1 1 0 [0 1] 1 1 [1 2] 1 2 4>"
  $ "~ s ~ s"
  # "h2ogmsn:6"
  # midiG' "^79" 0 1.3
d3 $ "lJazzP"
  # n "<0 1 2 3 4 5 6 7>"
  # midiG' "^81" 0 1.2
  # cut 3

once $ "lJazz"


d3 -- Dubbed midi!
  $ qtrigger 1
  $ midiOn  "^57" (midiOn "^89" (superimpose (# "olooper")))
  $ midiOff "^57" (midiOn "^89" (superimpose (# "looper")))
  $ "loop"


resetCycles

do
d1 $ qtrigger 1 $ "looper" # n "<0 1 2 3 5 6 7>" # lname "lJazzP"
d2 $ "dr*4" # gain 0.8
d3 $ "jazz" # gain 0.85
d4 $ "<~!7 cp>" # gain 0.8


once $ "freeLoops"


once $ "lDrill:5" # begin 0.05 # end 0.25
  # cut 3 -- Je deviens haineux

once
  $ "lBlues"
  # gain 1.1 # cut 1

-- OVERDUB!
d1

  # gain 0.8
