audiveris
audiveris copied to clipboard
Detect diamond-shaped drum notes
Here is a short test score for testing recognition of (filled and hollow, stemmed and stemless) diamond-shaped percussion noteheads. Use code from development sub-branch drum-scores for testing.
Not 100% correct recognition, but it's a good start.
Today's new commit e45bcc4 allows diamond-shaped noteheads to share a stem with other shapes (including x-shaped and standard oval heads), and adds a new head shape WHOLE_NOTE_DIAMOND to allow hollow diamond-shaped heads without a stem. Using these modifications makes several improvements on the small test score posted at the beginning of this thread: measures 2, 4, and 6 are now recognized perfectly!
- The diamond half-notes in measure 2 are both recognized as such, and the one on beat 1 successfully shares a stem with an oval half-note.
- The diamond eighth and quarter notes in measure 4 are all correct, including sharing stems and beams with each other.
- The oval whole note in measure 6 is correct.
But there are still some lingering problems with measures 1, 3, and 5, for which I need some hints based on your expertise with the code:
- In measure 1 beat 1, the first diamond quarter note (sharing a stem with an x-shaped head) is for some reason mis-identified as a diamond half note, even though on beat 2, the exact same configuration is identified correctly. Possibly for a similar reason to what I observed in the next point 2, below?
- In measure 1 beat 3, the x-head sharing a stem with a solid diamond head is removed at REDUCTION, even though the exact same configuration on beat 4 is recognized correctly. It seems that in both beats 3 and 4, the HEADS step sees two possible x-head inters very close together on the ledger above the staff; in the STEMS step, on beat 4 (only) the x-head with the higher grade is linked to the stem, allowing it to survive REDUCTION, but on beat 3, (only) the x-head with the lower grade is linked to the beam, and then both x-heads are removed at REDUCTION. I don't understand this behavior.
- In measure 3, the stemless hollow diamond is identified at HEADS step as a NOTEHEAD_DIAMOND_VOID inter instead of a WHOLE_NOTE_DIAMOND. I must not have accounted for all places in the code where the WHOLE_NOTE_DIAMOND should be treated "specially." Do you have a hint about what might have gone wrong?
- In measure 5 beat 2, of course the half-note open x-head is not detected because we have no MusicalSymbols font character for it. And I suppose this caused the half-note open diamond on the same stem to be ignored because it is now on the "wrong" side of its stem?
- In measure 5 beats 1 and 4, a filled oval head on the same stem as a filled diamond head is misidentified as a filled diamond. Any tips as to why this might be happening?
@brian-math Back to the choice of musical font, could you have a look at Bravura font (SMuFL compliant) For example at https://w3c.github.io/smufl/latest/tables/shape-note-noteheads.html
This is not a font installed by default, but first check if you can find all your needs there.
Sorry, I pressed the wrong button
I haven't checked exhaustively but I think all the noteheads (percussion + others) we could want/need are in Sec. 4.7 https://w3c.github.io/smufl/latest/tables/noteheads.html. See for instance:
- noteheadXWhole
- noteheadXHalf
- noteheadXBlack
- noteheadCircleX
- noteheadTriangleDownyyy (where yyy = Whole, Half, White, Black)
- noteheadDiamondyyy (yyy as above, + Wide versions)
Audiveris 5.3 was just released and its handbook significantly updated. Should we close this issue now?