How to access lyrics programmatically?

• Nov 1, 2012 - 13:48

Hi,

is there any way to access the text objects that are already in the score? I couldn't find anything in the API.

I thought I'd quickly write a plugin that would work around the problem of placing lyrics above/below the staff. The plugin could eg. have a functionality "On each line, move all lyrics syllables associated with this voice vertically to the same position where the first one is".

Thanks for your help!


Comments

In reply to by nbr

Using the raw data is technically possible but not really great since that can change...

Lyric elements are accessible in 2.0. You can check a nightly build and Plugin -> Plugin Editor, click on the help icon to access the documentation.

In reply to by nbr

I'm not sure it's the best way to solve the problem for lyrics below and above the staff. If you need this, you should probably use odd and even lyrics text style and use the Y property to move the lyrics. See attached file.

Starting from c56fa93212, you can read lyrics (read only) from a chord. it will give you the list of lyrics for a chord, "vertically". I tested with

Attachment Size
lyricsAboveBelow.mscz 1.98 KB

In reply to by Jojo-Schmitz

I added support for syllabic in 451404f6e0

In reply to by [DELETED] 5

Hi!

Is ther a similar way to access other text elements (i added some programatically via addStaffText())?

I need to remove them again before the plugin runs a second time...
(Could you implement something like tagged texts, so a text can be annotated with the plugin name or some arbitary string to identify it again for removal?)

Best Regards!

Dr Noes

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