Skip to content

Conversation

@mike-spa
Copy link
Contributor

@mike-spa mike-spa commented Dec 28, 2023

Resolves: #20536

New options for showing/hiding ties and fret marks in TAB staves

</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
Copy link
Member

Choose a reason for hiding this comment

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

For the future, I think it's generally preferable to not commit a change like this; but for now it's not worth the effort of a force-push.

}

ShowTiedFret showTiedFret = style().value(Sid::tabShowTiedFret).value<ShowTiedFret>();
if (showTiedFret == ShowTiedFret::TIE_AND_FRET) {
Copy link
Member

Choose a reason for hiding this comment

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

Actually to be very honest, I'm not sure if these methods are as clear as they could be. A few things that may be the cause of this are:

  • the fact that Sid::tabShowTiedFret is queried in a lot of places (both in forceShowFret itself, and by the callers of forceShowFret) makes the logic a bit less easy to grasp.
  • Patterns like the following seem to be not my favourite:
    if (it is A) 
        return …
    if (it is C) 
        return …
    
    // then it must be B
    return …
    
    A simple switch might be slightly nicer:
    case A: return …
    case B: return …
    case C: return …
    
  • It's not immediately clear which parameter takes precedence over the others, so to speak. This might become clearer by using switches. Maybe there is simply some interaction between the parameters instead of a strict precedence hierarchy, which is fine; but I think it would be possible to write it down slightly clearer.

Anyway, not sure if this is worth spending time on right now, but in the refinement stage you could keep this in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These methods look cumbersome because they implement cumbersome logic (which I deeply hate, but I also can't do much about). I honestly couldn't find a clearer way to do this. The logic isn't simple enough that a switch statement would make things better imo, and in these cases with intricate relations I do prefer the "early return" pattern (the alternative is a nesting chain of hell).

Copy link

@bkunda bkunda left a comment

Choose a reason for hiding this comment

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

It's very NICE!
Only little thing is that the two vibrato elements, as well as the tremolo bar element, should also trigger parenthesised fret marks when tied (I.e they ought to behave like articulation markings). Apologies if this wasn't apparent from the design!

Screenshot 2023-12-29 at 9 37 11 am

@mike-spa mike-spa requested a review from bkunda December 29, 2023 13:00
Copy link

@bkunda bkunda left a comment

Choose a reason for hiding this comment

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

Guitar-specific articulations are now showing in parentheses ✅

Something that still needs doing: when the "show...when articulation markings are present" is checked, parentheses should appear even when the **Show ties only** option is selected.

This will also mean (for @cbjeukendrup or @Eism) that the "Parentheses indicating ties" section should become enabled when Show ties only is selected.


auto hasTremoloBar = [&] () {
for (EngravingItem* item : ch->segment()->annotations()) {
if (item && item->isTremoloBar()) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional that you're not checking the track or staff index here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks 👍

setFret(prevNote->fret());
}

bool Note::hideFret() const
Copy link
Contributor

Choose a reason for hiding this comment

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

For me based on the name of the method, it looks like this method hides fret and does not return an indication that fret needs to be hidden
The same for forceShowFret

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also good point, thanks 👍

@mike-spa
Copy link
Contributor Author

mike-spa commented Jan 8, 2024

This is ready for merge, from my side!

@bkunda
Copy link

bkunda commented Jan 9, 2024

Just noticed a couple of things:

  • "Show initial fret mark only" now disables the "Parentheses including ties" section. This should be enabled.
  • When "show ties only" is selected, parenthesised fret marks should show when articulations are present (currently not happening).

See video

@mike-spa mike-spa requested review from Eism and bkunda January 10, 2024 12:44
Copy link

@bkunda bkunda left a comment

Choose a reason for hiding this comment

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

Works a charm. I love it 😁
(tested macOS)

its-not-nice
its-not-nice previously approved these changes Jan 10, 2024
@its-not-nice its-not-nice dismissed their stale review January 10, 2024 13:50

looked at the vtests

@RomanPudashkin RomanPudashkin merged commit e82d077 into musescore:master Jan 17, 2024
@Eism Eism mentioned this pull request Feb 23, 2024
@mike-spa mike-spa deleted the newTabTieSettings branch February 17, 2025 10:22
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.

Add options for tied notes in tablature

6 participants