Split measures report wrong beat information in status bar

• Sep 9, 2020 - 20:02
Reported version
S4 - Minor

I can't confirm this was different before the fractions were introduced in version 3.1 I think so I'm not sure it's a regression.

When you split measures, the fraction for the actual duration of the measure is reduced. This causes the reported beat of a selected notes to be reported incorrectly at times.

For example, split a 4/4 measure into two 2 beat measures and the actual duration will be reported as 1/2. Enter 2 1/4 notes into this measure and select the second note and it will be reported as being on beat 1.5.

When a measure is split, the current time signature should be taken into account. The example above should have two measures with an actual duration of 2/4 rather than the reduced 1/2. This is not always possible. If a 4/4 measure were split on beat 1.5 there is no choice but to set the actual durations as 3/8 and 5/8 since fractions do not support numerators that are not whole numbers.

This issue was found while researching and fixing #310223: Select>More... does not select notes on "Same beat" of short measures which currently relies on the actual duration reduction so this needs to not break that PR.


Offhand, I think it makes more sense to simply change the split function to not reduce fractions, and then I would no other PR would be needed. Unless of course that breaks something else that depends on reduced fractions.

I see the problem in the code having to do with the Split Measure functionality, and as mentioned, there's a reduction of the fractions here.

The problem with simply removing the reduction is that there needs to be some type of reduction as the inner workings do something weird where like, e.g., 4/4 split into half results in 8/16 Actual Measure Duration results. On the one hand, some reduction is required, but not full-blown GCD reduction. One way to fix the problem as I see it is to let the fractions be reduced as it currently is, but then multiply them if the resultant denominators are less than the original measure's Actual Measure denominator afterwards to be equivalent to the original denominator of the original Actual Measure duration (Note: Don't equivocate to the actual Time Sig so that multiple split functions will still work decently).

Status PR created fixed

Fixed in branch 3.x, commit aa2462385b

_Fix #310248 - Correct Actual Duration of Split Measures +collect_artifacts

Fix #310248 - Correct Actual Duration of Split Measures +collect_artifacts_

Fix version