resetCycles
-- ElectricFunk: TODO less electric feel bass

do
setcps (110/60/4)
let gDjfLeg = (whenmod 64 32 (# djf (slow 32 $ range 0.2 0.8 sine)))
let gDjf = (whenmod 64 32 (# djf (slow 32 $ range 0.1 1 sine)))
d1
  $ every' 8 7 (mask "f . t f")
  $ gDjf
  -- $ slow 2 -- TODO Intro
  $ "jazz*4"
  # gain 0.65
d2 -- hit roll
  $ every' 8 7 (mask "f!7 t")
  $ gDjf
  $ fix (|* gain 0.9) ("dr")
  $ whenmod 32 16 (fast "<2!3 [2 2 1 2]>")
  $ s "<h*4 h*4 h*4 [h*4 <~!3 [~ h*2]>]>"
  # s "[hh,drum:2]"
  # release 0.5
  # gain 0.48
  # pan 0.4
d3 -- electric feel bass
  $ gDjfLeg
  $ superimpose ( -- ELECTRIFY
    (# "superhammond")
    . (# voice 9)
    . (# legato 1)
    . (# room 0.2)
    . (|* gain (slow 16 $ range 0.5 0.65 saw)
    )
  )
  $ whenmod 32 8 ( -- quinte
    superimpose ((|* gain 0.8) . (|+ note 7))
  )
  $ note (
    scale "major" (
      cat [
        " [d ~]  [d ~] ~ . ~ [~ cs]",
        "cs [cs d] ~ ~ . ~  <~!3 d>"
      ]
    )
  )
  # s "supersaw" # voice 0.1
  # octave 3
  # gain 0.3
d4 -- Lead clav
  $ whenmod 64 32 ( -- Mute lead
    mask "t <f!3 t>!3"
  )
  $ gDjf
  $ loopAt 2
  $ slice 8 "0 1*<1 2> 2 [~ 3]"
  $ slice 8 "<[0 .. 7]!4 [0(3,8) <7 <6 4>>*6]!4>"
  $ "fclav:4"
  # cut 4
  # pan 0.3
  # gain 0.6
d5 -- Side epiano
  $ every' 8 7 (mask "f!3 t")
  $ mask "<f!8 t!24 [t f] f!7 t!24>"
  $ jux (
    (# cut 41)
    . ("q" ~>)
    . (|* gain (slow 8 $ "<0.7 0.8>"))
  )
  $ whenmod 32 16 (slice 4 ("<0!3 1>"))
  $ whenmod 8 7 (rev)
  $ whenmod 4 3 (slice 4 (run 8))
  $ loopAt 2
  $ "fepiano:7"
  # gain (slow 64 $ range 0.35 0.55 sine)
  # cut 4
  # pan 0.7
d7 -- claps
  $ every' 8 7 (mask "f t")
  $ mask "<[<f!3 [f!7 t]>]!16 t!16>"
  $ fast 2
  $ s "<[~ cp]!3 [~ cp . cp ~]>"
  # room 0.6
  # dry 0.99
  # n 1
  # pan 0.7
  # gain (slow 16 $ range 0.65 0.7 cosine)


-- TODO STEAL RYTHMS
