Sequence:setLoops doesn't stop when it should?

I'm trying this on Windows, SDK v2.0.3 but I think the problem is older than that.

This is what I'm doing:

  1. Create a sequence, add a track, add a synth
  2. Add Notes to a track on positions 1,5,9,13 (making the sequence greater than 5 steps)
  3. Set the sequence to loop from position 1 to 5 two times
  4. The sequence plays twice, but after that it continues to the end of the sequence. Shouldn't it stop at position 5?

The sequence plays like this:

Example code:

local seq2 =
local track =

track:addNote(1, "C3", 1, 1)
track:addNote(5, "C4", 1, 1)
track:addNote(9, "C5", 1, 1)
track:addNote(13, "C6", 1, 1)

local synth =
synth:setADSR(0, 0.1, 0.6, 0)
local instrument =

seq2:setLoops(1, 5, 2)

note: it doesn't matter where I call setLoops(), the result is always the same.

I guess it's a little redundant for me to say "no I'd expect it to continue to the end of the sequence" since that's how I implemented it. Can you explain the case where you've got notes in a sequence but you don't want to play all of them? I can kind of imagine if you've got a large sequence and you want to play a section of it, though setting a loop range doesn't seem the obvious way to do that. We could add a setPlayRange() function like sampleplayer has, or add arguments to play() to set a range.

1 Like

I would love if the two had matching method names (and arguments)