traditional vocal beaming

• Dec 6, 2022 - 09:15

I loaded the 'traditional vocal beaming' plugin into MuseScore 4. When I try to use it on a musescore score it closes. Any remedy or..wait patiently?
Ho caricato il plugin "traditional vocal beaming" in MuseScore 4. Quando cerco di usarlo su di una partitura musescore si chiude. Qualche rimedio o..attendere pazientemente?


Comments

In reply to by graffesmusic

=== in ECMAScript is called "strict comparison" and doesn't type coerce its arguments, which makes it slightly faster and in most scenarios also a bit safer
== tries to coerce both sides into a comparable object representation before it does the comparison

1 === "1" : false (Number is not a String)
1 == "1" : true (Both are converted to Strings first)

In reply to by graffesmusic

Difference to my PR being:

diff --git a/traditionalVocalBeaming.qml b/traditionalVocalBeaming.qml
index 51edc2d..17d0fcb 100644
--- a/traditionalVocalBeaming.qml
+++ b/traditionalVocalBeaming.qml
@@ -86,7 +86,7 @@ MuseScore {
                        if (lyrics.length === 0) {
                            if (lastChord != null && hasLyrics) {
                                // set last chord to "BEGIN", if it existed
-                               lastChord.beamMode = 1;
+                               lastChord.beamMode = 0;
                            }
                            // don't change anything for this chord
                            lastChord = null;

As far as I can tell that's not a 4.x bug though?

In reply to by Jojo-Schmitz

But beams are behaving differently in v4.
Assuming that:
BeamMode::AUTO, "auto" }, = 0
BeamMode::BEGIN, "begin" }, = 1
BeamMode::MID, "mid" }, = 2
BeamMode::END, "end" }, = 3
BeamMode::NONE, "no" }, = 4
(just based on the order in sourcecode)

So beamMode = 0 would be auto and 1 would be begin. (which works in v3 but not in v4)

In reply to by graffesmusic

Wouldn't this then work in MuseScore 3 and 4?

diff --git a/traditionalVocalBeaming.qml b/traditionalVocalBeaming.qml
index 51edc2d..b1c38af 100644
--- a/traditionalVocalBeaming.qml
+++ b/traditionalVocalBeaming.qml
@@ -86,7 +86,7 @@ MuseScore {
                        if (lyrics.length === 0) {
                            if (lastChord != null && hasLyrics) {
                                // set last chord to "BEGIN", if it existed
-                               lastChord.beamMode = 1;
+                               lastChord.beamMode = Beam.BEGIN;
                            }
                            // don't change anything for this chord
                            lastChord = null;
@@ -95,7 +95,7 @@ MuseScore {
                            // found lyrics
                            if (lastChord != null) {
                                // set last chord to "BEGIN", if it existed
-                               lastChord.beamMode = 1;
+                               lastChord.beamMode = Beam.BEGIN;
                            }
                            // remember this chord
                            lastChord = cursor.element;
@@ -103,14 +103,14 @@ MuseScore {
 
                        if (hasLyrics) {
                            // reset beaming to auto for current chord
-                           cursor.element.beamMode = 0;
+                           cursor.element.beamMode = Beam.AUTO;
                        }
                    }
                    cursor.next();
                }
                if (lastChord != null) {
                    // set last chord to "NONE", if it existed
-                   lastChord.beamMode = 4;
+                   lastChord.beamMode = Beam.NONE;
                }
            }
        }

In reply to by Jojo-Schmitz

It works is v3 but not in v4.
In v4, this:
if (lyrics.length === 0) {
if (lastChord != null && hasLyrics) {
// set last chord to "BEGIN", if it existed
- lastChord.beamMode = 1;
+ lastChord.beamMode = Beam.BEGIN;
}
// don't change anything for this chord
lastChord = null;
must be set to AUTO.
This works, except for the very last note of the selection/score depending on what is selected or not

In reply to by graffesmusic

diff --git a/traditionalVocalBeaming.qml b/traditionalVocalBeaming.qml
index 51edc2d..22e5ae1 100644
--- a/traditionalVocalBeaming.qml
+++ b/traditionalVocalBeaming.qml
@@ -85,8 +85,13 @@ MuseScore {
 
                        if (lyrics.length === 0) {
                            if (lastChord != null && hasLyrics) {
-                               // set last chord to "BEGIN", if it existed
-                               lastChord.beamMode = 1;
+                               if (mscoreMajorVersion >= 4) {
+                                    // set last chord to "AUTO", if it existed
+                                   lastChord.beamMode = Beam.AUTO;
+                                } else {
+                                    // set last chord to "BEGIN", if it existed
+                                   lastChord.beamMode = Beam.BEGIN;
+                                }
                            }
                            // don't change anything for this chord
                            lastChord = null;
@@ -95,7 +100,7 @@ MuseScore {
                            // found lyrics
                            if (lastChord != null) {
                                // set last chord to "BEGIN", if it existed
-                               lastChord.beamMode = 1;
+                               lastChord.beamMode = Beam.BEGIN;
                            }
                            // remember this chord
                            lastChord = cursor.element;
@@ -103,14 +108,14 @@ MuseScore {
 
                        if (hasLyrics) {
                            // reset beaming to auto for current chord
-                           cursor.element.beamMode = 0;
+                           cursor.element.beamMode = Beam.AUTO;
                        }
                    }
                    cursor.next();
                }
                if (lastChord != null) {
                    // set last chord to "NONE", if it existed
-                   lastChord.beamMode = 4;
+                   lastChord.beamMode = Beam.NONE;
                }
            }
        }

Hi, sorry to bump a over-a-month-old thread, but are there any new developments on the status of the plugin in MS4? I would love to help resolving the issues, I just lack the skills unfortunately...

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