setcps 0.5

scaleBocal = (scale "aeolian" (slow 4 $ "<0 <2 3>>"))

d1
$ whenmod 16 15 (>| note "0*4 . 0(7,8)")
$ whenmod 8 6 (>| note "0")
$ note "0 <0 ~> ~  . ~ . 0 . <~ [0 ~ ~]>"
# s "jazz"
# lpf (slow 16 $ range 50 2500 sine)

d2
$ whenmod 16 8 (# silence)
$ s "~ <s [~ s|s ~ s s]> ~ <s [s*2|~|s s ~ s]>"
# s "snare:2"
# gain 0.9

d3
$ whenmod 16 12 (
  (# speed (slow 4 $ range 1 2 saw))
. (# gain (slow 4 $ range 0 0.8 isaw))
  )
$ whenmod 16 8 (juxBy 0.3 rev)
$ degradeBy (slow 4 $ "<1 0.75 0.5 0.25> <1 0.5 0.4 0.2>")
$ s "d*16"
# s "drum:8"

d4
$ someCycles (fast 2)
$ whenmod 16 12 (# gain (slow 4 $ range 0 0.8 isaw))
$ whenmod 64 32 (-- chopped downgliding on 3/4
  whenmod 4 3 (
  superimpose $ chop 2
   . (# accelerate (-0.1))
   . (# gain 1)
)
)
$ whenmod 8 5 (# accelerate "<0.125 0.125 0.25 0.5>")
$ note "0"
# s "supersaw"
# voice 0.1
# gain 0.8
# note (scaleBocal - 24)

d7 -- aigu fou
$ whenmod 128 65 (# gain 0.6)
$ whenmod 128 64 (# gain (0.6 * tri))
$ degradeBy (slow 4 $ "<0,0.05 .. 0.5>")
$ off (5/16) (# velocity 0.3)
$ superimpose ((# gain 0.6) . (# s "cheapPiano1"))
$ s (slow 1 $ "<b [b b? <~ b> <~ b?>] b*4 <b*8 [b*4 b]>>")
# note (scale "aeolian" ((slow 4 $ "<0 <2 3>>")
 + "0 12" + (iter 4 $ "0 <1 1*2> 2(3,8)")))
# s "superpiano"
# velocity (slow 32 $ sine * 0.3 + 0.5)
# gain 0

d6 -- Sirene occasionelle accordée
$ whenmod 64 32 (# gain 0.5)
$ s "supersiren/4"
# note scaleBocal
# gain 0

d8 -- insects / scratch birds
$ often (
  superimpose $ (# s "birds3") . (# n (irand 7)) . (|- gain 0.1)
)
$ euclid (slow 2 $ "<1 3 5 7 8>") 8
$ s "insect" # n "[1?, 2?]"
# gain (slow 42 $ range 0.3 0.8 sine)
# room 0.2
