setcps 0.5

d1 -- kick varie
$ whenmod 8 6 (# silence)  -- pont mesure
$ s "[k|k|k|~] [k [k|~|~|~]]? [k|k|~] ~"
# s "kick:10"

d2
$ whenmod 8 6 (someCyclesBy 0.9 (# silence))  -- pont mesure
$ sometimesBy 0.05 (# n 6)
$ sometimesBy 0.1 (# n 5)
-- $ (0.5 ~>)
$ s "sn:1(3,8,<0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7>)"
# gain 0.9
# pan 0.7

d3 -- cymbale
$ whenmod 16 14 (sometimesBy "0.6 0.7 0.8 0.9" (#s "hh:10"))
$ sometimesBy "0 0 0 0.05" (#s "hh:8")
$ s "h(3,8) h(3,8,<0 <2 4>>)"
# s "hh"
# gain (slow 16 $ sine * 0.6 + 0.6)

d4 -- Good ol' drumrol'
$ whenmod 32 30 (# s "dr:6") . (degradeBy "0 0 0.8 0") . (|- gain 0.2)
$ whenmod 16 14 (# s "dr:1") . (degradeBy "0 0.1 0.1 [0.1 0]")
$ whenmod 8 6 (|+ gain 0.2) . (fast 2)
$ s "dr*8"
# gain 0.85
# pan (slow 16 $ tri)

d5 -- basse reguliere
$ swing 3
$ note (scale "melodicMajor" "<0 0(3,8) 0 0> . <3(3,8) 3 3 3> . <5 5 5(3,8) 5> . <7 7 7 7(3,8)>")
# s "bassWarsaw"
|- note 24
# pan 0.8
# gain (slow 16 $ sine * 0.2 + 0.75)

d5 -- harpsichord/organ
$ swingBy ("<0.5 0.25 0 0.25>") 8
$ whenmod 8 6 (degrade) -- pont mesure
$ whenmod 64 48 (# pan (0.25 + rand * 0.75))
$ whenmod 64 32 (someCyclesBy 0.8 (# crush 4))
$ whenmod 32 16 ( -- accompagnement graves
  superimpose ((# s "organTonewheel0") . (|+ note (scale "melodicMajor" "-14")) . (# pan 0))
  )
$ whenmod 16 8 (rev)
$ sometimesBy 0.25 (0.125 ~>)
$ someCycles (off 0.125 (|+ note 0))
$ note (scale "melodicMajor" "[0 | 0*2] <3 3 2 2> <5 5 5 [5|5|5|9]> 7")
# s "organTonewheel4"
# pan 0.2
# gain 0.65

d7 -- final aigu tension
$ someCycles (segment 4 . degrade . rev)
-- $ whenmod 64 54 (# silence)
$ whenmod 64 50 (degrade)
-- $ whenmod 64 54 ((<| s "s*4 s*4") . (# note "<7 0>"))
$ whenmod 64 48 (
  segment 16 . degradeBy 0.75 .
  (<| s "s*2 s*2") . (# note "<5 0>"))
$
whenmod 64 40 (
  segment 8 . degrade .
  (<| s "s*2 s*2") . (|+ note "5")
)
$ whenmod 64 32 (
  segment 4 . degradeBy 0.25 .
  (<| s "s*2 s*2") . (|+ note "3")
)
$ whenmod 64 16 (<| s "s s")
$ whenmod 64 8 (<| s "s")
$ slow 2
$ superimpose (|+ note (scale "major" "[<3 3 5 5>,7]")) . (|- gain 0.1)
$ note (scale "melodicMajor" "<0 <7 4>>")
# s "superhoover"
|+ note 12
# gain 0.7
# attack 0.8
# release 0.8
