-- SirenBeat
setcps 0.45

do
  d1 -- reverbkick varie
    $ every' 16 13 (fast 2)
    $ whenmod 16 13 (# gain 1) -- fin break 1
    $ whenmod 16 10 (# gain 0) -- break 1
    $ (# s "reverbkick")
    $ fix ((# note 0) . (# lpf 2000)) (s "h")
    $ fix ((# note 1) . (# lpf 5000)) (s "l")
    $ s "h . ~ <~ l> . ~ [~|~|h] . <~ l> <l ~>"
    |- note 2
    # pan 0.2
    # gain 0.6
  d2 -- amen sur 8
    $ whenmod 16 10 (# gain 0) -- break 1
    $ whenmod 16 8 (off 0.125 (|+ n 7))
    $ off (1/16) degrade
    $ every 2 (sometimes $ degrade . fast 2)
    $ someCyclesBy 1 (sometimes (# n "[4|4|2]"))
    $ s "a(<<3 4> <5 8>>,8)" # n "5 2 [1|1|3] 0" # s "amencutup"
    # gain (slow 64 $ range 0.5 0.8 sine)
    # pan 0.8
  d3 -- Drumroll
    $ superimpose ( -- hats
      (# s "superhat") . (# sustain (slow 8 $ sine * 0.1 + 0.1)) . (|- gain 0.1))
    $ whenmod 8 4 (fast "<1 2> . 2 <2 1>")
    $ sometimesBy "0 <0.5 0.5 0.75 0.25>" (off (1/16) id)
    $ s "d*8"
    # s "dr"
    # gain (slow 32 $ sine * 0.5 + 0.4)
    # pan (slow 8 $ 0.2 + tri * 0.8)
  d4 -- Hats motif rythme
    $ sometimesBy (slow 4 $ isaw) (slow 2)
    $ arp (slow 4 $ "<up [up updown] updown down [down up] downup>")
    $ n "f'maj e'min d'maj ~"
    # s "superhat"
    # sustain 0.2
    # gain 0.5
  d5 -- Sirene
    $ s "supersiren/4"
    # note (slow 4 $ "<f e c e5>"
    - 36)
    # gain 0.6
  d6 -- basse motif
    $ whenmod 16 10 ( -- break 1
      superimpose (# s "subBass2") . (|- gain 0.1))
    $ whenmod 60 64 (swing 2)
    $ arp (slow 8 $ "<thumbup [thumbup down] downup [downup up]>")
    $ note ("f'maj e'min d'maj ~"
    + (slow 4 $ "<0 4 2 <0 12>>") -- descente
    - 24)
    # s "subBass1"
    # gain 1
    # room 0.4 # size 0.2
  d7 -- sometimes, slow bass synth
    $ whenmod 64 61 (chop 2)
    $ whenmod 64 60 rev
    $ whenmod 64 32 (every 4 (# gain 0.8))
    $ n "f'maj ~ e'min ~ d'maj ~"
    # s "bassWarsaw"
    # legato "1 1 2 ~"
    # sustain "1 1 4 ~"
    |- n 24
    # gain 0.4
  d10 -- scratch moineau!
    $ sometimesBy 0.2 (off (1/32) id)
    $ degradeBy "0 0.1 0.8 0"
    $ euclid (slow 8 $ "<3 5>") 16
    $ n "0"
    # s "birds3"
    # n (choose [0,0,2])

d11 $ s "birds/4" # n (irand 6) # speed (0.5 + rand * 2)
# gain (0.4 + rand / 2)

-- SANDBOX



d1 -- regulo techno
-- $ whenmod 16 10 (# gain 0)
$ (# s "clubkick:2")
$ fix ((# note 0) . (# lpf 2000)) (s "h")
$ fix ((# note 1) . (# lpf 5000)) (s "l")
$ s "h l? . h <~ l> . <h h h [~ h]> . h <h? [h|h|~]>"
|- note 2
# gain 0.8



d5 -- lead
-- $ whenmod 16 10 (# gain 0) -- break 1
-- $ whenmod 4 2 (sometimes rev)
-- $ whenmod 8 4 (sometimes $ degradeBy 0.25)
$ every 4 (chunk 4 (|- n "[5,12]" )) -- variante chunkee quinte
$ (superimpose $
  arp (slow 4 $ "<up [up updown] updown down [down up] downup>")
  . (|+ gain 0.3)
  . (|- note 24)
)
$ note ("f4'maj e4'min d4'maj ~")
# s "supersiren"
# sustain 0.25
# gain 0.4
