Swing playback gets confused with a quaver-length anacrusis

• Jul 17, 2014 - 17:27
Type
Functional
Severity
S4 - Minor
Status
closed
Project
Tags

When playing back a score with a quaver anacrusis, swing playback will stretch out the wrong quavers, even if playback is started from the start of the first full bar.
Expected:
short | long short long short ...

Played:
long | short long short long ...

(Where | is a barline)

To reproduce, either make a score with the wizard and select an upbeat bar of length 1/8, or just change the first bar of an existing score to have length 1/8.


Comments

Good catch. shredpub: see the code for the old 1.x implementation:

http://sourceforge.net/p/mscore/code/HEAD/tree/tags/mscore-1-3/mscore/m…

It notices the irregular measure and calculates an offset.

It will have to work differently in your code I'm sure, but the basic idea should be the same. Get the measure from the chord, I guess. Only adjust for the first measure; other measures can be treated as is if you use rtick() instead of tick(0 (returns tick relate to measure start).

Yes. The change from tick() to rtick() in determining the start time of the notes means that irregular measures like pickups / anacruses will no longer throw off subsequent measures. But it doesn't help the irregular measure itself.

The treatment of irregular measures is a bit tricky. The pickup / anacrusis needs to be treated as if the "missing" beats come from the beginning of the measure (and hence reverse the swing), but other irregular measures may well need to be treated as if the "missing" beats come from the end of the measure (and hence *not* reverse the swing).

For instance, if you use the convention that says a pickup /. anacrusis at the beginning of a piece needs to be balanced by its complement at the end of the piece, that final measure will need to be treated "normally" - long-short. Also, if a work consisting of multiple movements has a pickup / anacrusis on any movement but the first, that will appear to be an irregular measure in the middle of the score. Then there is the case of a user splitting a measure, like to start the next line of lyric at the start of a system. The first part of the split measure is normal, the second part reversed.

It's probably impossible to make this perfect in all cases, but here's how I propose we handle it (edited after further discussion on IRC):

We will reverse the swing for any irregular measure *only in the following cases*:

- first measure of score
or
- first measure after any explicit break (line, page, system) or frame

BTW, by "irregular", I really mean, any measure with an actual duration that differs from the nominal duration by something other than a whole number of swingBeats. So for ordinary eighth note swing, we won't reverse 4/4 measures whose actual duration is set to 3/4 - only if set to 1/8, 3/8, 5/8, 7/8, 9/8, etc, or 3/16, etc.

I am not sure how easy it is to detect these conditions, but I assume it can be done.

So in one sentence:
odd (in terms of swing beats) irregular (nominal and actual differ) measure, if 1st bar of score or 1st after en explicit (!) line-, page- or section break or vertical- or horizontal (? Coda?) frame should get the swing reversed.