Slash notation after import of XML

• Apr 28, 2021 - 12:02

Hello there,
I am a dutch composer, arranger, musicteacher. I recently switched from using Finale to Musescore. I use version 3.6.2 on OS Mojave on a Mac.
I am importing XML files that have been exported out of Finale. Importing is no problem and that I have to make all sorts of adjustments is also not a problem.
But there is one thing that keeps going wrong. I will attach a XML file of a composition I made for youth windband with extended percussion group. In that file is one staff where I put the chords (just as a kind of reminder). When I try to put slash notation on that complete staff, it crashes Musescore. I can put in slash notation but I have to do it 3 to 4 bars at a time. I have tried what happens when I create a new score (300 bars long) and then there is no problem creating the slash notation for all 300 bars at once.
As I said, I can work around it, but I wonder why this goes wrong.
Greetings from the Netherlands,
Hans Berkers

Attachment Size
Two_Together.musicxml 970.88 KB

Comments

Workaround: select all but the last measure, apply slash, then select the last measure and repeat.
Seems to crash only when there is more than one measure is selected and the last is included in that selection, at least in this score.
More investigation needed

Stack trace:
1 Ms::ScoreElement::links scoreElement.h 248 0x103899c
2 Ms::Score::cmdSlashFill cmd.cpp 3203 0x542bcc
3 Ms::Score::::operator()(Ms::Score *, Ms::EditData &) const cmd.cpp 4283 0x5487e0
4 std::_Function_handler>::_M_invoke(const std::_Any_data &, Ms::Score *&&, Ms::EditData &) std_function.h 297 0x55bcfa
5 std::function::operator()(Ms::Score *, Ms::EditData&) const std_function.h 687 0x10b021d
6 Ms::Score::cmd cmd.cpp 4319 0x54a86b
7 Ms::ScoreView::cmd scoreview.cpp 2895 0x6486ad
8 Ms::ScoreView::cmd scoreview.cpp 2089 0x63fd2f
9 Ms::MuseScore::cmd musescore.cpp 6601 0x4338b4
10 Ms::MuseScore::cmd musescore.cpp 6032 0x43024a
11 Ms::MuseScore::qt_static_metacall moc_musescore.cpp 524 0x5ec5ac
12 void doActivate(QObject *, int, void * *) 0x68b978bb
13 Ms::ScoreTab::actionTriggered moc_scoretab.cpp 226 0x60b6da
14 Ms::ScoreTab::qt_static_metacall moc_scoretab.cpp 111 0x60b149
15 void doActivate(QObject *, int, void * *) 0x68b978bb
16 QActionGroupPrivate::_q_actionTriggered() 0x32654cc2
17 QActionGroup::qt_static_metacall(QObject *, QMetaObject::Call, int, void * *) 0x32655299
18 void doActivate(QObject *, int, void * *) 0x68b978bb
19 QAction::activate(QAction::ActionEvent) 0x32653df3
20 QMenuPrivate::activateCausedStack(QVector> const&, QAction *, QAction::ActionEvent, bool) 0x327ac66b
...

Simple fix:

diff --git a/libmscore/cmd.cpp b/libmscore/cmd.cpp
index 56eb3a2a0..e6bb9aebd 100644
--- a/libmscore/cmd.cpp
+++ b/libmscore/cmd.cpp
@@ -3200,14 +3200,16 @@ void Score::cmdSlashFill()
                   // insert & turn into slash
                   s = setNoteRest(s, track + voice, nv, f);
                   Chord* c = toChord(s->element(track + voice));
-                  if (c->links()) {
-                        for (ScoreElement* e : *c->links()) {
-                              Chord* lc = toChord(e);
-                              lc->setSlash(true, true);
+                  if (c) {
+                        if (c->links()) {
+                              for (ScoreElement* e : *c->links()) {
+                                    Chord* lc = toChord(e);
+                                    lc->setSlash(true, true);
+                                    }
                               }
+                        else
+                              c->setSlash(true, true);
                         }
-                  else
-                        c->setSlash(true, true);
                   lastSlash = c;
                   if (!firstSlash)
                         firstSlash = c;
~
~
~
~
~

See https://github.com/musescore/MuseScore/pull/8021 (for 3.x)
and https://github.com/musescore/MuseScore/pull/8022 (for master)

Do you still have an unanswered question? Please log in first to post your question.