Navigation through Harmonies
Dear all,
I plan to write a "Harmony Audition" plug-in.
First append a blank part to the score.
Then navigate with cursor through all those chords and rests to find Harmony objects added to them.
If I found an "Am" harmony, for example, then I insert a new chord with notes A, C, E into the blank part at the cursor position.
If I found another "G7" harmony, for example, then I insert "G B D F".
After running the plug-in, if I play the score, I can hear the harmonies played by the new inserted notes.
However, according to the document, I noticed that
the Chord Object has addHarmony method to add a harmony, but no harmony() function to get it back;
the Rest Object has addHarmony method to add a harmony, but no harmony() function to get it back;
the Score Object has hasHarmonies attribute but no access to those harmonies.
It seems the design of the framework (or the documentation) is incomplete.
Is it possible to navigate through all the harmonies?
Similar discovery is that the Score Object has hasLyrics attribute but no access to those lyrics.
Best regards.
John Lin
Comments
OK, thanks to Marc's response. I decide to write a quick workaround plug-in for my own use only.
The plug-in saves the score as a musicXML and a midi temporary files. Then QProcess invoke another program of mine to process the two files.
The invoked program parses the musicXML to fetch those harmonies. Then it loads the midi file, adds harmony notes, saves the augmented midi file, then invokes system shell to play it, and quits.
One alternative way is to save only the musicXML, and deal with the whole musicXML. However it is much more efforts for me to parse the whole musicXML than just filter out the harmonies.
Thank you very much.
John Lin