-- Briquets: essayons d'ALLUMER LE FEU
once $ s "[lighter:6/2,pebbles]" # release 0.2 # speed 2 # attack 0.3

setcps 1

d1 -- briquet
$ whenmod 64 57 ( -- silence
    const $ s "~"
)
$ whenmod 64 56 ( -- souffle final
    const $ n "2*4 1" # s "wind" # release 2
)
$ whenmod 64 32 ( -- le feu!
  const $ s "[fire,fire?]"
  # release 3
  # pan rand
  # gain (choose [0.8, 0.6])
)
$ whenmod 64 31 ( -- étincelle
    const $ s "[lighter:6/2,pebbles]" # release 0.2 # speed 2 # attack 0.3
)
$ sometimesBy 0.4 (const $ s "wind:1?,wind?" # speed 0.5 # gain 0.6) -- parfois du vent
$ sometimes (off 0.5 id) -- retente
$ sometimes (off 0.25 id) -- retente
$ almostNever (off 0.375 id) -- retente lentement
$ almostNever (off 0.125 (|> 3)) -- dérape
$ sometimesBy 0.3 (|> 6) -- grosse étincelle
$ euclid "<1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 2 1 2 4 2 4 6 7 6 7 8 7 6 8 8>" 8
$ s "lighter"
# n (choose [0,1])
# pan 0.3



d2 -- guitare du feu!
$ whenmod 64 56 ( const $ s "~" ) -- silence
$ whenmod 64 38 (# gain 0.4)
$ whenmod 64 35 (# gain 0.5)
$ whenmod 64 34 (# gain 0.6)
$ whenmod 64 33 (# gain 0.5)
$ whenmod 64 32 (# gain 0.4)
$ whenmod 64 33 (const -- victoire!
  $ fast 2
  $ note "<[0 <2 4>] 0>/4"
  # s "sitar:1"
  # legato 2
)
$ s "~"

-- DEV: guides
d8 $ every 64 (# gain 1)
$ s "cp"
# gain 0

d9 $ n "<0 1 2 3 4 5 6 7 8 9 [1, 0] [1, 1] [1, 2] [1, 3] [1, 4] [1, 5]>"
# s "numbers"
# gain 0.7
# pan 0