I mean from plugin code. I am writing a plugin and the problem I am having is this: if I iterate through the score with getSegmentHarmony I don't get to see chord symbols that do not appear above a note: if I enter a whole note and 2 chord symbols 2 beats apart, I only get to see the first one in the code. But if I select all chord symbols (by hand) and loop via selectedElementsArray = curScore.selection.elements, I see both chord symbols. That's why I would like to select the chord symbols from within the code.
Any help highly appreciated.
I don't know much about plugins, but the trick is getting the segment - once you have that, then the chord symbol should be available note or no note. Somehow you need to walk all segments, not just the ones with notes.
Thank you for your answer, Marc. I found a plugin by jeetee (https://musescore.org/en/node/273379) that walks thru all segments using segment.next, and with a little fiddling I got it to return all the chord symbols, QED.
Comments
I don't understand "from within a plugin"......if you want to select all chords symbols select 1, right clic, sélection----all similars elements
In reply to I don't understand "from… by Raymond Wicquart
I mean from plugin code. I am writing a plugin and the problem I am having is this: if I iterate through the score with getSegmentHarmony I don't get to see chord symbols that do not appear above a note: if I enter a whole note and 2 chord symbols 2 beats apart, I only get to see the first one in the code. But if I select all chord symbols (by hand) and loop via selectedElementsArray = curScore.selection.elements, I see both chord symbols. That's why I would like to select the chord symbols from within the code.
Any help highly appreciated.
In reply to I mean from plugin code. I… by elsewhere
I don't know much about plugins, but the trick is getting the segment - once you have that, then the chord symbol should be available note or no note. Somehow you need to walk all segments, not just the ones with notes.
In reply to I don't know much about… by Marc Sabatella
Thank you for your answer, Marc. I found a plugin by jeetee (https://musescore.org/en/node/273379) that walks thru all segments using segment.next, and with a little fiddling I got it to return all the chord symbols, QED.