>Not so hard if you know how it works: A chord modifier is a string that
>appears in the \chordmodifiers block (ly/chord-modifiers.ly). It
>translates to a pitch; m and min translate to e-flat.
>
>When building the chord, the pitch that results from a modifier is simply
>added to the list of additions. Then, in the Chord::Chord constructor,
>some magic goes on, eg:
>
> * if there are no additions, add third and fifth: c -> c e g
> * if a third is added, be it e, e-sharp, or e-flat, don't add an
> extra third: c-min -> c es g
Ok, I think I get it. The parser, when it sees something like 'd-dim' sets
'tonic' in Chord::Chord to 'D' and 'add_arr_p' to 'Ab' somewhere in the
array. There's a small problem with this approach, namely that the chord
modifiers need to modify more than one pitch (e.g., diminished triad has
*both* a flat third and flat fifth, seventh chords are even hairier) and
they need to be separate from the other adds (if there are any). I can work
around this, if I know where in the array 'add_arr_p' the chord modifier is
going (although I may be able to work around it anyway by setting the octave
to something absurd).
>Why? The maj may be a problem (what is maysix?). But c-aug is really
>the same as c-5+, so why not have aug mean 5+?
I guess to make it easier to understand what's being input. (BTW, majsix
would be a CM6, which is a major triad with an added sixth; its counterpart
would be Cm6 which is a minor triad with an added sixth.) It would be
output as Caug as I've heard some complaining about things like C+ and C(#5)
(although C(#5) should be allowed as output--I'm not sure how to handle
*that* yet). The whole idea is to keep a list of standard chord types that
the user can enter and have the program interpret those names as pitches
(for printing on the staff) or as (simply enough) a chord name. Adds and
subtracts would still be there so that those who are entering their weird
jazz chords (like C9(b5)add#13) could still do so.
>We *must* have a separator. Look at the lexer: it looks for strings, and
>then checks whether it's a note name (c, cis, Cisis, ..), or a modifier.
>If not, it returns a string to the parser. 'Cmaj6' looks as the string
>'Cmaj' and the digit 6.
How would one change the separator to a colon then?
-- Shamus