-- Laser roll: techno

setcps 1

do
  let melody = "<3!4 0!4 3 2 0 3>"
  d1 -- lightly varying kick
    $ sometimesBy "0 <0 0.25>" (off 0.25 id)
    $ s "k*2"
    # s "jazz"
    # gain 0.8
  d2 -- laser rolled!
    $ sometimes (stut 3 0.9 (1/50))
    $ s "bd" >| speed (segment 50 $
      range -- Randomized lines :mad:
      (slow 4 $ "<5 6 7 8>")
      melody
      saw
      )
    |+ note (scale "aeolian" melody)
    # gain 0.2
  d4 -- drumroll
    $ sometimesBy "0.9 0 0.5 0.25" (fast 2)
    $ sometimesBy "0.25 0.5" (fast 2)
    $ always (fast 2)
    $ s "dr*2"
    # s "dr"
    # note "0 0 0 [0 1]"
    # gain 0.7
    # pan "<0.4,0.05 .. 0.7>"
  d5
    $ chunk 4 (juxBy 0.1 rev)
    $ n "<0 0([3|5],8)>"
    # note (scale "aeolian" (
        melody
      ) - 24
    )
    # s "supersaw"
    # voice (slow 64 $ range 0.01 0.25 tri)
    # gain 0.6
    # pan 0.2
    # crush (slow 64 $ range 6 16 tri)
  d7 -- Space louder
    $ stut 3 0.75 0.25
    $ slow 8
    $ s "~ space:3"
    # legato 4
    # speed (rand / 2)
    # gain 0.8
  d8 -- Claps
    $ sometimes (stut 3 0.9 (1/16))
    $ s "~ ~ ~ <~ c>"
    # s "clap"
    # release (slow 64 $ range saw 0.05 0.9)
  d9
    $ slow 4
    $ every 2 (swing 2)
    $ arp "down&up"
    $ note (scale "aeolian" (
      melody + (slow 16 $ "<c'maj c'min>")
      ) - 12
    )
    # s "superfork"
    # sustain 2
    # accelerate 0.025


d3 -- simple claps
$ whenmod 64 32 (# gain "<0.64,0.01 .. 0.96>")
$ whenmod 64 28 (# gain "<0.4,0.05 .. 0.6>")
$ whenmod 64 0 (# gain 0)
$ every 8 (off 0.25 id)
$ every 4 (off 0.25 id)
$ (0.5 ~>)
$ s "jazz:4"
