Setting duration to 5/16ths inserts a quarter note
hmm.. I think I may have found a bug in MuseScore 3.6.2, and more seriously in MuseScore 4.2.
I've attached a qml script that illustrates it.
Essentially, calling cursor.setDuration(5,16) and then addNote() inserts only a quarter note (4 16ths), rather than a quarter note tied to a 16th note.
Interestingly, it works ok for 3/16th & 7/16ths, I think this might be because there is a "natural" duration for each - dotted 8th note, and double dotted quarter note respectively. However there isn't a natural way of representing a 5/16ths without a tie.
In MuseScore 4.2, this script causes a crash.
Given this isn't working as expected (and may not be intended to be so!), what would you wonderful people recommend to achieving adding a 5/16ths note via a plugin?
Many thanks in advance. Phil.
Attachment | Size |
---|---|
5-16thsBug.qml | 903 bytes |
Comments
The crash in Mu4 is due to the
Qt.quit()
. Droip it or use justquit()
As 5/16 doesn't exist as a duration (other than as the combination of other durations) trying to create one is non-seniscal, and you get MuseScore's revenge
In reply to The crash in Mu4 is due to… by Jojo-Schmitz
Thanks Jojo - I suspected as much.
So, the best will be to insert notes & ties to accomplish 5 16ths, The notes I know how to do, but I can't work out form the API how to add a tie in a plugin. Any tips or help would be appreciated. :)
In reply to Thanks Jojo - I suspected as… by PitDadPhil
cmd('double-duration') https://musescore.org/en/project/note-duration-actions
edit: also https://musescore.org/en/project/duration-editor