how to move a long verse 2 to verse 1

• Apr 16, 2016 - 10:43

how to move a long verse 2 to verse 1
I have a long score have seperate the one verse to verse 1 and 2 in the middle of the score
one by one is not a good idea due to the large score


Comments

You can try Edit / Copy Lyrics To Clipboard, then paste into a text editor, sort things out there, then paste them back (select all and copy from your text editor, then In MuseScore click first note, hit Ctrl+V repeatedly to paste one syllable at a time). Chances are pretty good this won't be easier than typing the lyrics again, unless you get lucky.

You can achieve this if you edit the .mscx version of your score either manually or by using a script.

Manual process might be very tedious - you need to look for {no}xx{/no} tags in {lyrics}...{/lyrics} context and replace 1 with 0.

The attached script would do this for you more quickly:

gawk -f _lyricsOps.awk -v mode=delete -v verseFrom=1 -v measureFrom=1 -v measureTo=999 oldScore.mscx > newScore.mscx

When a verse gets deleted, all subsequent verses move one line up. The script can delete, swap, copy and insert empty verses in the whole score or within specified range of measures. See the comments within the script for more examples and detailed instructions.

You need to know how run scripts and possibly install awk/gawk (see this post for more details)

Make sure you backup your original score before you start fiddling with it.

Attachment Size
_lyricsOps.awk_.txt 8.27 KB

In reply to by Marc Sabatella

Any verse can be moved individually.

select one syllable
use its contextual menu to select the whole verse
use the inspector to shift up the selected verse
if there is a yet typed first verse,  just shift it down
doing so you can exchange the verses
if there is styles attached lyrics you can use inspector to clear the situation

In reply to by yuriymos

Would you mind to explain what's the error message or what is not working.
You can also attached your score and describe what you want to achieve and I will run the script on my computer and upload the results and the command line parameters to get those results

In reply to by .m.i.r.o.

Thank you for your reply, dear .m.i.r.o.
I wanted to repeat my attempt at working with the script to copy the error message for you.
I ran your script again and - a miracle - it worked.
It turned out that before I used a compressed file format, but I had to use uncompressed.
Thanks for the great job!
What I did in half an hour I did in 30 seconds.
Indeed, a good development. Thank you.

In reply to by .m.i.r.o.

Hello, .m.i.r.o.
Once again I thank for the script. Helped do a lot of boring work.

Here is the result of the script with the compressed file:
gawk" -f _lyricsOps.awk -v mode=delete -v verseFrom=1 -v measureFrom=1 -v measureTo=999 old_test.mscz > new_test.mscz
Measure: 1-999, DELETE verse: 1 -> 1

Result file new_test.mscz is damaged, although (it can be seen from the logs) the work was supposedly done successfully. Although in fact it is not. (That's why I decided that the script did not work for me. Sorry.)

Maybe (if you have time), would you be able to insert (despite the mention of this in your first post) a check in the script what type of file (compressed or uncompressed) we are going to convert? Вecause sometimes it is difficult, if we do not know, to notice the difference between mscz and mscx. Thank you.

Still there is a small uncritical bug, when inserting empty couplets - one syllable was left on the spot ("И"). (Just to let you know.) This, of course, can be fixed manually. Here is my test:
gawk" -f _lyricsOps.awk -v m=i -v vFrom=2 -v vTo=3 -v mFrom=10 oldScore.mscx > newScore.mscx
Measure: 10-999999, INSERT verse: 2 -> 3

71734be3063d4139df4ef575d7e89bda.png
I think this is due to the fact that the syllable is shifted to the right or to the left by the editor (see " <pos x=" in the code from oldScore.mscx file).
<Lyrics>
<pos x="0.558281" y="8.5"/>
<text>И</text>
</Lyrics>
If I delete the second line (<pos x=...), then the script works without any complaints.

In reply to by yuriymos

Hi , Yuriymos

I'm glad that someone has found my script useful. Thank you for your feedback and suggestions.

Technically, the syllable "И" in your picture is already a part of the 4th verse. If you would select it and reset its position to default (either by the inspector or Ctrl-R), it would move to the right spot.

However, to avoid confusion is such cases, I have modified the script to reset the position automatically for syllables moving into a new verse.

Also I have added a check ensuring that the input is a text/xml stream with an appropriate error/warning:

gawk -v m=i -v vFrom=2 -f _lyricsOps.txt < CWB619.mscz > CWB619_TEST.mscz
Staff: 1-999999, Measure: 1-999999, INSERT verse: 2 -> 2
#ERROR:   Input is not a text/xml stream. Make sure you're feeding in an uncompressed *.MSCX file.
#WARNING: Output stream truncated.

Updated version of the script attached

Attachment Size
_lyricsOps.txt 10.49 KB

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