musescore/MuseScore — pull request #363 by MarcSabatella (2013-05-16 21:37:50+00:00)
Title: 12179 handle unrecognized chords

This is stages 2 & 3 of my proposal for improved chord symbol handling (stage 1 has already been merged). The proposal has been discussed in a video conference, on the developers mailing list, and is documented in quite some detail here:

https://docs.google.com/document/d/1Q7LXHDSkQb70xmcyquFSiSv_lGbOXMDwzn_24-n7qJw/edit#heading=h.rfnw8k6absnk

This pull request changes the handling of unrecognized chords - chords that do not match any chord id in the chord description file - so that that they transpose normally (both root and bass) and are rendered nicely. The rendering uses the actual name of the chord as typed but uses the parser (introduced in stage 1) to organize the chord name into a hierarchy of tokens for rendering purposes (eg, "maj7#11" becomes "maj", "7", "#", "11", with "maj" classified as the "quality", "7" as "extension", and "#" and "11" as "modifiers"). The rendering uses optional new "token" tags in the chord description files to control the rendering of each token (with a "render" tag for each). This allows for sophisticated rendering of these unrecognized chords (superscripting, symbol replacement, changes of font, etc). In the absence of a "token" tag, a token is simply rendered as a literal, yielding a result similar to stdchords.xml

The handling of *recognized* chords (one matching a chord id in the chord description file) is not changed except that a "name" tag is added to the Harmony element of the score file, "just in case".

The intent is to provide a new "WYSIWYG" mode of chord entry based on a chord description file with "token" tags but no chord id list. All chords would thus be "unrecognized" but still rendered nicely according to the tokenization performed by the parser and the "token" tags in the chord description file. The advantage of this mode for the user is that he will be able to type either Cmaj7, CMaj7, Cma7, CM7, Cmaj7, or C^7, and it will be rendered as typed (with ^ turning into a triangle). Thus there would be no more worrying about customizing or loading different chord description files to get a particular desired chord spelling. Of course, the option of using traditional chord description files, with their exhaustive chord id lists, will be maintained.