diff --git a/src/engraving/libmscore/beam.cpp b/src/engraving/libmscore/beam.cpp index b5dc1fbe9e765..b093d4ce4f745 100644 --- a/src/engraving/libmscore/beam.cpp +++ b/src/engraving/libmscore/beam.cpp @@ -1066,17 +1066,11 @@ void Beam::createBeamSegments(const std::vector& chordRests) bool breakBeam = false; bool previousBreak32 = false; bool previousBreak64 = false; - int prevRests = 0; for (size_t i = 0; i < chordRests.size(); i++) { ChordRest* chordRest = chordRests[i]; ChordRest* prevChordRest = i < 1 ? nullptr : chordRests[i - 1]; - if (!chordRest->isChord()) { - if ((chordRest != chordRests.front() && chordRest != chordRests.back()) || level >= chordRest->beams()) { - prevRests++; - continue; - } - } + if (level < chordRest->beams()) { levelHasBeam = true; } @@ -1095,19 +1089,19 @@ void Beam::createBeamSegments(const std::vector& chordRests) if (startCr && endCr) { if (startCr == endCr && startCr->isChord()) { bool isBeamletBefore = calcIsBeamletBefore(toChord( - startCr), static_cast(i) - 1 - prevRests, level, previousBreak32, + startCr), static_cast(i) - 1, level, previousBreak32, previousBreak64); createBeamletSegment(toChord(startCr), isBeamletBefore, level); } else { createBeamSegment(startCr, endCr, level); } } - startCr = chordRest && breakBeam && level < chordRest->beams() ? chordRest : nullptr; - endCr = chordRest && breakBeam && level < chordRest->beams() ? chordRest : nullptr; + bool setCr = chordRest && chordRest->isChord() && breakBeam && level < chordRest->beams(); + startCr = setCr ? chordRest : nullptr; + endCr = setCr ? chordRest : nullptr; } previousBreak32 = isBroken32; previousBreak64 = isBroken64; - prevRests = 0; } // if the beam ends on the last chord diff --git a/vtest/scores/beams-1.mscx b/vtest/scores/beams-1.mscx deleted file mode 100644 index 0ee0a0986d1e8..0000000000000 --- a/vtest/scores/beams-1.mscx +++ /dev/null @@ -1,180 +0,0 @@ - - - 2.1.0 - 3543170 - - - 0 - - - 480 - - 1 - 1 - 1 - 0 - - - - 2013-09-17 - - - - X11 - - - - - - - - - - - - - - - Standard - - - - Piano - - Pno. - Piano - 21 - 108 - 21 - 108 - - 100 - 70 - - - 100 - 40 - - - 100 - 100 - - - 120 - 100 - - - - Fluid - - - - - - - G - G - - - 4 - 4 - 1 - - - - 12079 - - - begin - 16th - - - 16th - - 67 - 15 - - - - begin - eighth - - 69 - 17 - - - - mid - 16th - - - - 21168 - - - 32nd - - 69 - 17 - - - - 32nd - - 69 - 17 - - - - eighth - - - eighth - - 69 - 17 - - - - begin - 16th - - - 32nd - - 69 - 17 - - - - 32nd - - 69 - 17 - - - - quarter - - - end - 1 - - - - - diff --git a/vtest/scores/beams-1.mscz b/vtest/scores/beams-1.mscz new file mode 100644 index 0000000000000..3e4f67fd8731c Binary files /dev/null and b/vtest/scores/beams-1.mscz differ diff --git a/vtest/scores/beams-19.mscz b/vtest/scores/beams-19.mscz index b73e80b93451a..de5e9ca872bc2 100644 Binary files a/vtest/scores/beams-19.mscz and b/vtest/scores/beams-19.mscz differ diff --git a/vtest/scores/beams-2.mscx b/vtest/scores/beams-2.mscx deleted file mode 100644 index bc649f73314c8..0000000000000 --- a/vtest/scores/beams-2.mscx +++ /dev/null @@ -1,207 +0,0 @@ - - - 2.1.0 - 3543170 - - - 0 - - - 480 - - 1 - 1 - 1 - 0 - - - - 2013-09-17 - - - - X11 - - - - - - - - - - - - - - - Standard - - - - Piano - - Pno. - Piano - 21 - 108 - 21 - 108 - - 100 - 70 - - - 100 - 40 - - - 100 - 100 - - - 120 - 100 - - - - Fluid - - - - - - - G - G - - - 4 - 4 - 1 - - - - 12112 - - - - - 16th - 1 - - 69 - 17 - - - - mid - 32nd - 1 - - - auto - 32nd - 1 - - - 16th - 1 - - 69 - 17 - - - - 16th - - - - - 16th - 2 - - 69 - 17 - - - - mid - 32nd - 2 - - - 32nd - - - 16th - - 69 - 17 - - - - 16th - - - half - - - - - - 21999 - - - - - mid - 16th - 3 - - 69 - 17 - - - - mid - 16th - 3 - - - mid - eighth - 3 - - 69 - 17 - - - - quarter - - - half - - - end - 1 - - - - - diff --git a/vtest/scores/beams-2.mscz b/vtest/scores/beams-2.mscz new file mode 100644 index 0000000000000..eece87bc4c9ca Binary files /dev/null and b/vtest/scores/beams-2.mscz differ