Interested in developing - Is a plugin the right solution?

• Jan 25, 2015 - 05:18

I would like to set up musescore as a tool to create 'full' arrangements and orchestrations, but be able to export the guts only (lyrics and chords) into a simple text format (ChordPro or similar).

I'm looking for some advice on which route would be easier:

- Musescore plugin
- Custom application which parses the musescore or musicXML saved score file, process that and exports it to the ChordPro or similar format.

I browsed through the documentation, and didn't see anything in the plugin API which talked about saving or exporting files, so it looks like the plugin architecture is meant primarily for altering, deleting, or hiding score objects. A hybrid is also possible, where a plugin strips away some of the unnecessary items to make parsing easier, then saves it to a musescore/musicXML file, and then an external program parses and exports ChordPro.

Any hints on what would be the best way to approach this?
Thanks!


Comments

I have done some experimentation with a script that creates a Chordpro file from MusicXML exported from Musescore.

https://github.com/ironss/musicxml2chordpro

Note that this is very experimental code to see what is possible. It is intended to break at the slightest provocation, to see what needs to be fixed...it has been tested with one MusicXML file.

This script gets you some way there, but there is is not enough information in the MusicXML file to make it a fully automatic process -- you will have to edit the Chordpro file to improve it.

The worst problem is that there is no nice way to break lines in the Chordpro file. Often, a fixed 4-bars per line is good enough. However, where the last beat of a bar is a pickup beat, you usually want that pickup beat on the next line so that the lyrics read properly.


Our [F]love af[Do]fair is a [C]wondrous [Cm]thing
That [Gm]we'll re[C7]joice in re[F]membering

In this example, the word 'That' is actually the last beat of a bar, but it is best to put it at the start of the phrase that it belongs to. However, there is no information in the MusicXML file to indicate this.

In reply to by [DELETED] 5

A few suggestions:

1. Create a new type of break (lyrics-end-line and lyrics-end-paragraph) that you drag in to the line of lyrics where you want them. These could join the existing line-break and page-break in the 'Breaks and Spacers' palette.

2. Re-use the existing line-break and page-break tools to do different things depending on where you drop them: in a bar, they do a line or page break of music; in a line of lyrics, they act as lyrics line-break and page-break. I am not convinced that 'page-break' maps nicely to 'lyrics paragraph break', though.

3. Provide some sort of non-printing symbol to indicate line-, paragraph- and page-break. Unicode provides various breaks (the same codes as ASCII LF, VT, FF, CR) as well as some new ones (Line Separator U+2028 and Paragraph Separator U+2029). These would have no effect on the score layout, but would export to MusicXML as lyric-line-break and lyric-paragraph-break, and would put the appropriate (ASCII) code when copying lyrics to clipboard.

4. Create an entirely new view of the music, showing a chord chart: lyrics with each chord above the correct syllable, and providing tools and options to manipulate this view: line-breaks, column-breaks, page-breaks, whether to show chord fingering diagrams, import and export Chordpro files, etc. I am sure that the Musescore layout engine could make a much better job of it than Chordii and its rather basic layout engine.

Another outcome of my experiments is that it is easy to handle a single line of lyrics and a straight-through piece of music.

* If the music has a complicated form (repeats, codas, DC or DS, etc), it becomes tricky to follow. Musescore understands all of this, so it might be better to implement this as a Musescore plugin, rather than as a stand-alone MusicXML processor, which would have to replicate the form-following algorithm.

* A chord chart often has 'Verse 1', 'Chorus', 'Bridge', 'Tag', etc to indicate different sections of the music. The obvious answer is to use rehearsal marks; this mostly works, but fails where 'Verse 1' and 'Verse 2' are a repeat of the same music with different lyrics on separate lyric lines. Perhaps appending the lyric line ID to the rehearsal mark text would work?

* The verse is usually repeated, which the chorus is not, so there is a different number of lines of lyrics as you go through the song. What do you do when the lyrics run out for the second line?

* Other times, only a small section of the second line of lyrics is used, to show alternative words. How to tell whether it is a very short chorus, or one of these alternatives?

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