-- Break Toys: Breakbeat + random toys/noise
-- Tags:
-- Ready: 5/10

do
  unsolo 1 -- kick
  unsolo 2 -- snares pistols
  unsolo 3 -- toys broken
  unsolo 4 -- arpy
  unsolo 5 -- choirs
  unsolo 6 -- glitchs
  let gBreak = 0.75
  let gChoir = 0.8 * "<0!32 1!32>"
  setcps 0.3
  d1 -- Breakbeat
    $ superimpose (-- BEAT
      const $ note "0*<1!4 2 4> ~ ~ 0(<1 <2 3>>,8)"
      # s "kick:5" # cut 1
      # gain 0.85
      # lpf 200
      # pan 0.48
      )
    $ slice 8 (
    whenmod 16 12 -- Pont 12
    (|> "0 <~ 1!3> 2 ~ ~ ~ 6? ~")
    $ whenmod 4 3 -- Pont frequent
    (|> "0 1 2 3 4!4")
    "0*<1 <2!3 4>> 1 2 <3 5> 4 5 <6 4> 7") $ s "break"
    # gain gBreak
  d2 -- Snares contretemps pistolets
    $ every' 4 3 ((sometimes $ jux rev) . (fast 2))
    $ sometimesBy "0 0.5" ((ply 2) . (|+ note "[-12|+6]"))
    $ s "~ s(<3!3 5>,8,3)"
    # s "snare:57"
    # pan 0.6
    # gain 0.75
  d3 -- Toys broken
    $ often ((# squiz "[2|3|4|5|8]") . (|- gain 0.1))
    $ loopAt (range 0.5 2 rand)
    $ almostNever (# crush 6)
    $ s "toys/4" # n (irand 13)
    # cut 3
    # gain 0.6
  d4 -- Lead arpyano
    $ superimpose (
      (stut 4 0.7 (1/24))
    . (arp "<up!2 thumbup pinkyup>")
    . (# room 0.15)
    . (# gain 1)
    )
    $ off 0.25 (|+ "<5!3 12>")
    $ note ("<c4'six d4'min e4'six f4'maj>")
    # s "arpy"
    # gain 0.75
    # attack 1
  d5 -- Choir
    $ often (superimpose (bite 4 "2*4"))
    $ superimpose ((|+ note "c'maj")
    . arp (slow 4 "<converge disconverge>")
    )
    $ note ("<c4 d4 e4 f4>" + "[0,-12]")
    # s "moogBass"
    # gain gChoir
  d6 -- Glitchs randomises carres
    $ often (stut' "[4|8]" 0.125 ((# crush 8) . (|* gain 0.9)))
    $ s "~ glitch" # n (irand 8) # gain 0.7

-- SANDBOX
-- Scramblebeat:

do
  d1 $ loopAt 4 $ shuffle 4 $ s "break" # gain 0.7
  d2
    $ superimpose (
      every' 2 1 (off 0.5 (|+ note "[0|12]")
      . whenmod 4 2 (off 0.125 id) -- Souvent double
      . (|+ note 24) -- Aigu
      . mask "t(1,4)" -- Base
    )
    )
    $ degradeBy "0 0.25 0.5 0.75"
    $ arpeggiate
    $ note ("<c3'six!3 d3'six f3'six g3'six>")
    # s "superpiano"
    # velocity 0.45
