Question about Plugin API's Cursor + adding chords
I've run into a problem related to the Plugin's API and adding chords
Using the cursor, I can add an element, but if at that cursor position there is not an equivalently sized segment, then there will be a problem with the overall size of the measure:
As with the image here, for example, if I have an element that is a half-note ready to be added using
cursor::add (Ms::PluginAPI::Element *) and i'm in a 4/4 measure on the last quarter at 4/4, adding that half note will give me an actual half note instead of a quarter note that ties over into the next measure. The measure will be 5/4 afterwards. I couldn't find a flag or something to have this not happen, so I figured damn, I guess I'll have to use the addNote() function that takes an integer pitch and then lose out on the accidental information (using only midi pitch information)
But then even here as shown, if I build up a chord pitch by pitch using that function, the same scenario will give me the built up chord on the next measure post-tie, not both together so that the entire chord ties appropriately.
Is there any way to get this to work like you'd normally expect as a user?
If so, is it not a a crazy work-around? It would've been really nice if adding an element could act like an actual user-interactive form and give expected results. Alternatively, to be able to designate a tonal pitch class + accidental at the cursor like Dbb instead of be bound to MIDI pitch would be nice, but it wouldn't solve the "spill over" problem that works automatically when for example manually copying/pasting a half note at the end of a quarter rest of a 4/4 measure.
I have gotten something to work by pulling a fast one, but it feels kind of crazy: going back to the first cursor position of building a chord, testing if there is a tieForward, and then build up the chord once more if so, and in the process issuing a cmd("tie"); to tie forward for the newly added pitches also. It works, but it feels weird and not sure how it would work if there were more than one tie for like a really long chord.... that'd be another thing in itself...