Skip to content

Commit d3759e2

Browse files
committed
Guitar dives
1 parent 71c72ee commit d3759e2

File tree

83 files changed

+2408
-965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2408
-965
lines changed

src/engraving/compat/midi/compatmidirenderinternal.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static bool shouldProceedBend(const Note* note)
336336
const Note* baseNote = bendFor->startNoteOfChain();
337337

338338
const GuitarBend* firstBend = baseNote->bendFor();
339-
if (firstBend && firstBend->type() == GuitarBendType::PRE_BEND) {
339+
if (firstBend && firstBend->bendType() == GuitarBendType::PRE_BEND) {
340340
const Note* nextNote = firstBend->endNote();
341341
if (nextNote) {
342342
baseNote = nextNote;
@@ -382,7 +382,7 @@ static std::unordered_map<const Note*, int> getGraceNoteBendDurations(const Note
382382
const Note* bendStartNote = nullptr;
383383
std::unordered_set<const Note*> currentNotes;
384384

385-
if (note->bendFor() && note->bendFor()->type() == GuitarBendType::SLIGHT_BEND) {
385+
if (note->bendFor() && note->bendFor()->bendType() == GuitarBendType::SLIGHT_BEND) {
386386
return {};
387387
}
388388

@@ -455,7 +455,7 @@ static void collectGuitarBend(const Note* note,
455455
int quarterOffsetFromStartNote = 0;
456456
int currentQuarterTones = 0;
457457

458-
if (note->bendFor()->type() == GuitarBendType::GRACE_NOTE_BEND) {
458+
if (note->bendFor()->bendType() == GuitarBendType::GRACE_NOTE_BEND) {
459459
curPitchBendSegmentStart -= graceOffset;
460460
}
461461

@@ -823,7 +823,7 @@ static void collectNote(EventsHolder& events, const Note* note, const CollectNot
823823
}
824824

825825
// skipping the notes which are connected by bends
826-
if (bendBack && bendBack->type() != GuitarBendType::PRE_BEND && i == 0) {
826+
if (bendBack && bendBack->bendType() != GuitarBendType::PRE_BEND && i == 0) {
827827
continue;
828828
}
829829

@@ -1087,7 +1087,7 @@ void CompatMidiRendererInternal::collectGraceBeforeChordEvents(Chord* chord, Cho
10871087
for (Chord* c : grChords) {
10881088
for (const Note* note : c->notes()) {
10891089
GuitarBend* bendFor = note->bendFor();
1090-
if (bendFor && bendFor->type() == GuitarBendType::PRE_BEND) {
1090+
if (bendFor && bendFor->bendType() == GuitarBendType::PRE_BEND) {
10911091
continue;
10921092
}
10931093

@@ -1096,7 +1096,7 @@ void CompatMidiRendererInternal::collectGraceBeforeChordEvents(Chord* chord, Cho
10961096
params.velocityMultiplier = veloMultiplier;
10971097
params.tickOffset = tickOffset;
10981098

1099-
bool isGraceBend = (note->bendFor() && note->bendFor()->type() == GuitarBendType::GRACE_NOTE_BEND);
1099+
bool isGraceBend = (note->bendFor() && note->bendFor()->bendType() == GuitarBendType::GRACE_NOTE_BEND);
11001100
if (prevChord) {
11011101
params.previousChordTicks = prevChord->actualTicks().ticks();
11021102
}

src/engraving/dom/actionicon.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ enum class ActionIconType : signed char {
6464
GRACE_NOTE_BEND,
6565
SLIGHT_BEND,
6666

67+
DIVE,
68+
PRE_DIVE,
69+
DIP,
70+
SCOOP,
71+
6772
NOTE_ANCHORED_LINE,
6873

6974
SYSTEM_LOCK,

src/engraving/dom/chord.cpp

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,8 @@ bool Chord::isPreBendOrGraceBendStart() const
22152215

22162216
for (const Note* note : m_notes) {
22172217
GuitarBend* gb = note->bendFor();
2218-
if (gb && (gb->type() == GuitarBendType::PRE_BEND || gb->type() == GuitarBendType::GRACE_NOTE_BEND)) {
2218+
if (gb && (gb->bendType() == GuitarBendType::PRE_BEND || gb->bendType() == GuitarBendType::GRACE_NOTE_BEND
2219+
|| gb->bendType() == GuitarBendType::PRE_DIVE)) {
22192220
return true;
22202221
}
22212222
}
@@ -2231,65 +2232,14 @@ bool Chord::isGraceBendEnd() const
22312232

22322233
for (const Note* note : m_notes) {
22332234
GuitarBend* bendBack = note->bendBack();
2234-
if (bendBack && bendBack->type() == GuitarBendType::GRACE_NOTE_BEND) {
2235+
if (bendBack && bendBack->bendType() == GuitarBendType::GRACE_NOTE_BEND) {
22352236
return true;
22362237
}
22372238
}
22382239

22392240
return false;
22402241
}
22412242

2242-
bool Chord::preOrGraceBendSpacingExceptionInTab() const
2243-
{
2244-
if (!staffType()->isTabStaff() || !isGrace()) {
2245-
return false;
2246-
}
2247-
2248-
std::vector<GuitarBend*> bends;
2249-
for (Note* note : m_notes) {
2250-
GuitarBend* bendFor = note->bendFor();
2251-
if (bendFor) {
2252-
GuitarBendType bendType = bendFor->type();
2253-
if (bendType == GuitarBendType::PRE_BEND || bendType == GuitarBendType::GRACE_NOTE_BEND) {
2254-
bends.push_back(bendFor);
2255-
break;
2256-
}
2257-
}
2258-
}
2259-
2260-
if (bends.empty() || bends.size() < m_notes.size()) {
2261-
return false;
2262-
}
2263-
2264-
Chord* endChord = bends.front()->endNote()->chord();
2265-
if (!endChord) {
2266-
return false;
2267-
}
2268-
2269-
GuitarBendType type = bends.front()->type();
2270-
for (GuitarBend* gb : bends) {
2271-
if (gb->type() != type || (gb->endNote() && gb->endNote()->chord() != endChord)) {
2272-
return false;
2273-
}
2274-
}
2275-
2276-
if (type == GuitarBendType::PRE_BEND) {
2277-
return true;
2278-
}
2279-
2280-
for (Note* note : endChord->notes()) {
2281-
GuitarBend* bendBack = note->bendBack();
2282-
if (bendBack) {
2283-
Note* startNote = bendBack->startNote();
2284-
if (!startNote || startNote->chord() != this) {
2285-
return false;
2286-
}
2287-
}
2288-
}
2289-
2290-
return bends.size() < endChord->notes().size();
2291-
}
2292-
22932243
void Chord::setIsTrillCueNote(bool v)
22942244
{
22952245
m_isTrillCueNote = v;

src/engraving/dom/chord.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ class Chord final : public ChordRest
239239

240240
bool isPreBendOrGraceBendStart() const;
241241
bool isGraceBendEnd() const;
242-
bool preOrGraceBendSpacingExceptionInTab() const;
243242

244243
bool isTrillCueNote() const { return m_isTrillCueNote; }
245244
void setIsTrillCueNote(bool v);

src/engraving/dom/engravingobject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ bool EngravingObject::isSLineSegment() const
732732
return isHairpinSegment() || isOttavaSegment() || isPedalSegment()
733733
|| isTrillSegment() || isVoltaSegment() || isTextLineSegment()
734734
|| isGlissandoSegment() || isLetRingSegment() || isVibratoSegment() || isPalmMuteSegment()
735-
|| isGradualTempoChangeSegment();
735+
|| isGradualTempoChangeSegment() || isWhammyBarSegment();
736736
}
737737

738738
//---------------------------------------------------------

src/engraving/dom/excerpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ void Excerpt::cloneStaff2(Staff* srcStaff, Staff* dstStaff, const Fraction& star
15981598
nn->addSpannerBack(newBend);
15991599
}
16001600
GuitarBend* bendFor = on->bendFor();
1601-
if (bendFor && bendFor->type() == GuitarBendType::SLIGHT_BEND) {
1601+
if (bendFor && bendFor->bendType() == GuitarBendType::SLIGHT_BEND) {
16021602
// Because slight bends aren't detected as "bendBack"
16031603
GuitarBend* newBend = toGuitarBend(bendFor->linkedClone());
16041604
newBend->setScore(score);

0 commit comments

Comments
 (0)