Audiveris / audiveris

Latest generation of Audiveris OMR engine
https://audiveris.github.io/audiveris
GNU Affero General Public License v3.0
1.58k stars 232 forks source link

beam connects to 2nd staff too #171

Open Bacchushlg opened 6 years ago

Bacchushlg commented 6 years ago

purple rain

In measure 10 the beams of the top piano staff connect to the bottom staff, too. This leads to fault rhythm analysis.

hbitteur commented 6 years ago

Yes @Bacchushlg this is due to the short vertical gap between beam and stem. The gap is 7 pixels high with an interline value of 18 pixels. In BeamsBuilder class, the maxStemBeamGapY is set as 0.8 (which means 14 pixels for a 18-pixel interline). So, the actual vertical gap is about half of the maximum allowed gap.

Poor-quality scores often exhibit such vertical gaps between beam and stem. Here, we have a good-quality scan of a good-quality score (though not synthetic), for which the allowed vertical gap turns out to be too large.

In that precise case, we could use the fact that the candidate stem is on the opposite side of the other stems with respect to the beam and is very close (abscissa-wise) to another (opposite) stem. In that case, we could be much more strict on connection quality.

Stay tuned, I can see some additional lines of code coming... :-)

hbitteur commented 6 years ago

Done with commit 31398921da02e2c61cf380e608ee636e10fc4000

Bacchushlg commented 6 years ago

works perfect!

Bacchushlg commented 5 years ago

The problem came up again with this score: Your Song2.zip

Maybe the limits need to be adjusted a bit more?