Skip to content

Commit

Permalink
Remove @notationsubtype for German Lute Tablature
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-bayleaf committed Jan 23, 2024
1 parent 0e90bee commit 51437a8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
3 changes: 1 addition & 2 deletions include/vrv/note.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ class Note : public LayerElement,
* @name Return the smufl string to use for a note give the notation type
*/
///@{
std::u32string GetTabFretString(
data_NOTATIONTYPE notationType, const std::string &notationSubtype, int &overline, int &strike) const;
std::u32string GetTabFretString(data_NOTATIONTYPE notationType, int &overline, int &strike) const;
///@}

/**
Expand Down
35 changes: 14 additions & 21 deletions src/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ const TabGrp *Note::IsTabGrpNote() const
return vrv_cast<const TabGrp *>(this->GetFirstAncestor(TABGRP, MAX_TABGRP_DEPTH));
}

std::u32string Note::GetTabFretString(
data_NOTATIONTYPE notationType, const std::string &notationSubtype, int &overline, int &strike) const
std::u32string Note::GetTabFretString(data_NOTATIONTYPE notationType, int &overline, int &strike) const
{
overline = 0;
strike = 0;
Expand Down Expand Up @@ -345,8 +344,8 @@ std::u32string Note::GetTabFretString(
const int fret = this->GetTabFret();
const int course = this->GetTabCourse();

// SMuFL has glyphs for German lute tablature following Hans Newsidler's notation
// for the 6th course.
// SMuFL has glyphs for German lute tablature following Hans and Melchior Newsidler's notation
// for the >= 6th courses.
// "German Renaissance lute tablature (U+EC00–U+EC2F)"
// https://w3c.github.io/smufl/latest/tables/german-renaissance-lute-tablature.html
//
Expand All @@ -364,27 +363,17 @@ std::u32string Note::GetTabFretString(
// parts of the SMuFL collection. Overlines and strike throughs are drawn separately.

if (course >= 6 && fret >= 0 && fret <= 13) {
// TODO more GLT subtypes needed, is this subtype too specific?
if (notationSubtype == "judenkunig_1523") {
// A B C D ...
// + A B C D ...
if (fret == 0) {
fretStr = SMUFL_EA51_figbass1; // substitute for 1 with oblique stroke
strike = course - 5; // 6 course 1 strike, 7 course 2 strikes, ...
}
else {
// The German tablature uppercase letters A-N are contiguous, correctly omitting J
static_assert(SMUFL_EC23_luteGermanNUpper == SMUFL_EC17_luteGermanAUpper + 13 - 1);
fretStr = SMUFL_EC17_luteGermanAUpper + fret;
fretStr = SMUFL_EC17_luteGermanAUpper + fret - 1;
overline = course - 6; // 6 course 0 overline, 7 course 1 overline, ...
}
else {
// + A B C D ...
if (fret == 0) {
fretStr = SMUFL_EA51_figbass1; // substitute for 1 with oblique stroke
strike = course - 5; // 6 course 1 strike, 7 course 2 strikes, ...
}
else {
// The German tablature uppercase letters A-N are contiguous, correctly omitting J
static_assert(SMUFL_EC23_luteGermanNUpper == SMUFL_EC17_luteGermanAUpper + 13 - 1);
fretStr = SMUFL_EC17_luteGermanAUpper + fret - 1;
overline = course - 6; // 6 course 0 overline, 7 course 1 overline, ...
}
}
}
else if (course >= 1 && course <= 5 && fret == 0) {
// Substitute for gothic digits
Expand All @@ -396,9 +385,13 @@ std::u32string Note::GetTabFretString(
const int firstAlphabetFret = fret <= 5 ? fret : fret - 5; // map second alphabet to first

if (course == 2 && firstAlphabetFret == 5) {
// TODO replace with U+EC24, luteGermanEt when available
// https://github.com/w3c/smufl/issues/274
fretStr = SMUFL_EA5F_figbass7Raised2; // substitute for "et"
}
else if (course == 1 && firstAlphabetFret == 5) {
// TODO replace with U+EC25, luteGermanCon when available
// https://github.com/w3c/smufl/issues/274
fretStr = SMUFL_EA61_figbass9; // substitute for "con"
}
else {
Expand Down
6 changes: 2 additions & 4 deletions src/view_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ void View::DrawTabNote(DeviceContext *dc, LayerElement *element, Layer *layer, S

if (staff->m_drawingNotationType == NOTATIONTYPE_tab_guitar) {

std::u32string fret = note->GetTabFretString(
staff->m_drawingNotationType, staff->m_drawingStaffDef->GetNotationsubtype(), overline, strike);
std::u32string fret = note->GetTabFretString(staff->m_drawingNotationType, overline, strike);

FontInfo fretTxt;
if (!dc->UseGlobalStyling()) {
Expand All @@ -138,8 +137,7 @@ void View::DrawTabNote(DeviceContext *dc, LayerElement *element, Layer *layer, S
}
else {

std::u32string fret = note->GetTabFretString(
staff->m_drawingNotationType, staff->m_drawingStaffDef->GetNotationsubtype(), overline, strike);
std::u32string fret = note->GetTabFretString(staff->m_drawingNotationType, overline, strike);
// Center for italian tablature
if (staff->IsTabLuteItalian()) {
y -= (m_doc->GetGlyphHeight(SMUFL_EBE0_luteItalianFret0, glyphSize, drawingCueSize) / 2);
Expand Down

0 comments on commit 51437a8

Please sign in to comment.