Score doesn't start playback after a certain length (including repeats) and crashes if started before and reaching that limit
I have a bit of an odd situation but it happened so here we go...
I use Musescore to organize my practice sessions, write exercises, adjust number of repetitions for exercises , etc, so some of my scores are pretty lengthy, for example: if i have 10 patterns each is made of 4 measures each played in 12 Keys = 480 measures, say each pattern is repeated for at least 8 times (i use an auto-clicker to quickly change the "play count" of the whole score) so its fairly common for me to have a score that is actually thousands of measures long when considering the repeats.
Also I can also imagine someone could need to make a very long score if he/she is making an exercise book on Musescore
the problem is:
On these longer scores Musescore refuses to play beyond a maximum number of bars, ie when selecting a measure near the end it doesn't play and rewinds to the beginning of the score. I tried this on several computers and i always get the same result
you can easily replicate the bug following these steps:
1- Create a new score
2- Create a repeat sign to encompass the first 3 measures
3- Right-click on the 3rd measure to set play count
4- Enter 9999 as the play count and click OK
5- select the forth measure and press space bar to start playing
6- Nothing will happen
7- Press space-bar again playback will restart from the very beginning of the score
So as the title said... What is the maximum length for the score ?
Thank you in Advance
Attachment | Size |
---|---|
test.mscz | 4.76 KB |
Comments
There is no maximum, practically. Theoretically you can't have more than 2147483647 measures, I believe
The issue tracker is not for asking questions (that's what the forums are for), but for reporting bugs
If your question "what is the maximum value for repeats", the answer seems to be:
a) 9999 (as you found out) is the max value you can have in the measure's properties
b) but that doesn't really work. The real value (where the playback does start properly) seems to be 8115 (found by experiment)
c) even that value causes a crash after playing some measures...
So we may turn this into a bug report...
i certainly cannot play 2147483647 bars on musescore, the number is less than 30000 bars, if it happens consistently it is a bug
Sample score needed.
You might be able to play the said number of bars with no repeats, but when having repeats in the score the total amount of bars is less than 30000 for some reason,
Thank you Sir
I attached an example, scroll down to measure 650 and the file wont play
Your're right, playback doesn't work after measure 24348 (in a 4/4 timesig) and even chrashes when starting before but reaching at that spot.
See no-playback+crash.mscz
Go to the last page and start playback at measure 24349 or later: jumps back to measure 1
Go to the last page and start playback at measure 24348 or earlier: MuseScore crashes
MuseScore 3.6.2, Windows 11
And yes, you do reach/exceede those 24348 measures with a 8116 times repeat of 3 measures too (8116 * 3 is 24348)
See test_0.mscz
24.348 * 4 is 97392 quarter beats, it crashes on 97393
Stack trace
1 Ms::Seq::process seq.cpp 986 0x475908
2 Ms::paCallback pa.cpp 52 0x78254b
3 portaudio!Pa_WriteStream 0x7ff967125258
4 portaudio!Pa_WriteStream 0x7ff9671258aa
5 portaudio!PaWasapi_ThreadPriorityRevert 0x7ff96713e06c
6 portaudio!PaUtil_InitializeX86PlainConverters 0x7ff9671694d4
7 KERNEL32!BaseThreadInitThunk 0x7ff980cc54e0
8 ntdll!RtlUserThreadStart 0x7ff9816c485b
9 ??
A time-related variable overloading? Slow the tempo and it crashes sooner, speed it up and it crashes later. somewhere around 12½ hours?
Well, no workaround really, other than keeping the score shorter, but I guess that doesn't count
Yes! The crash indeed depends on the tempo (too)! So the above crashes reproduce at the default of 120 BPM
More like 13½ hours apparently: 13 h, 31 minutes and 35 seconds (or 48695 s)
So far I can't replicate the crash in master, only the playback issue
3.5.2 crashes on that too
2.3.2 does crash on it too
1.3 does not (it doesn't playback those sample scores, need to have notes in there, but then it just works)
So a 2.0 regression
Upon debugging the crash I've encountered some initial close-to-overflow values around that area:
playFrame: 2147471568
(close to signed 32-bit overflow)framesRemain: 4294955216
(which seems to be already wrapped from -12080?)It's the latter that is used as a loop boundary to access the buffer, but the buffer is not that big, so an indexing/buffer overflow likely happens.
playFrame
is anint
. Guess is should rather be anunsigned
or evenunsigned long long
?Edit: doesn't help, still crashes
Given that master doesn't crash and no further 3.x's are foreseen; I'd propose we revisit this after 4.0 alpha to see where/how the max score limit is achieved/handled there.
I'd still like to fix it for 3.x too though.