OMR Scripting tools for Measure Segmented Images and Sound Files

• Mar 13, 2018 - 21:16

Hello, I am looking if there exists, and if not, looking for tips how could I develop and contribute with a tool for:
Given a music.xml file produce a set of images, each containing a single measure, and a set of sound files accordingly.

I am interested in OMR problems and this would come in hand for dataset preprocessing.


Comments

It would be doable in MuseScore. Given a file music.xml.


mscore music.xml -o music.png
mscore music.xml -o music.wav
mscore music.xml -o music.mpos

In music.mpos, you will find a json structure containing the bounding box of measures in the PNG files and the corresponding time in the wave file. A short script in your preferred language should be able to export individual measures and individual wav files.

In reply to by Nicolas

What units are the graphics in?

For mpos, I get…

〈element id="0" x="2221.65" y="5350.39" sx="3975.86" sy="5616.54" page="0"/〉

… which looks like x 〈 sx and y 〈 sy so this seems to span a rectangle from (x,y) lower left to (sx,sy) upper right, but the canvas size is 2480x3508px in total, so it cannot be pixels.

For spos, things are weirder… the same score gives…

〈element id="0" x="5090" y="5350" sx="326.549" sy="5616" page="0"/〉  
〈element id="1" x="6610" y="5350" sx="326.549" sy="5616" page="0"/〉  
〈element id="2" x="7092" y="5350" sx="326.549" sy="5616" page="0"/〉  

… in MuseScore 2.3.2, and…

〈element id="0" x="4497" y="5350" sx="250.977" sy="6289" page="0"/〉  
〈element id="1" x="6041" y="5350" sx="0" sy="6289" page="0"/〉
〈element id="2" x="6669" y="5350" sx="0" sy="6289" page="0"/〉

… in MuseScore 3.2.3 (I suspect a bug here, or a missing layout pass before exporting?).

Again with the weirdly high numbers, but x is no longer floating point but integer… and completely different from mpos. How do I interpret these numbers? (page is obviously the index in the basename-number.png minus one.)

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