musescore/MuseScore — pull request #381 by MarcSabatella (2013-06-04 13:47:22+00:00)
Title: Support MusicXML import/export for unrecognized chords

[ This pull request replaces #378 and #380. I think I messed up the branch those were based on, so I'm trying again with a fresh branch ].

Currently, both import and export of MusicXML rely on matching against the exhaustive chord id list in chords.xml. This pull request allows MuseScore to generate chordnames directly from the MusicXML on import and to generate MusicXML tags directly from chordnames on export. No chord list is needed at all, although if a chord list is present, MuseScore will continue to try match chords against it as before, and will use any MusicXML tags found in the chord description file in preference over any it generates.

The "meat" of the change is in ParsedChord::parse for generating MusicXML export tags from a chordname and in ParsedChord::fromXml for generating a chordname from imported MusicXML. Both functions reside in chordlist.cpp. The "soul" of the change, however, is the refactoring that occurs elsewhere in chordlist.cpp and harmony.cpp. This refactoring allows all valid Harmony objects (recognized from the chord list or not, entered directly or imported) to have a ChordDescription object. This in turn allows export, rendering, and other "back end" functions to work independently of how the chords were created, and vice versa.

In merging my changes onto the master branch, there will be a potential conflict with Tony's pending pull request for capo chords (#371), in Harmony::render. I would be happy to resolve this myself manually once his changes are merged (assuming his are merged first).