Setting duration to 5/16ths inserts a quarter note

• Jan 1, 2024 - 09:29

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 just quit()

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

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