How to change the duration of an existing chord?

• Dec 19, 2017 - 18:15

I'm working on a quasi-abandoned plugin which implements star-dots (see https://ianring.com/stardots/) which modify the duration of a note like a dotted note, except by adding 1/4 of the original note value instead of 1/2 or 3/4, resulting in a much neater score for any song in a quintuple-based meter, rather than having to tie 5-beat notes as 3+2 or 4+1.

Drawing the star dots were not a problem, however, I've got stuck at the duration-changing part. I've tried changing the chord.duration property, but I can't get my hands on a FractionWrapper object at all -- looking inside libmscore/ it doesn't seem like it is possible to change the numerator or denominator just like that. I've also tried simply deleting (using Chord.remove), then re-entering cloned notes with a cursor.setDuration beforehand, however, it just gives me an error saying a chord already exists in this segment and the new chord with the new duration cannot be added.

Is it even possible to go about doing this, or is changing the duration of existing chords via a plugin something planned for the future?


Comments

Personally, I'd just do it the way everyone else does it for this sort of thing (when you can get it notated but it won't play back in the software):
-Start by making sure that NONE of the chord members play. (Press F8 and then uncheck "Play.")
-Follow up by notating the chord's full note-length value the "traditional" way (i.e. notes tied together) in Voice 2 (or Voice 3 and 4 if your chord needs two voices to play).
-Finally, make Voice 2 (or 3/4, respectively) invisible--notes, stems, and all.

I've been independently attempting to make a plugin for this, with no success. I wouldn't mind comparing code and collaborating on this.

Do you still have an unanswered question? Please log in first to post your question.