Submodule lyrics

Manipulate the lyrics

class mscxyz.lyrics.NumberedLyricsElement[source]

Bases: object

no: int
element: _Element
class mscxyz.lyrics.Lyrics(score: Score)[source]

Bases: object

score: Score
elements: list[NumberedLyricsElement]
property number_of_verses: int

Retrieve the number of verses.

From:

  1. La

  2. La

  3. La

To:

3

remap(remap_string: str) None[source]
extract_lyrics(number: int | None = None) None[source]

Extract one lyric verse or all lyric verses.

Parameters:

number – The lyric verse number. 1 is the first verse.

fix_lyrics_verse(verse_number: int) None[source]

from:

<Lyrics>
        <text>la-</text>
</Lyrics>
<Lyrics>
        <syllabic>end</syllabic>
        <text>la-</text>
</Lyrics>
<Lyrics>
        <text>la.</text>
</Lyrics>

to:

<Lyrics>
        <syllabic>begin</syllabic>
        <text>la</text>
</Lyrics>
<Lyrics>
        <syllabic>middle</syllabic>
        <text>la</text>
</Lyrics>
<Lyrics>
        <syllabic>end</syllabic>
        <text>la.</text>
</Lyrics>
fix_lyrics(mscore: bool = False) None[source]
reload(save: bool = False) Lyrics[source]

Reload the MuseScore file.

Parameters:

save – Whether to save the changes before reloading. Default is False.

Returns:

The reloaded Lyrics object.

See:

mscxyz.score.Score.reload()