Convert existing notes to triplet?

• Jun 14, 2019 - 22:58

I'm wondering if there is a way to convert three existing notes in a beat (e.g. two sixteenth notes and one eighth note) to a triplet of the appropriate identical-length notes (e.g. triplet of three eighth notes)?

I can change the first sixteenth note to a quarter, at which point the other two go away, then ctrl-3 to re-add the notes back into the triplet. However, besides having to add the notes back in, several verses of lyrics also disappear, so I'm hoping to find a way to convert instead.

Possible in 3.1?

Thanks, nice work on the 3.x series, big step forward, especially 3.1, IMO.


For converting existing notes on the staff to triplets, it would seem easiest to select the duration for the total period (quaver), then select the 3 notes (blue box around them). Finally 'Cont + 3'. The 3 notes would then be converted to triplets for a duration of a quarter note.

In reply to by michaelch2934

Interesting idea. As long as the user doesn't do an impossible tuplet, MuseScore should be able to handle this. ctrl+3 is the wrong key combination since this currently means turn each note/rest into a triplet (I personally use this feature), but another unused combination could work. Also the duration would need to be somehow modified either by using a key combination or placing the duration after the command to make a tuplet.

I guess if the user asks for something impossible, like turning 4 16th notes into a triplet, it would simply put up an error dialog.

In reply to by mike320

That's great if you're entering a new score, but I'm converting a number of piano pdfs and the scanning software or musicxml interpreter made quite a few mistakes. In this score, many triplets are missing and it sure would be a lot more convenient if I could just select three eighth notes and convert them to a triplet!

Cleaning up the score is a ridiculous amount of work; there are many mistakes including problems with voice assignment - instances where some notes in a chord are assigned a different voice so that bogus rests appear etc. etc. It wouldn't be a big deal if I could just delete the irrelevant clutter, but that seems to violate the rules and it's not obvious why.

Anyone know a good program for converting pdfs to musicxml? All the ones I've tried have major flaws. Hints on how to clean up the score (short of entering it from scratch) would be appreciated! I suspect many of the problems would never be encountered when entering music. Musescore developers do not appear to have anticipated this situation or they would have made editing more user friendly. Some things like triplets are much easier in Finale, but that's not a slam dunk either....

In reply to by bluegs

At some point, you make a choice - create a program that makes the normal things like entering notes and doing ordinary editing easy, or create a program designed to help correct flaws created in bad MusicXML files. Chances are there are programs that specialize in the latter You might consider installing Audiveris - the program used by the free import PDF service in MuseScore - and try playing with its UI. It is designed specifically for that sort of thing.

In the end, I find it simpler just enter music normally.

In reply to by Marc Sabatella

Well, what about recorded improvisations? Or even just say you are composing, at the keyboard, you record a part you want for your score as MIDI? Wouldn't that be a very routine, expected scenario? Rather than "bad" XML (or MIDI) -- it's actually far superior. In that it most accurately captures the raw performance with all its idiosyncrasies in timings. The trouble though, is the import.... Admittedly, software that could do this excellently would be enormously complex.... Obviously predicting exactly the correct intended voicings, durations, beam structures, etc. would be a tall order; hence, the very common need for conversion functionality of existing (imported) notes, which may be "bad" (really it's the Musescore MIDI import tool doing the "bad" though).

I may be in the slightly wrong post, but, I arrived here trying to see if it's possible to convert notes in bulk to triplets.

For example, my specific problem, from a score in 3/4 time:
Screen Shot 2021-02-16 at 07.36.21 PM.png

You can imagine, that instead of the rhythmic structure shown, the 9 notes were instead equal duration, as triplets. Like this (except this is the previous measure where I've manually converted them, including carrying over the live-recorded velocities - so, just pretend the notes matched the first screenshot):
Screen Shot 2021-02-16 at 07.36.51 PM.png

Perhaps there is a way to select all the notes in the first screenshot, and somehow transform them all into equal duration triplets? I really do think there would be logical, practical utility to such functionality. I know for me personally it would be a game-changer for my ability to create scores... I may program a custom plugin (for musescore) but just have not yet had the (long amount of) time to do so..

In reply to by jeetee

True, point well taken. However, as I find that the Musescore editor combined with the experimental service provides a compelling tool for consuming, formatting, and modifying IMSLP content, I get frustrated with statements asserting that the tool should be focused on entering new content and not for modifying existing content.

In reply to by esplumer

It is the focus of the MuseScore workflow.

Then again, I've seen enough requests for more duration-editing and composing-rather-than-transcribing workflow features to be certain that there is a lot of room for improvement. Luckily some of those desires can be worked around with the available plugin framework (such as the Duration Editor and the other plugins mentioned in this topic).
Often enough exactly such a plugin and the popularity of it can be the additional push the internal development team needs to consider native inclusion in a next major update (as is now happening for TempoChanges; rit/rall/accell)

In reply to by esplumer

I would say it is focused on modifying existing content. But, only the sorts of normal editing that would be expected for normally-entered music. Like, a word processor has all sorts of editing commands to do things like copy and paste entire paragraphs around, or delete words, or insert new words in the middle of a sentence, etc. But if you want to take complete gibberish and turn it into something readable, it's often going to be easier to just re-enter it correctly. For the sort of semi-gibberish often produced by the sort AI technology that attempts to turn pictures of sheet music into actual music, it's more of a gray area. No doubt capabilities will improve, but still, it's going to largely depend on the quality of the input, and so far AI technology just hasn't progressed that fast.

In reply to by Marc Sabatella

I do not disagree with the premise. However, back to the original problem, converting from duple to triple patterns of notes does not seem like a case of correcting "gibberish". In fact, it might be common during a composition phase. As it stands, all the note values, accidentals, slurs, etc., were correct from the OCR but the triple indication was missing. I found no way of making this minor correction in situ. As the Handel sonata in question had a majority of measures with one or triple eighth notes in them, I ended up pretty much reentering each affected measure from scratch. So an "editing" task that should have taken a couple of minutes took more than an hour.

Hi all,
I want to bring up again and support jima1's request.
I also convert many scores and due to either the converter deficiencies or the score that frequently doesn't contain the "3" to indicate a triplet, I find myself with many bars to convert, Today's example being Mozart's "12 Variations on Ah! Vous-dirai-je maman", K 265 whose XML I attach for your convenience together with the PDF of the original score.
I have the feeling that the related software should not be that difficult or heavy to produce.
Never mind that applying the desired command to a would-be-triplet will reduce its time length.
That can be easily fixed via existing commands.
Thanks in advance for considering this request and move it up as a new feature to be implemented.

In reply to by Marc Sabatella

Thanks, I've just done it but I cannot make it visible to Plugin Mgr.
Relaunched MuS few times as well as reloaded plugins function in Mgr, still not visible...
This is my list of plugins files under : %HOMEPATH%\Documents\MuseScore3\Plugins

19/02/2020 09:56 34,221 chordIdentifier.qml
13/10/2020 08:57 122,365 chordIdentifier.qmlc
08/04/2022 15:56 54,848 durationeditor.qml
13/10/2020 13:56 838,567 Harmonia-v0.121ms3-en_3.qmlc
30/03/2022 15:22 3,477 NewRetrograde.qml
05/12/2021 12:25 3,959 ViolinFingering.qml

and durationeditor.qml is the subject of my current attentions.
Any suggestion? Thanks,

In reply to by Trottolina

I threw the attached together in a hurry and it is primitive and may be buggy. But I hope you feel up to it.

Put the plugins in your plugin directory.
Run ToTriplets1 from the Plugin creator window on File TripletTest.mscz (or your similar file)
In the output window you’ll see something like this:

Plugin Details:
Menu Path:
Requires Score
Debug: ["c",72,14],
Debug: ["d",74,16],
(note: the output window is limited to 1000 lines, so don’t go crazy...)

Remove the header and the debug statements (in a plain text editor such as Visual Studio Code (free download) ), so that you are left with:
open ToTriplets2.qml (in Visual Studio Code) and paste the notes at var my_notes, replacing the existing notes and leaving the end “];” in place;

now open TripletTemplate.mscz (prefilled with rests of the desired triplet format) and run ToTriplets2.qml also from the Plugin creator window.

I recommend only using the upper staff evt. with a bass clef. If you need to work in the left hand bass clef you need to set cursor.staffIdx = 1; (in ToTriplets1.qml)

For eight note triplets duration is set to 320. You can experiment with the number (line 135 in the ToTriplets2.qml code: cursor.setDuration(320, 1920);. For quarter note triplets I suppose 640 would be Ok, but I have not tested it. I have tested TripletTemplate with a 3/4 measure and it seems to work. Have fun!

Attachment Size
ToTriplets1.qml 2.51 KB
ToTriplets2.qml 4.03 KB
TripletTest.mscz 11.14 KB
TripletTemplate.mscz 14.71 KB

In reply to by Trottolina

In the meantime I realized I can make the plugin a little more elegant thanks to the next-score command. Proceed as follows:

Put the New2triplets plugin in your plugin directory
Open your source file first, and then your destination file filled with appropriate triplet rests.
Click again on the source file (making it the ‘active’ file) and run the New2triplets plugin.

It will fill the target file in one swoop.

I stress again that the plugin will ‘blindly’ read consecutive notes (without regard to their length) and ‘blindly’ fill the triplets in the destination file. This means that you have to make separate input files for every run of triplets interrupted by a note of different length. In the Mozart score var. III for example you have to do measures 1-7, then 9-15 etc. separately.

I also tested that 640 works for quarter note triplets (at line 67), but I leave the default at 320 for eight note triplets, and that setting cursor.staffIdx = 1; (now at lines 35 & 63 of the plugin) reads the left hand staff.

In reply to by Marc Sabatella

Hi Marc! I tried to run the Duration editor plugin but the setup is super complicated and not clear to me (nor clearly explained). If I run the qml file alone it tells me: Duration editor: no such directory.
I also doubt it would help Trottolina who wants erroneous quarter notes followed by eight notes converted into eight notes triplets. I attach the relevant piece of the mozart pdf conversion file.

In reply to by elsewhere

That's the older version. As explained in the main page for the plugin, the tuplet functionality is new in the beta of the latest version. And the fact that it's just beta is probably where there is no convenient ZIP package, but downloading a whole folder isn't difficult either.

Anyhow, since you seem to be suggesting your plugin has additional functionality above and beyond the Duration Editor, I'm suggesting you could collaborate to add your functionality to the existing plugin, which does a lot more than just create tuplets.

In reply to by elsewhere

Hi, Better go directly to GitHub:
Version 1.2.0 has no Tuplet feature, but is stable.
Version 1.3.0 is still beta. Has a Tuplet feature. Which is working pretty fine unless you are working with multi-voices.

In the final version of 1.3.0, (a.o) the Tuplet feature vs. multi-voices will be solved, as well as improved re-paste of chords/notes/accidentals when moving from and to a tuplet.
But I'm not currently working on this.

I'll check you plugin to see if there are some feature I could had to mine.

In reply to by elsewhere

You've reached the limits of the plugin:
1) The selection must be limited to one staff (*)
2) The selection must be within one measure.

This is by design.

For (2), working in a cross measure way is difficult to manage. What should be the impact of a modification on the next measures ?
In your example, the G of the 2nd measure will become part of a tuplet in the 1st measure. How to impact this in the 2nd measure ? Replace the G by a rest at the beginning of the measure ? Move the E-G-F at the beginning of the 2nd measure and add a eighth rest at the end of the 2nd measure ?

So I guess 80% of the cases are covered to limit all the plugin actions to one measure only.

(*): and even more: one voice, but that limitation will be solved in the next release

In reply to by elsewhere

To be clear, that is not what I said. My actual words were:

"BTW, doesn't the Duration Editor plugin also provide some version of this functionality? Could be useful to merge them if they have different strengths"

and then later:

"since you seem to be suggesting your plugin has additional functionality above and beyond the Duration Editor, I'm suggesting you could collaborate to add your functionality to the existing plugin"

In other words, if there is a specific sub-case of converting notes to tuplets that the existing doesn't solve, instead of designing an entirely new plugin just to solve that specific sub-case, it could be more advantageous to more users to simply work on improving the tuplet functionality in the existing plugin.

In reply to by elsewhere

Hi, There:

has anyone gotten one of these Triplet converters to work? I've tried to load these plugins into MS2 and MS3, but neither will show the plugins in the dropdown, even after reloading, dumping, restarting my mac, etc.

I'm one of the folks who has been let down by the online pdf converter (gave me everything but didn't honor the 3s), and just want to change straight eighth-note runs into triplets. I'd love to not have to manually enter the six pages of harp arpeggios that I'm looking at.

In reply to by Marc Sabatella

Hi, Marc: yes, all my other usual plugins work--during my search, I found some folks saying that MS3 was pretty spotty as far as plugins working, and that at least the durationeditor was not supported in MS4.

I had to hold off on moving fully over to MS4 this past term, so now I'm kicking off my summer project using all the new stuff with an expected learning curve.

BTW, thank you very much for the correspondence and advice this week.

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