Skip to content

Conversation

@mike-spa
Copy link
Contributor

@mike-spa mike-spa commented Dec 1, 2025

Implements guitar dive notation.

Done:

  • New palette elements and icons for dives
  • New palette element for w/bar line
  • Center w/bar line between notation and tab staves
  • Support for standard dives and pre-dives, dips, scoops, slack
  • Support for layout on stave and above the stave
  • New style options for dives
  • Improved vertical alignement of TAB fret numbers to the notation stave, especially for grace notes. New options for aligning pre-bends and pre-dives to the grace note or to the main note.
  • Modified the property panel for dives

To do:

  • Support for adding bends and dives on the same notes
image image

@mike-spa mike-spa force-pushed the dives branch 7 times, most recently from d3759e2 to 22db964 Compare December 9, 2025 09:35
@mike-spa mike-spa force-pushed the dives branch 2 times, most recently from 18c8ddb to 87a1af7 Compare December 15, 2025 13:55
Copy link
Member

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

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

I've looked through it relatively quickly (and I've assumed James will take a slightly deeper look at the engraving part than I did), and found a few boring comments; but generally looks good to me!

UiAction("dive",
mu::context::UiCtxProjectFocused,
mu::context::CTX_NOTATION_OPENED,
TranslatableString("action", "Dive"),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add a //: comment for each action, with a one-sentence explanation for translators, so that they know what these strings are about


LH_TAPPING_SYMBOL,
RH_TAPPING_SYMBOL,
VIBRATO_LINE_TYPE_TYPE,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VIBRATO_LINE_TYPE_TYPE,
VIBRATO_LINE_TYPE,

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mistake

enum class VibratoType : unsigned char {
GUITAR_VIBRATO, GUITAR_VIBRATO_WIDE, VIBRATO_SAWTOOTH, VIBRATO_SAWTOOTH_WIDE
enum class VibratoType : char {
NONE = -1,
Copy link
Member

Choose a reason for hiding this comment

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

There are some warnings about switches that don't handle NONE yet

while (note->tieBack() && note->tieBack()->startNote()) {
note = note->tieBack()->startNote();
}
GuitarBend* precedingBend = note->bendBack();
Copy link
Member

Choose a reason for hiding this comment

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

see MSVC warning: declaration of 'precedingBend' hides previous local declaration

item->mutldata()->setSymIds(SymIdList(symsCount, symId));
item->mutldata()->moveY(0.5 * item->symHeight(symId));
RectF bbox = item->symBbox(symId);
for (int i = 1; i < item->ldata()->symIds().size(); ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for (int i = 1; i < item->ldata()->symIds().size(); ++i) {
for (size_t i = 1; i < item->ldata()->symIds().size(); ++i) {

(compiler warning)


delegate: FlatRadioButton {
width: 132
height: 51
Copy link
Member

Choose a reason for hiding this comment

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

51 is a somewhat unusual value given that we tend to round to multiples of 4. But not very important

Copy link
Contributor

@miiizen miiizen left a comment

Choose a reason for hiding this comment

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

Looking good to me! Spotted some trivial bits.
I like that we're reusing the guitar bend class. I think the only problem with that will be separating bends and dives in the DOM.

bendText->setPos(PointF(vertex.x() - 0.5 * bendText->width(), bbox.top() - verticalTextPad - bendText->height()));
}

void GuitarDiveLayout::layoutScoop(GuitarBendSegment* item, LayoutContext& ctx)
Copy link
Contributor

@miiizen miiizen Dec 18, 2025

Choose a reason for hiding this comment

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

Compiler warning - ctx unused

return;
}

SymId scoopSym = SymId::guitarVibratoBarScoop;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SymId scoopSym = SymId::guitarVibratoBarScoop;
const SymId scoopSym = SymId::guitarVibratoBarScoop;

return prevStaffIdx != muse::nidx && mmRest->score()->staff(prevStaffIdx)->part() == itemPart;
}

bool SystemLayout::whammyBarShouldBeCenteredBetweenStaved(const WhammyBarSegment* wbar, const System* system)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool SystemLayout::whammyBarShouldBeCenteredBetweenStaved(const WhammyBarSegment* wbar, const System* system)
bool SystemLayout::whammyBarShouldBeCenteredBetweenStaves(const WhammyBarSegment* wbar, const System* system)

item->mutldata()->setSymIds(SymIdList(symsCount, symId));
item->mutldata()->moveY(0.5 * item->symHeight(symId));
RectF bbox = item->symBbox(symId);
for (int i = 1; i < item->ldata()->symIds().size(); ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for (int i = 1; i < item->ldata()->symIds().size(); ++i) {
for (size_t i = 1; i < item->ldata()->symIds().size(); ++i) {


FlatRadioButtonGroupPropertyView {
id: holdLineStyle
visible: root.model && root.model.isHoldLine
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be disabled when the preceding bend is a dip, as the hold line will be using the vibrato symbols.

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