Skip to content

Implement issue #4121 CMN notes within tabgrp#4285

Open
paul-bayleaf wants to merge 7 commits intorism-digital:develop-tabfrom
paul-bayleaf:develop-tab-issue-4121-CMN-notes-within-tabgrp
Open

Implement issue #4121 CMN notes within tabgrp#4285
paul-bayleaf wants to merge 7 commits intorism-digital:develop-tabfrom
paul-bayleaf:develop-tab-issue-4121-CMN-notes-within-tabgrp

Conversation

@paul-bayleaf
Copy link
Contributor

Implements issue #4121 CMN notes within tabgrp

Important: This needs libmei to be updated to MEI 6 so that NOTATIONTYPE_tab_staff_like is included. As a temporary kludge I have edited attconverted.cpp and atttypes.h but these will, of course, be overwritten whenever libmei is re-generated. Please tell me how to proceed, thanks.

Examples of tab.staff-like notation

Example. Taken from issue #4121 but rendered with this PR.
notehead_example mei

Example. A full piece, the MEI has been generated with a modified luteconv - please excuse the missing key signature and enharmonic note spelling, this information not available in the original tablature and luteconv is not equipped to synthesize it.
JBesard_fantasia_18 tab mei

@lpugin
Copy link
Contributor

lpugin commented Mar 2, 2026

Thanks. At this point we can update to MEI 6. I will do it and you can rebase once this is done.

I wonder if the alignment of the tablature glyphs with the note heads is what was expected by @reinierdevalk since the example he gave had the glyph centered on top of the note head.

@paul-bayleaf
Copy link
Contributor Author

Thanks. The horizontal alignment is a bit off - I not sure why that is, with tablature the flags and beams are centred over the notes. I'll investigate.

@paul-bayleaf
Copy link
Contributor Author

The fermata is not correctly aligned either, perhaps a common cause.

@lpugin
Copy link
Contributor

lpugin commented Mar 4, 2026

I updated to MEI 6.0-dev. Could you rebase?

@paul-bayleaf
Copy link
Contributor Author

Same examples as above but with horizontal positioning fixed

notehead_example-2 mei

JBesard_fantasia_18-2 tab mei


if (staff->IsTabStaffLike()) {
// move note left half a note width to be central under the tablature rhythm sign or beam stem etc
note->SetDrawingXRel(
Copy link
Contributor

@lpugin lpugin Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not appropriate to change the drawing position while drawing. This should be done in the alignment functors. I'll have a look where that should be done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it, moving the position of the note will be problematic when staff-like notation will be displayed together with staff notation. So it seems that it would be better to align the tablature glyph with the notes, wouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Yes it would. I did attempts to align the tablature glyph with the centre of its note by adjusting the position in View::DrawTabDurSym - as this is where the vertical positioning is done. Although this worked for the tablature glyphs and for the vertical beam stems, it didn't work for the horizontal beams nor for the fermata. Can this be done properly in the alignment functors?

@reinierdevalk
Copy link

Thanks @paul-bayleaf, this is starting to look very nice!

You are probably well aware of this, but the stems for the beamed rhythm symbols, as well as the beams themselves, are much lighter (thinner) than the stems and flags for the unbeamed rhythm symbols. Is this something that will be addressed too?

@paul-bayleaf
Copy link
Contributor Author

Thanks @reinierdevalk I'll take a look at the beam and stem thickness for tablature and tab.staff-like. Also the beams are rather close together.

@lpugin
Copy link
Contributor

lpugin commented Mar 9, 2026

This is what I am getting with the latest commit and the default options

image

I am not sure why it is not properly aligned vertically. I can dig into it, but may I ask you to double check everything has been committed first? Thanks

@lpugin
Copy link
Contributor

lpugin commented Mar 9, 2026

For the record, this is how guitar tabs are currently aligned with staff notation

image

In comparison, MuseScore align them with a head (whole?) note head

image

I now have pushed an adjustment that aligns them with the centre of a quarter note head

FunctorCode CalcChordNoteHeadsFunctor::VisitTabGrp(TabGrp *tabGrp)
{
Staff *staff = tabGrp->GetAncestorStaff(RESOLVE_CROSS_STAFF);
const int staffSize = staff->GetDrawingStaffNotationSize();
const int width = m_doc->GetGlyphWidth(SMUFL_E0A4_noteheadBlack, staffSize, false) / 2;
tabGrp->SetDrawingXRel(width);
return FUNCTOR_CONTINUE;
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants