configuring chords_std.xml

• Oct 7, 2015 - 17:28

Hello,

I'm currently creating a new XML file for chords I want to notate, and I'm a bit stuck on the elements of the XML.

1. I want to add Roman numerals before the root. I know that I can position an element using the :m flag, but sometimes the spacing doesn't work. Is there a more consistent way?

I currently have

  <!ENTITY first_inv "m:-20:-5 rs1 m:20:5">
  <!ENTITY second_inv "m:-20:-5 rs2 m:20:5">
  <!ENTITY third_inv "m:-20:-5 rs3 m:20:5">
  <!ENTITY fourth_inv "m:-20:-5 rs4 m:20:5">
 
<!--snip-->
<font>
    <sym code="0x2170" name="rs1"/> <!-- Unicode superscript codepoints -->
    <sym code="0x2171" name="rs2"/>
    <sym code="0x2172" name="rs3"/>
    <sym code="0x2173" name="rs4"/>
</font>  
 
<token>
  <name>st</name>
  <render>&first_inv;</render>
  </token>
 
  <token>
  <name>nd</name>
  <render>&second_inv;</render>
  </token>
 
<!-- and so on -->

2. What do :push and :pop do, and how do I use them?

3. Do I have to use MuseJazz do render properly-sized accidentals in chords? For example, if I write Amaj7(#5) the sharp appears on the baseline. Are there any attributes for the font element that control the size?

Thanks in advance,

Corey Mwamba


Comments

:m is the way to position things, should work because we use it all the time. Not really designed for the purpose you seem to be trying to use it for - more for slight adjustments. Still, should work.

:push and :pop are the normal last in, first out stack operations of those names. Push remembers the current position, pop restores it.

"Properly" is in the eyes of the beholder. Accidentals render whatever size the font has them in. See chords_jazz.xml for examples of how to use the "mag" element to scale things further.

In reply to by Marc Sabatella

Thanks Marc, that's great. I could have sworn chords_jazz.xml wasn't there all yesterday, but I see it as plain as day now! I'll look through that. I will try using :push before an inversion and :pop afterwards - in theory should that allow me to store the position just after the root?

In reply to by coreymwamba

In theory. Like I said, it wasn't really designed to work that way. It might help if you gave a more detailed description of what you are actually trying to do. my sense is, what you are doign probably should not be done this way, but should simply be a separate chord symbol or other text element. I'd have to see an example of it to understand better.

In reply to by Marc Sabatella

Hello,

Thanks for your help - here's a screenshot. As you can see, the first inversion of F symbol is fine, but the B-flat one is not.
inversions.png

Here is the XML fragment I have:

{syntaxhighlighter XML}:push :n m:0:-0.5 :a
/ m:0:1 :n :a m:0:-1

st
:pop m:-12:-&mod; rs1 :pop

nd
:pop m:-12:-&mod; rs2

rd
:pop m:-12:-&mod; rs3

th
:pop m:-12:-&mod; rs4

{/syntaxhighlighter}

In reply to by coreymwamba

I'm still not understanding what your desired result is. I'm not familiar with the use of the letter "i" to indicate an inversion and don't know when you'd want to use it or how you'd expect it to look. "i" to me means, a minor chord built on the tonic, and neither of these is that. So I'm not understanding how you expect the "i" to be used.

That said, I think push & pop aren't likely to work across different elements - only within an element. That is, doing a ush on the rooot but then a pop during the extension is not likely to work. Also I see you have two pops in your "st" definition which doesn't make sense to me.

Basically, it still seems you are trying to use this for something it was never designed for. Roman numerals are separate from chord symbols and should simply be added as separate elements. I doubt the chord symbol rendering syste is designed to support whatever it is you are trying to do. But again, more information about your actual desired result would hel me understand better.

In reply to by Marc Sabatella

If you look at the image, the chord on the left represents the first inversion of F. And it looks as I would wish it. If you look at the second chord, the indicator for the inversion overlaps the chord symbol. Which is not as I would wish.

You've answered my question about the push and pop, so I don't think what I want to do will work, which is fine - I can set the inversion indicator after the chord instead. Being able to write customised chord symbols is a really good thing, something not many notation programs get right (or allow!) so the custom XML file format is very handy!

I also noticed that there are different values for the class attribute - can you tell me what they are? I have spotted "quality", "modifier" and "extension", but are there any others; and what effect did you envisage them having on layout?

Thanks again!

In reply to by coreymwamba

quality, modifier, extension - that sounds about right. They have whatever effect you want them to have. They are just ways of specifying the context to which the leyout commands you give apply. For example, in Cmi7b9, the quality is "mi", the "extension" is 7", the "modifiers" are "b" and "9". So you can have "9" have different layout for this chord than for C9#11, where the "9" is an extension rather than a modifier.

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