Add lyrics to score via qml

• Oct 28, 2015 - 13:18
Reported version
2.1
Type
Plugins
Severity
S5 - Suggestion
Status
active
Project

Hi.

It would be a nice feature to add lyrics via qml.
There is a function (https://github.com/musescore/MuseScore/blob/master/libmscore/score.h#L8…) but it's not accessible by qml.


Comments

In reply to by Jojo-Schmitz

Hey Catz,
i'm coding on a plugin for analyzing notes and writing the results into the lyrics row below the notes (working on my Bachelor thesis...)
Analyse.png

Right now it's just possible to add lyrics to the 1st row! In QML it's not possible to set the "No" property which hold the verse number of the lyrics object...
That's sad! It would be really cool to have this feature available soon!

Otherwise i've to export my generated material to a textfile and then import it again manually...
Another workaround can be to use StaffText... but that's ugly. Lyrics would be much nicer!

Here the relevant code how you can create lyrics in QML:

var cursor = curScore.newCursor();
cursor.rewind(0);
var segment;

    while ( segment = cursor.segment ) {                                     
        if ( cursor.element && cursor.element.type === Element.CHORD ) {
            var lyrics = newElement( Element.LYRICS );
            lyrics.text = "test";
            cursor.element.add(  lyrics  );
        }
        cursor.next();
    }

thx in advance!

In reply to by lagro

I don't program, but is figured bass exposed to qml? If so you can enter multiple numbers one above the other. When you do it with the key board the process is something like

2
return
5
return
7

you will get the 3 numbers one on top of the other. The flat symbol is the small b, the natural symbol is h and the sharp symbol #. Maybe that will help.