Audiveris / audiveris

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

notation without stems - is there a way to automate adding multiple noteheads. #589

Open spammydavis opened 1 year ago

spammydavis commented 1 year ago

I have some notation which has noteheads without stems. It seems Audiveris can not handle this. I can see that it recognizes the notehead shapes as glyph "BLACK_HEAD_SPOT", but does not add them to the "Inter" shapes.

I can manually add a notehead by clicking on each one, but I was wondering if there's a way to just add them all at once?

bbb

hbitteur commented 1 year ago

@spammydavis - Short answer is "no". Audiveris engine requires that a black note head be close to a stem, otherwise the head candidate is discarded. This is a music rule, and there is no "automatic" stem addition.

However, one existing feature you might be interested in is something called "repetitive input" mode. It is meant to ease the manual insertion of the same item shape (here: a stem), again and again, until you exit this mode. Manually drag n' drop a first stem from ShapeBoard to some desired location and set the repetitive mode on. From this moment on, just press with left mouse button at any location and a stem will be created there, you can still move the mouse and release it when you are satisfied with your location.

Documentation is available in this HandBook section.

The stem editor is a bit specific (see its precise description), because its middle handle is meant to translate the stem horizontally, not vertically. And, bad luck, the repetitive mode works with the default (middle) handle of the shape being inserted.

This might not be exactly what you are asking for, but that's all we have today.

Note we could easily allow the stem middle handle to also move vertically, this would ease its repetitive insertion as in your precise case. Just a few lines of code.

spammydavis commented 1 year ago

yes I did use the "repetitive input" mode. another trick I found was to delete all the accidentals, and use repetitive input on those after defining the noteheads. That way the software automatically associated the accidentals with the respective notes. Otherwise it took another step to associate if the accidental was there before the notehead was registered.

Another thing I was looking at was the xml for the page. There's probably a way I could write a script to assign all the BLACK_HEAD_SPOT glyphs to noteheads. I did a diff with no noteheads and after assigning one notehead. It looks a little more complicated than a one liner though :)

Note we could easily allow the stem middle handle to also move vertically, this would ease its repetitive insertion as in your precise case. Just a few lines of code.

I'm not exactly sure what this means...as I wasn't working with the stems (which weren't there), but the noteheads. It sounds like this statement is discussing a hypothetical way to add a false "stem" and use that to register the noteheads?

hbitteur commented 1 year ago

Oops, my mistake! Of course, the engine did not recognize the note heads, so you could not add stems to them. And my suggestion about modifying stem editor cannot apply. Please forget it.

If I understand correctly what you tried to do directly with a .omr file, something like "promoting" any BLACK_HEAD_SPOT as a HeadInter instance is:

hbitteur commented 1 year ago

No news on this issue. Should we close it?