# BOOMBOX-1 prototype 4 (the sequencer) in fm1-base's host simulator:
#   tools/build.py APP_DIR --host --no-ble, then
#   APP_DIR/build/host/boombox-1_host APP_DIR/tests/sim_808.txt OUTDIR
wait 700
shot sim_01_boot.png
wav sim_seq.wav
# the factory pattern (4 bars: beat + bass line) plays at once
expect events 100
tap PLAY
wait 3000
expect playing 1
shot sim_02_playing.png
tap PLAY
wait 2000
expect playing 0
# SHIFT + 15: clear DRUMS (the 808's 22 notes stay: 44 events, on and off)
press GLO
key w14 down
wait 40
key w14 up
release GLO
wait 100
expect events 44
# STEP mode: the kick (pad 1) on steps 1, 8, 11
tap SEQ
expect mode 1
key w0 down
wait 40
key w0 up
key w7 down
wait 40
key w7 up
key w10 down
wait 40
key w10 up
wait 100
expect steps 1153
# PRESET: pad 2 (SNARE), on 5 and 13, played rolling (13 down before 5 is seen up: each still toggles)
turn PRESET 1 30
wait 100
expect pad 1
key w4 down
wait 40
key w4 up
key w12 down
wait 40
key w12 up
wait 100
expect steps 4112
# hold step 5 and turn K1: a pitch lock (the step stays on)
key w4 down
wait 40
turn K1 5 30
wait 100
key w4 up
wait 100
expect steps 4112
expect locks 16
# hold an empty step (7) and turn K4: the step is made with its level lock
key w6 down
wait 40
turn K4 -10 30
wait 100
key w6 up
wait 100
expect steps 4176
shot sim_03_steps.png
# back to PLAY mode, REC armed, PLAY: hats played live are written (quantised)
tap SEQ
expect mode 0
tap REC
expect rec 1
tap PLAY
wait 400
key w2 down 90
wait 40
key w2 up
wait 300
key w2 down 70
wait 40
key w2 up
wait 300
key w2 down 90
wait 40
key w2 up
wait 1500
expect events >52
shot sim_04_recorded.png
# SHIFT + 8: undo the take (44 bass + 3 kicks + 3 snares)
press GLO
key w7 down
wait 40
key w7 up
release GLO
wait 100
expect events 50
tap REC
expect rec 0
# swing: SHIFT + 3, five times (54 -> 59 %)
press GLO
key w2 down
wait 30
key w2 up
wait 30
key w2 down
wait 30
key w2 up
wait 30
key w2 down
wait 30
key w2 up
wait 30
key w2 down
wait 30
key w2 up
wait 30
key w2 down
wait 30
key w2 up
wait 30
release GLO
expect swing 59
# note repeat: ARP held, the open hat held for a second (1/16: a hit every 167 ms, each 600 ms long: never silent)
press ARP
key w3 down 80
wait 1000
expect voices >0
key w3 up
release ARP
wait 500
# the STEP view while playing
tap SEQ
wait 1500
shot sim_05_steps_playing.png
tap SEQ
# stop (a tape stop)
tap PLAY
wait 2500
expect playing 0
# the whole run: nothing cut off, and the limiter worked for it
expect clipped 0
expect limgain <100
wavstop
shot sim_06_stopped.png
