Question about playdate.sound.sequence:goToStep when play=true

I'm using the simulator on Mac.

I had the idea of playing a midi along with the crank, kindof like a music box. I've figured out how to get a midi file to play normally with a synth I've configured.

Now I'm looking at playdate.sound.sequence:goToStep. The documentation says that when the second argument, play, is true, then it will trigger the notes at that step. Can I get this to work when the sequence is stopped, so that I can just manually go through the sequence as the crank turns?

I wonder though if maybe that's not how goToStep is supposed to work at all and instead the function is just for scrubbing back and forth or for setting the start point for when sequence:play() is called?

Would it be possible to play midi files one note at a time, or would I have to encode notes into arrays and walk over them manually?


You could use setTempo and set it to something like 1 step per second, then use goToStep with play set to yes as the player cranks. If the user hasn’t cranked in 1 second stop the player so it doesn’t keep playing, using a timer to fire off a callback once per second or every 3 seconds or something. Or just set the tempo to something absurdly long, like 1 hour per step, so it only realistically triggers notes when using goToStep and leave it playing.