MuseScore
MuseScore copied to clipboard
[MU4 Issue] Regression - Lyrics don't paste word by word anymore
In MS3 I was able to use Ctrl-v repeatedly to paste lyrics one word at a time from the clipboard. This does not work in MS4 anymore and only the first word is pasted... repeatedly. I tested this in the latest Alpha release
Steps to reproduce the behavior:
- Create a score
- Copy a paragraph of lyrics from a text editor to the clipboard
- Use Ctrl+L to go into lyric entry mode
- Use Ctrl+V repeatedly to paste each word associated with subsequent notes
Expected behavior I expect each word in the copied text to paste one by one under subsequent notes in the score like they did in MS3
Platform information
- OS: ArchLinux
Additional context This is something I need for my workflow. I hope it gets added again in the final version.
I certainly agree this is a useful feature, but why it does require pressing Ctrl+V repeatedly, I would think just once would be enough to add all the words in the clipboard to the selected notes?
BTW the way it worked in v3 was to actually update the clipboard after each paste! Meaning if you pasted it elsewhere you'd lose the words already pasted into MuseScore. I certainly wouldn't advocate for that solution.
(secondary bug: copying lyrics when in text-edit mode from one note to another in the same score doesn't work as expected either, as the clipboard contains pseudo-HTML text)
I certainly agree this is a useful feature, but why it does require pressing Ctrl+V repeatedly, I would think just once would be enough to add all the words in the clipboard to the selected notes?
Because of melysmas:
Lyrics:
Be-cau-se! And al-so!
BTW the way it worked in v3 was to actually update the clipboard after each paste! Meaning if you pasted it elsewhere you'd lose the words already pasted into MuseScore. I certainly wouldn't advocate for that solution.
I think, it is not true. Just check it. Pasted only "Be-cau-se" into musescore Lyrics and than paste into notepad,and Ctrl+v gaveme whole sentence.
I think musescore uses some internal container for pasting lyrics. So if You paste half of text, pasted part is removed from internal container. So You can continue with text you stopped, on diferent place inthe score. But it isnot possiblre to paste same text twice, You need to copy it each time again.
Here is screenshot of bug.
https://user-images.githubusercontent.com/1646034/188870571-d520f5f7-d15d-467f-a255-c7616a8a6b58.mp4
Only first word (sylabe) is pasted. Into same note. If user manualy switch to next note, still always only first word is pasted.
Thanks @sammik. You said that a lot better than I could. I didn't know about the clipboard/internal buffer thing, but I noticed how that worked before. Very useful! I'm sure that I'm not the only one that used that feature regularly.
I did check it - both the source code and verified the behaviour. And sure, I understand the benefit of having control over where melismas go but it seems an abuse of the normal behavior of ctrl+v. Also repeated paste of plain text couldn't possibly handle correct syllabification without knowledge of every possible language you might be working with (and even then there are words that would normally require two syllables but are often squashed into one in musical settings, or words like "natural" or "every" that are commonly pronounced with either 2 or 3 syllables) I'm happy to try to come up with some similar sort of behaviour for v4 but I think it needs more design.
I think, it is not true. Just check it. Pasted only "Be-cau-se" into musescore Lyrics and than paste into notepad,and Ctrl+v gaveme whole sentence.
There's no way that's possible given the way the code for 3.6 works - the only thing that text is extracted from is the current Windows clipboard, and that's explicitly updated after each paste. I just verified for myself - after copying "be-cau-se", then pasting twice into lyrics in MS, then pasting into notepad (or anywhere else), only "se" is pasted, because that's all that's on the clipboard.
It may behave differently on MacOS or Linux, but given you mentioned notepad, I'm assuming you tried on Windows, so I don't know how you saw that at all.
I think, it is not true. Just check it. Pasted only "Be-cau-se" into musescore Lyrics and than paste into notepad,and Ctrl+v gaveme whole sentence.
There's no way that's possible given the way the code for 3.6 works - the only thing that text is extracted from is the current Windows clipboard, and that's explicitly updated after each paste. I just verified for myself - after copying "be-cau-se", then pasting twice into lyrics in MS, then pasting into notepad (or anywhere else), only "se" is pasted, because that's all that's on the clipboard.
It may behave differently on MacOS or Linux, but given you mentioned notepad, I'm assuming you tried on Windows, so I don't know how you saw that at all.
@wizofaus You are right. I tried Linux before. Now I checked Win, and it behaves, as You described.
About sylabes, MU3 was quite effective with that.
You needed to prepare plain text first in way: "every" -> "e-ve-ry" (exist tools for that), but once You have "e-ve-ry", it is really easy to get, what You need. If you need to squash two sylabes into one note, you simply use sentence "shift + space" (to go back) and "ctrl+v" to add next sylabe to first one.
It seems, MU4 in paste mode doesnt read " " as next-word, nor "-" as next-text-element. (But I may be wrong again :) )
But if you have to manually prepare the syllable splitting first then why not have the user prepare the melismas before copying to the clipboard too?
Because syllable splitting is easy and goes with the metre of the music. The melismas are more complex and depend on the words and notes in a way that is not easy to prepare beforehand. Sometimes you need to use a space, sometimes an extra '-' and sometimes a '_' to get everything into the correct place, and it's much easier to do that as you go instead of beforehand.
There's also the fact that some stanza-based music, like some hymns, have differences in the lyrics between the different stanzas. If there were a way to prepare this all beforehand, it would probably just be easier to type the text into MS and deal with it as you go.
You also wouldn't want to paste it all at once because, if there were a mistake, you'd have to undo, go and find the problem in your prepared text, and try again. This would be very cumbersome.
-- Mark Coolen Sent with Tutanota, enjoy secure & ad-free emails.
Sept 7, 2022, 2:37 p.m. by @.***:
But if you have to manually prepare the syllable splitting first then why not have the user prepare the melismas before copying to the clipboard too?
— Reply to this email directly, > view it on GitHub https://github.com/musescore/MuseScore/issues/13215#issuecomment-1239740744> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AATKCRT6YFCYUIAKQLQYCMLV5DOFNANCNFSM6AAAAAAQGIMMHQ> . You are receiving this because you authored the thread.> Message ID: > <musescore/MuseScore/issues/13215/1239740744> @> github> .> com>
Also consider, the correct number of "_" characters for a melisma may depend on how the rhythm is notated. For instance, a syncopated rhythm might be written with single quarter note off the beat, or it might be written as two tied eighths. A long note might be written with a tie across to the downbeat of the next measure or it might not, etc. So unlike with hyphens, you can't prepare your lyrics before the music, or have an automatic hyphenator do it for you. It's indelibly tied up in the specifics of the way the melody is notated. So it's almost always going to require some intervention during the paste.
Actually my original thinking was that you could place slurs across the notes where melismas should go before pasting. And remove them afterwards if it bothered you. I think the syllable based paste feature is a handy compromise, I just disagree it's what "paste" should do by default.
Restoring the "syllabic" paste functionality in v4 won't be trivial, partly because of some decisions I made around how space/hyphen/underscore should be handled (essentially, they now map to top-level actions which are handled by NotationInteraction, rather than being handled internally by the "Lyric" object inside the engraving library, which used an interface "MuseScoreView" to handle operations like moving the focus to the next Lyric element etc. The code to do the clipboard manipulation is also gone. Essentially this would have to be rewritten at the NotationInteraction level. It's not super hard, but as I said, I wouldn't think it made sense for it to be the default behaviour for pasting plain text. Actually another serious deficiency is that you can no longer copy lyrics (or indeed lots of things) between scores, because this relies on an in-process proprietary clipboard format (and MuseScore is now one-process-per-score). This is why there's a separate "copy lyrics to clipboard" command, though it doesn't seem to work very reliably when you have multiple verses etc. I don't quite understand why we even need that command - why shouldn't just selecting a range then using the selection filter to specify only "Lyrics" work just as well?
I would say that absent a new approved design from the head design folks, really, the focus should just be on fixing the regression, and worry let others about new designs for later.
The selection filter is incapable of creating a list selection, so no way to sue it to select only lyrics. In theory, this could be done with right-click Select / All Similar Elements and then somehow having the "copy" command recognize that only lyrics were selected and thus also copy the lyrics to the standard platform clipboard as plain text, in addition to doing the regular operation it normally does that allows the lyrics to then be, for instance, pasted directly onto another staff.
Again, absent a new design - which is almost certainly not happening for 4.0 - to me there is no reasonable answer but, just fixing the bugs.
I would consider a paste command that changed what was on the clipboard to be very much a bug though!
I've put up a PR that is my "best effort" job at replicating the v3 behaviour though I don't understand how melismas are supposed to work (I couldn't get them to work sensibly in v3). For my solution if you have the text "be-tween words _ _ there are spaces" and paste repeatedly then it will extend "words" over 3 notes.
Unfortunately, doesn't work on Linux. Go to next syllabe is OK, but always pastes first word.
I think I can guess why that might be, though I have no way to test it currently
Try again with the next build once it's available
Try again with the next build once it's available
Great! Works now.
Just one thing. Not sure, if "words _ " shouldnt be without spaces "words_". I cant say, what is right (or both?).
Try again with the next build once it's available
~~How do I get the 'next build'?~~ Forget it. Figured it out. I'll test today.
Just wait a day
Just wait a day
Oh. You mean I should wait for the 09/09 one. OK.
Actually a day after #13237 got merged. Or download the artifacts from that PR
Try again with the next build once it's available
@wizofaus I found one other issue / difference in Your solution.
Ctrl+v goes next note again and again, even if whole sentence were pasted
In MU3 it stopped on first note without sylabe.
https://user-images.githubusercontent.com/1646034/189200508-ce8106e1-2b4c-4550-8b30-55d851a283f4.mp4
Curious image... but yes I had noticed that. Still, the main issue to me is the fact that the clipboard is modified by the act of pasting, which I haven't come up with a good solution for (one possibility is to keep in a memory a string representing "what's already been pasted", and if it matches the start of what's on the clipboard, skip over that bit).
Ok I have a solution that doesn't involve updating the clipboard now. But instead of paste not doing anything once you've gone through the whole sentence, it just starts again from the beginning. And if you explicitly jump out of lyrics editing mode then resume, it will start pasting from the beginning again.
That’s pretty clever if you ask me, both technically and usability-wise!
Hmm, it will do some unexpected stuff if you update the clipboard yourself while still in pasting mode (which you can do either staying within MS or by switching to another app and back). Should be able to fix those too.
Found some other bugs with copying lyrics inside MS then pasting, because it's actually pseudo HTML content. v3 seems to handle this semi-ok (except it loses formatting)
Ok latest build now means: a) clipboard is not updated, but "remembered position" is reset every time you switch away from MuseScore and back again, or you explicitly update the clipboard while still editing lyrics b) copying lyrics to the clipboard while in text-edit mode and pasting elsewhere works as expected (essentially, it guesses if the clipboard text is HTML and pastes it as though it were a regular text element, preserving formatting where possible).