Add music symbol font for OMR
Hello,
I'm a PhD student working on OMR and I started using MuseScore with the IMETA branch in order to generate bounding box and class annotation in order to train a music object detector.
In the process of generating annotation, I would like to vary the music symbol font used in MuseScore to create more variation in my training data.
From what I have understood, MuseScore doesn't include the ability to install new music font because it would break portability of the MuseScore file.
However, portability is not a concern in my use case.
I tried to add a SMuFL compliant font Ekmelos: http://www.ekmelic-music.org/en/extra/ekmelos.htm in the fonts directory (MuseScore/fonts) of MuseScore, but that didn't work.
I would like to ask what would be the method to add a music symbol font to musescore, either what files I need to add, or which portion of code I need to modify.
I've started to get a little bit familiar with the c++ code while investigating the generation of annotations with the imeta branch, so I think I will be able to figure out how to do it on my own only with a little bit of advice.
Thanks again for your help
Comments
Search the code base for Bravura to see how a font gets added, there are several places, cpp files, Cmakelists.txt, qrc files
Also check the work being done in https://github.com/musescore/MuseScore/pull/3782, as part of this year's GCoC and also https://musescore.org/en/user/1088561/blog/2018/07/29/gsoc-2018-machine…
In reply to Search the code base for… by Jojo-Schmitz
Yep, I'm already familiar with the GSoC work but that work didn't include any consideration about using different music symbol font.
Here is a quick and dirty method I found to add music symbol font to musescore:
in file libmscore/sym.cpp, line 36, you have this QVector ScoreFont::_scoreFonts:
You can just add any font by adding the absolute path to your font and it will appear in the format -> general style -> Musical symbols font menu.
So, from what I have understood, MuseScore can use any SMuFL compliant music font, right?
In my quest to add more music fonts, I've come across fonts like Leipzig 1803: https://www.fontshop.com/families/leipzig-1803 which is part of a family of font called urtext font.
If I understood correctly, urtext edition of music scores attempt to exactly reproduce the original score.
I would like to know if MuseScore has the ability to use such fonts?
The use of urtext fonts would be very precious for OMR, as we would be able to produce synthetic data, which would be very close to graphically from historical music scores.
In reply to Here is a quick and dirty… by kwon-young
There are more places to really add them
As a quick hack, your method of appending to _scoreFonts should work. Make sure that metadata.json is in the same path.
In theory, MuseScore should be able to use any SMuFL font, but SMuFL is a flexible standard. FWIU, a SMuFL font could contain only the glyphs for a very specific domain but for example no noteheads, or fermatas, while MuseScore will rely on the availability of noteheads or fermatas. If they are not present in the font, MuseScore will fallback to Bravura.