superscript chords revisited
Hi everyone,
A while back, I asked about creating chord superscripts by modifying one of the chord .xml files. Marc advised against it, citing that such modifications may not be compatible with future MuseScore versions. I can see that. All the same, I would like to give it a go.
I would like to use the Calibri font and apply superscripts to things like minors, sevenths, maj7, and so on. There are editing instructions in the .xml files, however, they are written for an expert audience. I'm pretty good with code, however, I've never edited XML code. I tried making a copy of the .xml file so I could work on it, but I never got it to work. I assume the code lines I must modify are:
:n :a m:0.5:0
m:-0.2:1 / m:0.2:1 :n :a m:0:-2
Is there somewhere I can learn how to do these modifications? Perhaps someone can get me started? I don't expect the Musescore developers to assist me--at least not for free! What file can I copy? Can someone give me just one example and if so, quote a line number in the code? Many thanks.
- Lee
Comments
have a look at the various *chord*.xml files, some have quite a few comments in them, which may give you enough hints.
In reply to have a look at the various by Jojo-Schmitz
I did just that, Jojo. I still couldn't get the superscripts to work. I think one issue was, I changed the code line, "font id="0" family="Musescore" to "font id="0" family="Calibri"
What showed up in the score was a bunch of "?" marks where the 7th chord symbols used to be.
So, I really need a starter lesson.
Which XML file are you starting with? If you are trying chords_jazz.xml, it is hard coded to work with MuseJazz only, as that font provides a number of special glyphs not found in other fonts (pre-superscripted numbers, pre-composed glyphs for "ma", "sus", etc).
The lines you quotes are the lines that control the relative position of the root, slash, and bass note (plus their accidentals). It is not what controls the relative position of elements within a chord symbol. For that, see chords_jazz.xml and check out the "token" definitions. As I said, you won't be able to use this file itslef with Calibri or any other font, but but you can adapt what you see in these "token" statements and copy them to your own file based on chords_std.xml.
Basically, you are defining the rendering behavior for specific tokens in specific contexts. See for example the token definitions for "add". They explicitly adjust the vertical position of the "add" token (which happens to use a precomposed glyph in this font, but it would work the same for chords_std.xml if you replaced the "sadd" with just "add"). It sets different vertical heights for this token depending on the context it shows up in - Cadd2 renders differently from C7add2.
If you use a custom XML, we *do* store all the relevant information in your score, so it *should* display the same on other systems even if people don't have your XML file, and *should* survive an update to MuseScore, but no guarantees.
In reply to Which XML file are you by Marc Sabatella
Many thanks Marc. I shall give it a try!
- Lee