Half/Double Duration Proposal

• Apr 5, 2019 - 05:15

A facility to halve or double the durations of a passage - also known as diminution and augmentation - has been a long-standing request. We've always tended to think of this as a complex problem, but it needn't be - as long as you don't need to create an augmentation that results in tuplets crossing barlines anyhow.

It turns out it is actually quite simple to implement such a facility by tying in to copy/paste. I have a working prototype that achieves this via a "paste half" and "paste double" command - select and copy a passage normaly, select a destination normally, use "paste double" or "paste half" command to paste a halved or doubled copy. You can then paste right on top of the original or somewhere else. It works for tuplets as long as you don't double over a barline (you get the usual error about pasting tuplet across barlines).

I'm looking for feedback about how people think this would work best in terms of the actual commands. It could literally be new "paste half" and "paste double" commands, or it could be a "paste special" that opens a dialog with radio buttons. Or if people think they would mostly want to do this in place, it could be a single command that copies the selection and pastes right back to the same spot - but I rather like the flexibility of being able to paste somewhere else if you want.

What do people think? Given an implementation that is essentially a modified version of paste, what's the most sensible way to expose this in the user interface?


Comments

I like the idea of the paste special dialog box with radio buttons. One big advantage of this is that it would give you flexibility. You could literally paste it almost anywhere as long as you don't violate the tuplets crossing a barline rule. BTW, this would apply to both double and half depending upon where the user pastes the results.

You could replace the existing notes by using cut and paste special to the same spot rather than copy. This would eliminate slurs, tuplets and other items that might end up being problematic. Tuplets are a problem because you can't paste over them at the moment. Slurs are a problem because they remain after you paste on top of them. Cutting them removes them from the destination.

"What do people think"?
Well, how to say: here, when I see that: https://musescore.org/en/node/278980#comment-909325, I am HA-PPY! :)
Thanks so much for this idea and implementation (as soon as possible!)

"I'm looking for feedback about how people think this would work best in terms of the actual commands. It could literally be new "paste half" and "paste double" commands, or it could be a "paste special" that opens a dialog with radio buttons."

The simplest way would be the better. And so, please exclude the idea of the dialog with radio buttons. The dialog boxes have never been the fundamental spirit of MuseScore - it's more like the one from 'Finale'! :(
And so we must preserve that.

Does paste double also create extra measures if pasting to the end of the score? If I need to doubletime a whole score I would've expected a doubletime command to perform that logic for me as well.
With paste double this intention might be less clear or not always desired even.

Thoughts?

In reply to by jeetee

Since right now this is literally just the paste code, (EDIT: yes) new measures are created. But it's a valid question as to whether they should be with or without the doubling.

I actually didn't remember that we currently do create new measures automatically on paste even in 3.0.5. I guess this was a deliberate change at some point? So anyhow, it continues to work this way with paste half/double.

This would be great - I have a handful of scores that need it. ;)

I don't think I had thought of a paste method, but I'd probably be happy with it. For tidiness in the menu, there could be a dialogue, but unless there's something more sophisticated, I'd do with two normal buttons over a radio one (less clicking).

A few additional points:

Here is the currently open issue: #278980: Augmentation/Diminution features

Here is the PR: https://github.com/musescore/MuseScore/pull/4875

For now, I have a UI in place for the purposes of testing the PR that is not what I would actually recommend, but is kind of interesting. I use the duration buttons on the toolbar to control the ratio. If you have the quarter note selected when you paste, you get normal paste (also if no button is selected),. If you click the eighth note icon before the paste, you get half; half note you get double. What's interesting is it also work to select sixteenth note to get 1/4-time, whole note to get 4X, etc. Not that these would be common (and you can always get this effect by halving or doubling twice), but the code does support it directly. That could be the reason to use a dialog, maybe in addition to dedicated half & double commands (much as we have direct commands for triplet / quadruplet etc but also an "Other" dialog).

Using the toolbar icons is of course not a good idea because it would be too easy to do this accidentally. My PR makes you first switch to "timewise" (now called "insert") mode to do this. I'm not a fan of adding yet another mode, but if any of this gives anyone any ideas, please share!

[REVISED POST -- Per Mike's suggestion, I have replaced the term "Paste timewise" with the word "Insert". However, this is just a strawman suggestion. The implementers will make the final decisions.]

Marc,

I like your idea of simplicity and flexibility. Simplest is usually best. It is easiest to understand and to use.

However, a Paste Special function, with radio buttons, opens up a lot more current and future options.

In a single Paste special dialog box, one group of radio buttons could be
(o) Paste as is
( ) Paste double
( ) Paste half
And a second group of radio buttons could be
(o) Paste normally
( ) Insert

This not only gives the user a choice regarding how the half-time or double-time phrase is inserted, but it also opens up countless possibilities for future Paste special options, which would be a discussion for a distant future thread. I do not want to stray from this thread's focus on Double and Half time. You can see, however, that someone might want to use "Paste special (o) Paste as is (o) Insert" for other things than just halving or doubling timing.

Paste special, of course, can be its own, unique keystroke. e.g., < ctrl>< shift>-v instead of < ctrl>-v
That way, the user would only encounter radio buttons if he or she truly needed a special paste variation.

Regards,
David D.

In reply to by mike320

I know ;-) You are right, Mike. It was so confusing to me, that the only way that I was able to find out how to insert a note, and to later find it in the docs, was to first ask how to do it, in a thread. I could not even find it searching the docs.

I just used it here because I knew you would understand what I meant.

But yes, by all means, the paste option should use the term "Insert".

I HAVE CORRECTED MY SUGGESTION, in my posting, per your suggestion.

David

Thanks for your engagement. Copy-paste mechanism is interesting, even if I'd find more natural selecting something and applying the function on place. This perhaps could help avoiding to lose all other elements like tuplets, slurs, and so on? If doing double/halve means stripping from the music everything which isn't a note (only pitch and duration information are left) this perhaps isn't going to be very useful.
As for UI, I'd suggest a "paste special" menu item (with shortcut) expanding in a window with all options. This gives flexibility and expandability. The "standard" copy-paste process should stay untouched in order to conserve speed and ease of use (I mean, avoiding to close a pop-up options window each time you perform a "normal" copy-paste).
Thanks everybody.

In reply to by lm.cd07802@gmail.com

Marc described that the early development changed the durations based upon which note duration was selected on the toolbar. I was curious if the dots worked as well. If so, then something similar in the UI would be useful in multiplying/dividing the durations for pasting 4/4 to 6/8 as I've seen requested at times. I've also manually done this at times.

In reply to by lm.cd07802@gmail.com

Indeed, this would be possible to implement as well, but rather more difficult - it would mean converting tuplets to regular notes and vice versa. I'm sure it's doable, but as simple as just multiple each duration by a scaling factor, which is what my code does. So sure, in theory, my code would allow you to select dotted quarter as the scale and get a 3:2 ratio, but that would just turn eighth note triplets (in the space of a quarter note) into dotted eighth note triplets (in the space of a dotted quarter note). Actually, it's probably not that hard to convert that into plain eighths, at least if there aren't nested tuplets involved. I can take a look at that too.

In reply to by Marc Sabatella

I wouldn't expect the behavior to be any different than keeping the same time signature from the programmers point of view. There are no triplets necessary for example in 12/8 time. For example, a quarter note needs to take the time of a dotted quarter note, which does not require a triplet in 12/8. I guess it gets rather complicated when you start changing the 8th notes, since you now expect 3 8th notes where there were previously 2, so perhaps this isn't such a good idea.

In reply to by mike320

Well, in the simple case, eighth note triplets in 4/4 are just plain eighths in 12/8, so if I do that conversion and then also change quarters to dotted quarters et al, we'd be good. In theory, that's doable, as is the reverse, but it's not as trivial as what I've done so far. Also, we'd have to figure out what to do about quintuplets or other tuplets not a multiple of three, also nested tuplets, etc - could get messy.

BTW, converting from 3/4 to 6/8 should work fine with my code, it's just a plain halving - quarter notes in 3/4 become eighths in 6/8, so just copy the 3/4 region, "paste half" into a 6/8 region and it all works.

Overall it seems there is most support for "Paste Special" command that pops up a dialog. I do sympathize with the wish to avoid a dialog, but hopefully we can make the process still simple and easily controllable with keystrokes. Also, no harm in also having direct shortcuts to the half & double options, much as we have direct shortcuts to certain options within the Format / Style dialog (toggle mmrests, hide empty staves).

Can people suggest what they think are particularly good models for how the Paste Special dialog might look & work? A few radio buttons, OK/Cancel?

In reply to by Marc Sabatella

I like the format dddiam suggested and hope insert is an option, though that probably will need to be added later.

Keyboard interface is not used often by MuseScore in the midst of a dialong, so I don't know if it's easy to implement key presses to select the radio buttons, like D for double and H for half. That would allow for ctrl+shift+v, d, enter to paste double and ctrl+shift+v, h, enter to past half and also allow for later capabilities which we have agreed not to suggest in this thread.

In reply to by mike320

Insert probably isn't hard. Seems somewhat unrelated, right? Like you might want insert of normal paste as well as of half or double. So it could be a checkbox separate from radio buttons.

Keyboard definitely is used within dialogs, by me and definitely by blind users. Tab, Space, and Enter are the main shortcuts used to operate controls. But you can also have mnemonics for individual buttons as far as I know (I'm not positive). But drop down lists and so forth have normal completion behavior. In Format / Style, for instance, you can use letters to select from the different pages in the list at left, then tab over to the other side and start navigating.

Anyhow, ideally, the design would make it possible to select half or double with one or two keypresses - whether mnemonic (letters) or navigation / Space, then Enter to hit OK.

In reply to by Marc Sabatella

Would not Insert mode be necessary when doubling, in order to avoid overwriting measures or notes within a measure?

I was also thinking of future enhancements, such as converting to and from tuplets, which would not result in an integral number of measures. IMO, it is best to keep options open. One can never anticipate every case that a user will come up with. The options leave the choice in the users' hands.

However, implementing the world takes forever, and, once released, would still be met with suggestions for changes.
So I would suggest implementing it in phases, releasing the simplest functions first.

You can ask participants in this thread to beta test with a nightly.

Marc, I think that I speak for everybody here in expressing our collective gratitude for your responding to these enhancement requests and for taking ownership of the implementation. Thank you thank you thank you!

In reply to by dddiam

You're welcome, but let's save the champagne for when it actually gets merged :-)

As for insert, I don't see why it would be any more important for double than anything else. If you're wanting to replave a passage in place, you'll need to add measures, sure, but this happens already when pasting as I mentioned above. And you're unlikely to want to keep the original meausres in that case. Or maybe I'm misunderstanding something about your proposed usage?

In reply to by Marc Sabatella

We can certainly get by without being able to insert halved or doubled passages, but it might take a bit more manual manipulation of existing measures prior to the Paste special.

I am assuming that the halving and doubling functions would apply to a selected passage which might not begin or end on a measure boundary, or might not be a number of beats that is a multiple of the standard beats per measure. Instead of figuring out the best way to treat odd cases, we can let the user figure out how he or she wants it to work.

You are correct that Insert mode would not be any more important for double than anything else. However, doubling and having might increase the number of cases where someone might want to insert something.

Also, I do not know whether or not MuseScore currently has an Insert mode function to insert a phrase from the clipboard. The only thing that I found in the docs was the ability to insert a single note. "Paste special Insert" might be a new function.

I do not want to disregard the importance of ease of implementation. I would rather have a simple function quickly than a more robust function that takes a long time to implement,

I have never programmed a music score editor, but one thing that I did learn in my decades of systems development, is that it is impossible to predict how a user will use functions. One could say the the devil lies in the usage.

In reply to by dddiam

We don't have a mode that inserts new measure, but we do automatically append measures to the end of the score if the score isn't long enough for the pasted region. This is what I am thinking would be completely sufficient for the case where you have a piece of a given length and you want to double the whole thing. Ctrl+A, Ctrl+C, "paste double" and you're done.

In reply to by Marc Sabatella

Here's something else that just occurred to me:

We already have commands Q & W to halve/double the duration of a single note. What if they worked on a selection, modifying it in place (by internally doing a copy and paste)? And/or, made Ctrl+Shift+Q/W the "paste half/double" shortcuts? This could potentially work in addition to a "paste special" dialog.

In reply to by Marc Sabatella

That would be a nice, straight-forward solution, Marc.

If one only wanted to halve or double an integer number of complete measures, then the process would be a piece of cake. The user would just add additional measures if needed to accommodate doubling, or remove extra measures after halving. If halving an odd number of measures, the user would need to decide what to do with the resulting extra half-measure.

For halving or doubling a phrase that does not begin and end on a measure boundary, it might be easiest or least error-prone for the user to use a temporary work area of extra measures beyond the end of the composition, and then adjust the original area prior to copying the resulting new phrase back into place.

What do others think?

In reply to by dddiam

As Marc suggests, this could potentially work in addition to a "paste special" dialog.

The ability to insert a copied phrase, rather than just being able to insert single notes, would be a great-to-have feature.

However, the insert phrase request can be decoupled from the halving/doubling request, coding-wise. Later, a "Paste special" dialog box could easily combine the two requests.

That way, we can potentially have a straight-forward halving/doubling feature quickly, and with an easy to explain and use U.I.

In reply to by Marc Sabatella

I like the idea of a single shortcut based upon Q & W being used to bypass the paste special requirement while still allowing paste special.

As for the suggestion that MuseScore needs to do anything special for different measure numbers or beat locations, I say just paste it where the cursor is and let the user undo it if that's not what they wanted. As is the case with the current paste command, add measures if needed. No need to make special rules that will get confusing. The only thing the user will really need to look out for is a tuplet crossing a bar line, but that's already a potential problem that we almost never hear about, though I do suspect we will hear about it occasionally with the paste double command.

It's not merged yet but is completely usable with the "Edit > Paste Half Duration" (Ctrl+Shift+Q) and "Edit > Paste Double Duration" (Ctrl+Shift+W) commands I added, so here is a link to a Windows build for testing:

https://ci.appveyor.com/api/buildjobs/av5f16x8c3hswp7v/artifacts/MuseSc…

You can also access a form of "paste special" by assigning a shortcut to that command in Edit / Preferences. For now, the command looks at the duration toolbar as described previously to scale durations however you like. Eventually this can be a dialog but I don't think we're ready for that.

In reply to by Marc Sabatella

So cool...! Really very useful and convenient to use :)
It also works in multivoices context (it was expected, but it was really one of the big problems/limitations with Half Time/Double Time plugins).
And I also tried the Special Paste, assigning the Shift + P shortcut, e.g. As expected, too.

The whole is just perfect like this (with the shortcuts, and also in Edit menu for the Double/Half durations). So, thanks so much.

As with Fingering mode - well, when it will work completely! -, there will now be a MuseScore program before vs. after this implementation of Double/Half duration.
And please, while you are inspired, continue to have both smart, and so useful ideas! ;)

In reply to by cadiz1

Thanks for the feedback!

Interesting comparison with the fingering mode. Both relied on a realization that there was a very simple way to get the desired effect using a somewhat different approach than I think most of us had assumed would be needed. No doubt there are more such opportunities. Step one is finding them: identifying a problem that everyone agrees would be nice to solve but we developers keep saying "yeah, but that would be hard". Step two is coming up with the clever alternative design :-)

I'm happy to report it's merged and available in the nightlies. Edit / Paste Half Duration (Ctrl+Shift+Q) and Edit / Paste Double Duration (Ctrl+Shift+W), plus the Paste Special command you can define a shortcut for that chooses the scaling ratio based on the note input toolbar.

Enjoy!

kq5PAp0J5g.gif

In reply to by dddiam

THE LOGICAL SHORTCUT FOR PASTE SPECIAL IS: < ctrl>< shift>V

Since the Paste half/double functions use < ctrl>< shift>Q and < ctrl>< shift>W
(a convention derived from the single-note functions Q and W);
and a normal copy and paste are < ctrl>C and < ctrl>V,
it seems (to me) that the logical shortcut for Paste special would be < ctrl>< shift>V.

So, using Edit=>Preferences=>Shortcuts, I first changed "Toggle View mode" to < ctrl>< alt>V,
thus freeing up < ctrl>< shift>V to be assigned to Paste special.

In reply to by dddiam

Agreed. I didn't bother here because I doubt this is the final form of paste special, we could still use a dialog box rather than using the toolbar, we might still want to have an "insert" mode, and for it to be much more useful than the current paste half/double duration commands, it really needs to deal with the conversion between simple and compound meter (e.g., triplets in 4/4 to eighths in 6/8 or 12/8). Until that happens, I'd just as soon not expose the command more.

In reply to by Marc Sabatella

I fully agree, Marc. I did not expect any additional changes. I was just sharing how I appeased my mind for now. Just in case someone else would also like to use < ctrl>< shift>V for their custom shortcut.

And I love the fact that the tuplets challenge and the paste special options are still percolating in your head.

I forgot to mention in my < ctr>< shift>V post that, in order to change the shortcut for "Toggle View mode", I first had to "Clear" its existing shortcut, and then add the replacement shortcut. Otherwise the system retains both the old and the new shortcut for "Toggle View mode".

In reply to by drowo

Wonderful!

So far I've discovered one bug: hairpins and other lines within the selection don't get processed correctly. They'll remain in the original positions, which may no longer correspond to any notes at all, which can then cause further problems. So, I recommend for now excluding lines from the selection using the Selection Filter when using this. And hopefully I'll have a fix soon.

In reply to by Marc Sabatella

I'm so glad you made this! As a beginner, it was so infuriating to have a bunch of selected quarter notes turned into note-rest-note-rest... etc. when I clicked the eighth note button on the toolbar. I was cutting and pasting every individual note to reconnect them!

I do want to "upvote" the idea of insert/condense/expand/paste in place to avoid the extra copy step.

It would be nice if you could add the ability to use the mouse to right-click and paste half/double from the context menu versus memorizing additional keyboard shortcuts. However, I'm still glad I've found out how to finally do this! Thank you so much for your time and great work! Have a blessed day!

In reply to by ee361ta

The idea of adding these commands to the context menu has come up, but it complicated because it actually doesn't even work correctly for regular paste. The paste happens starting wherever you might happened to have selected (often, the original source) rather than the right-clicked location. So we would need to sort that out first. But meanwhile, no need to learn the shortcut if you prefer not to, the commands are in the normal Edit menu. Also, you can customize these or any shortcuts to be something you might find more memorable using Edit / Preferences / Shortcuts. Note that Q and W are used for halving and double duration for individual notes as well, that's why these shortcuts leverage that by default.

I was so happy to find this thread and realize as I read it through that not only was the feature discussed so cogently but that it had been implemented and snuck in while I was not paying attention. I started using it immediately. Hooray!

Alas, in 3.2.3.22971 which I just installed this feature seems to have disappeared.

Or am I missing something?

In not, is there a way to get the old version running again, or get anew build with this great feature restored?

Thanks!

In reply to by BanjoJake

To be clear: it's in every version since 3.1. At no time was it ever removed, it's always right there in the Edit menu, and available via keyboard shortcuts Ctrl+Shift+Q/W unless you've customized that. 3.2.3.7635 is the current version for Windows, the last part (the build number) might potentially be different for other OS's.

In reply to by jeetee

Good call - it appears the MDL workspace does indeed customize the menus. They should either stop doing that, or be sure to keep their extension up to date with menu changes in the core program.

Meanwhile, for people using MDL - even with the commands gone from the menu while in the MDL workspace, you can access them via the shortcuts Ctrl+Shift+Q/W, or you can switch to the Basic or Advanced workspace temporarily.

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