Sequence breaks on excessive tempo changes

Mac SDK 1.12.3

In our game Grand Tour Legends we have a ratchet clicking sound effect playing when you're not pedalling - its trigger frequency based on the speed you're going. We tried using playdate.sound.sequence to get better timing resolution for this effect, but met with some problems:

  1. the audio engine plays garbage if a Sample is shorter than the duration of a note (which varies with tempo)
  2. we modulate the sequence tempo every frame in a very wide range, after a few seconds the sequence stops playing.
function self:startTicks()
    local inst =
    for i = 1, kTickSamples do
        local sample ='audio/tick_' .. i)
        local s =
        inst:addVoice(s, i)

    local track =
    for i = 1, kTickSamples do
        track:addNote(i, i, 1, 100)

    self.tickChannel =

    self.tickSequence =
    self.tickSequence:setLoops(0, 6)

function self:setTickSpeed(speed)
1 Like

I finally had a chance to look at this, sorry for the delay. I'm not having any luck reproducing the problem. Here's my demo, based on the above: (60.2 KB) (Source: (65.8 KB)) Hit up and down buttons to speed up/slow down the sequence.

I'm not sure what the fundamental difference is between this and yours. :thinking: If you post your tick sounds I could see if that has anything to do with it.

ha. Right after posting that I reread

we modulate the sequence tempo every frame in a very wide range

so I added sequence:setTempo(math.random(120)) to the A button. After five or six of those the sequence does stop playing. I think it's goofing up the current time offset calculation and getting so out of whack it confuses the player--when doing the up and down buttons I sometime get a bit of a stall in the sequence.

I'll take a peek in the debugger and see if that's the issue or it's something else.

1 Like

Dave, you're the best!

Any progress on this? I realise it's not top priority :smiling_face:

I finally got a fix in for this, scheduled it for 2.1.0. Sorry for the delay!

1 Like