Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an option to select the lyrics verse(s) to render #3649

Open
fernandoherreradelasheras opened this issue Apr 18, 2024 · 4 comments
Open

Comments

@fernandoherreradelasheras
Copy link
Contributor

Currently verovio renders all available verses for svg output and only the first one for midi output.

In a svg score viewer you might want to render only one verse (the one currently being sung) or a subset of them.

I implemented the single verse behavior in this score + viewer:

https://humanoydivino.com/humanos/manuel_correa_sepan_todos_que_amarilis/

by using a script to replicate all verses inside with all the verses in the and then each separate verse again in one per verse.

From that I got some feedback from choral singers and they usually find choral scores with more than 3 verses a bit messy and definitely those with more than 4-5 are hard to follow after page turns and problematic to fit written annotations. So for this case selecting a subset of the verses could be useful for printing purposes. For example a score with 6 verses could be printed twice, the first one with verses 1-3 and the second one with verses 4-6.

For midi, as there is no way to indicate section repeats to include one verse on each repeat just being able to select wich verse to include in the output would be ok (then you can just concatenate manually al midi files for example).

As said, this can be implemented with scripts manipulating the xml tree but if there is some agreement that this might be useful it would be nice to have an xpath selection option in verovio.

@rettinghaus
Copy link
Contributor

Why not just select the needed verses with an xslt before?

We already have some element-x-path-query options. Maybe it would be good to add a verse-x-path-query option too.

@fernandoherreradelasheras
Copy link
Contributor Author

Why not just select the needed verses with an xslt before?

Yeah, a server side xslt pre-processing the original score is definitely a cleaner approach. I just did the script thing as a faster way of prototyping the idea.

We already have some element-x-path-query options. Maybe it would be good to add a verse-x-path-query option too.

Yeah, that was what I was thinking. It would be enough as a single value option, right? I cannot think of any scenario where you might want to select verse x on one part and verse y on another...

@lpugin
Copy link
Contributor

lpugin commented Apr 19, 2024

xpath queries are essentially used for parallel segmentation selection. This is a different case, and I agree that you would typically expect users to perform an XSLT beforehand since this is a quite project-specific need.

Modifying the Toolkit::Select method would be more appropriate than having an additional option. Please have a look at that.

@fernandoherreradelasheras
Copy link
Contributor Author

I guess we could add support in the Toolkit::Select method to parse verse selection by range but also by labels or lang, something that you might want to select, for example with an opera score with the Italian and German sung text:

image

but this might be too much code to be added and might not be worth the effort and the maintenance cost as this can be done outside the verovio domain.

For the midi exporting the command line was a better fit for selecting the verse in the workflow mei score -> verovio midi output -> synth v studio import and, again, this can be done with just a xmlstarlet ed command before verovio invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants