-- Arène: Battle de piano
-- Tags: Hip-Hop, piano, energique
-- Ready: 8/10 (Melody+, Variations+, Parts+)
resetCycles

do
  solo 1 -- Beat anticipateur
  solo 2 -- Snare contretemps rushé
  solo 3 -- Drumroll metronomique
  solo 4 -- Toms+hats balancés (TODO less digital toms)
  solo 5 -- Piano J1
  solo 6 -- Piano J2
  setcps (120/60/4)
  d1 -- Kick écho décalé
    $ whenmod 16 12 ( -- Break silence
      mask "t(1,2)"
    )
    $ whenmod 4 3 (
      (>| n "0(3,8) . ~")
      . (|+ gain "0 0.05 0.1 0.15")
    )
    $ whenmod 16 4 (juxBy 0.25 ( -- Echo decale
      (slow 4 "<0.5 0.125>" ~>) . (|* gain 0.85)
    ))
    $ n "0"
    # s "reverbkick" # gain 0.85
    # cut 1
    # lpf (slow 16 $ "<10000 5000 2500 1000>")
  d2 -- Snare contretemps rush final
    $ juxBy 0.7 (# crush 8)
    $ whenmod 16 12 ( -- Break silence
      fast "<0!4 1 2 4 8>"
    )
    $ s "~ snare:48"
    # gain 0.7
    # note (slow 2 "<0 1>" - 6)
  d3 -- Metrono-roll
    $ whenmod 16 12 ( -- Break silence
        slow "<2!6 [0.5 0.25] 0.25>"
    )
    $ someCyclesBy "<0!3 <0.5!3 0.75>>" (almostAlways $ fast "2 [2|4]")
    $ s "dr*4" # gain 0.85
    # pan "<0.3 0.7 [0.3 0.7] [0.7 0.3]>"
  d4 -- Toms + Hats
    $ superimpose (
      someCycles (degradeBy "0 0.5!7")
      . (# s "hh:0")
      . (# note "<0!3 <-2 2>>")
      . (# crush 16)
      . (# pan (slow 2 $ range 0.4 0.6 sine))
      )
    $ every' 2 1 (often ((1/16) ~>))
    $ whenmod 64 32 (juxBy 0.7 rev)
    $ whenmod 32 16 (hurry 0.75 . fast 2)
    $ s "[808lt(5,8,<0 4>),808mt:1(<3!3 5!3>,8,[0|3])]"
    # gain 0.7
    # pan 0.45
    # lpf (slow 4 $ range 1200 600 sine)
  d5 -- Piano J1
    $ swingBy (slow 16 "<0!2 1/3 0.5>") 8
    $ mask (slow 16 $ "<f t>") -- Rounds
    $ note (
      "0!6 [~ 0] <-2!3 3 -2!2 3!3 7 9 7 5 3 -2!2>" -- rythme+melody 16
       + "d4")
    # sustain (1/4)
    # s "superpiano"
    # velocity (0.75 - (perlin * 0.15))
    # gain 0.75
    # room 0.35 # sz 0.6
  d6 -- Piano J2 accords fous !
      $ mask (slow 16 $ "<f f t t>") -- Rounds
      $ note (
        "[<0!15 0?> <0!7 ~> <~!3 0> 0]*4" -- rythme fou
         + "<d6'maj f6'maj c6'min d6'maj>")
      # sustain (1/4)
      # s "superpiano"
      # velocity (0.6 + (perlin * 0.15))
      # gain 0.6
      # room 0.3 # sz 0.8 # dry 1.1
