Feedback for plug-in Time Signature copy/paste
This is for copying a sequence of time signatures from one part of your score to another. It has a loop feature for those who want to copy a short sequence many, many times. The a9_prelim version is the latest experimental version. It uses the computer’s system copy/paste buffer to store info, so it can copy/paste across different Scores. This version seems to work in 3.6 and 4.2.1.
My first plug-in. Copied as much as possible from others. ;)
Will post more info shortly.
Comments
Since I don’t know how to insert measures in the middle of a Score, you have to do it yourself. (Edit: most current version inserts measures)
First, select the range of measures. Run plug-in. Change the repeat value from 1 to the number of loops.
Click where you want to OVERWRITE. Insert a lot of measures there. (Edit: doesn’t overwrite any more) Press the GO button.
The user interface is crude. I need to find a plug-in to imitate.
Hi, I tested it with several scores and worked fine, without problems, with the restrictions you indicated (can't paste to measure #1 but also cannot paste to measure #1 of a new section).
It would be great if it detected when the actual measure duration is different from the nominal, the scores which I used to test had several of those and they needed to be edited separately, but as it is it's already a huge improvement and time saver. All the rest worked well.
Thank you for your hard work. You solved a missing functionality that was plaguing Musescore, and many needed it. I don't know if a similar method can be used to copy-paste tempo marks, but if it could, it's the other big copy-pasting tool that people are requesting for ages.
In reply to Hi, I tested it with several… by Nuno R. Rodrigues
Thank you for testing it out. For the “actual measure time”, I couldn’t make that work but have some information which could possible set it using the command interface. I’ll have to try and see.
The comment “also cannot paste to measure #1 of a new section” didn’t seem to be a problem for me. Please describe this issue in detail.
If someone needs to insert time sigs into the first measure of their score, they should use the Musescore interface to insert multiple measures there, then time sig paste starting at measure 2, then delete measure 1. This is a limitation due to a workaround that was used.
When adding time signatures in some conditions, the nextMeasure function pointed to an incorrect measure. To work around that, the plug-in does a previous segment, next measure, next measure process. This seems to go to the measure after the measure of the updated time signature. Since there is no previous measure in measure 1, the plug-in won’t work properly.
As far as other “types” of items to copy and paste, the current problem is that my attempts to properly “add” some types of items failed. For instance, adding a new new rehearsal mark in a selected measure using a plug-in doesn’t work yet but they can be updated.
A primitive plug-in to reset all rehearsal marks to measure number is being worked on but only on those already added into the score. The copy-paste method isn’t known at this time.
I am not sure if tempo marks have the same issue. This can be looked at soon.
In reply to Thank you for testing it out… by TDYama
You're right, I've tested again in a new section and works. Thanks.
In reply to You're right, I've tested… by Nuno R. Rodrigues
Thanks for the update. For “copy-paste tempo marks,” are you talking only about metronome marks or is there more to it? I don’t delve into complex tempo marks.
As far as future copy/paste goes , I just got a plug-in to insert new metronome tempos and Rehearsal Marks so it should be possible to later copy and paste them.
Exporting to MXL afterwards and then drag/drop into Musescore seems a good practice to clean up overlooked settings by the plug-ins. That does strip away excess (more than one per measure) metronome tempo marks. MXL export seems to keep the first tempo mark added while Musescore, before export , plays the last one, when multiple tempo marks are added. Strange.
Rehearsal Marks when exported/imported get the default justification when brought back in, likely based on the system default.
I will try to make a copy/paste plug-in for tempo and rehearsal marks, among items that regular copy/paste doesn’t handle and see how it goes. I’ll probably make a reposition Rehearsal Marks plug-in separately, which will later be integrated into a bigger one.
… all based on guesses on how things work.
In reply to Thanks for the update. For … by TDYama
Yes, it's just metronome marks. Thanks.
In reply to Yes, it's just metronome… by Nuno R. Rodrigues
Please try the tempo copy and paste plug-in.
https://musescore.org/en/node/360887
Please check GitHub for the revised a6 version. The user interface isn’t updated yet but now it also copies “actual” time signature.
Revising actual TS at the time of insert didn’t work so well but after completing a line of time signatures, the plug-in jumps back and then updates the Actual Time Signature. This seems to work but please test it. Thank you.
I have started to use cmd(“insert-measure”) to insert one measure at a time but in some cases it doesn’t insert them. I made a workaround as described inside the file.
A revised version should be coming soon that does insert measures. Extra measures will need to be deleted afterwards.
Thanks for the clever plugin! Can it be used only within a single score, or also to copy time signatures from one score to another? The latter would be very useful as I'm trying to concatenate several scores into one.
In reply to Thanks for the clever plugin… by Erik A
Thanks for the feedback. Currently, it can’t work across scores as they are separate program instances.
This is the second situation where copying something from one score to another is needed. It won’t happen soon but I’ll try to make it work.
In reply to Thanks for the feedback. … by TDYama
> they are separate program instances
Does Musescore 3.x also use separate instances or is it just MS4?
In reply to > they are separate program… by Nuno R. Rodrigues
Mu4 only.
I posted a rough version that can save the time signature sequence to a file (save button). Then, you go to another instance, run the plug-in, use load button and then go-paste.
This is for design evaluation. It may work but I won’t be able to work on it for a bit, so I’m posting for evaluation. It’s on GitHub, ending in a8_prelim.
It also adds measures and adds a time signature at the insert point, to protect any prior work.
As always, appreciate your feedback so it can be more useful in the future.
It could always write the file so you don’t have to remember to save but it could be irritating as well.
More measure fields ( such as don’t count in measure number calculations) will be added in the next version.
In reply to I posted a rough version… by TDYama
Thank you for the test version! Unfortunately I cannot make it work. MS crashes when I click "Load". I'm not sure if "Save" saved anything, because I cannot find timesigCP_V1.tmp anywhere on my computer.
In reply to Thank you for the test… by Erik A
I revised it with an “a8-C.” Please see if it is better. Are you using version 3.6? Also, are you using a Windows computer? The filename and directory info changes so I may need another go at it depending on your OS. I tested this on Ubuntu with MS 3.6 and 4.2.1.
Thanks for testing it out.
A revised version will use the copy/paste buffer and not use the file system, which seems different between v3 and v4, and likely different between different OSs.
In reply to I revised it with an “a8-C.”… by TDYama
Unfortunately no change—it still crashes on Load. My guess is that the plugin tries to save the file in a location that MS is not allowed to access. I am using MS 4.2.1 on a Mac. Also tried 3.6.2.
In reply to Unfortunately no change—it… by Erik A
Anything in the logs?
In reply to Anything in the logs? by Jojo-Schmitz
I think I did a console.log of the home directory and temp directory, so they could be in the log. Do you happen to know where the log shows in Mac?
In reply to I think I did a console.log… by TDYama
Good suggestions. Yes, I thought I knew how to read the console log in the Mac. One can use either the Mac app "Console" or the Terminal window, of which the latter works pretty much like any Unix shell. I find lots of messages from MS in the console, but nothing that seems to come from the plugin. For example, I have tried some variants of "log show -process mscore | grep Home", which returns nothing. Suggestions are welcome. I am not a programmer and may have made a simple mistake.
In reply to Good suggestions. Yes, I… by Erik A
You may need to run the Musescore program with a “-d” switch for debug mode. Since the system buffer works, the temp file version will go away.
In reply to You may need to run the… by TDYama
Interesting! I did as you suggested and learnt many new things. Previously I had only launched MS in the normal way (for a Mac user), by clicking its icon. Launching it from the command prompt, even without -d, made a difference! In this way, the plugin version a8 works. timesigCP_V1.tmp is created upon Save, in the directory from which MS was launched, and can be loaded and applied in another score.
I assume that when MS is launched in the normal way, then it runs in a directory (still unknown) where it does not have read/write access. The problem might perhaps be solved by saving the timesig file to another directory, by giving MS sufficient privileges in the directory where the plugin wants to save the timesig file, or by figuring out how to launch a Mac app in a directory of the user's choice. However, I see no need for such efforts, since a9 works nicely using the copy/paste buffer regardless of how MS is launched.
Yes, if MS is launched with -d, then the debug messages including Home and Temp are shown on stdout.
In reply to Interesting! I did as you… by Erik A
Thanks for the info on Mac file access! It should be helpful to others. Fortunately, with the buffer, I don’t have to figure it out. ;-)
In reply to Unfortunately no change—it… by Erik A
I’ll work on a copy/paste buffer version. Hopefully it works OK on a Mac.
The plugin file access seems to be slightly different between Musescore version 3 and version 4 in Ubuntu, so across computers is less straightforward.
In reply to Unfortunately no change—it… by Erik A
Thanks for the feedback. Please try the a9_prelim version. It uses the “system” copy and paste buffer. It works in Musescore 3.6 and 4.2.1 on Ubuntu.
It works across scores. You just need to remember to select a sequence, run the plug in, then save then TS sequence.
Then, in another Score, run the plug-in in the second score. Select load. Make sure you select a measure to paste into. Select Paste button.
About 4 extra measures are appended, in addition to the currently inserted measures. Plus a safety time signature for the measure at the insert point.
Thanks for testing.
In reply to Thanks for the feedback. … by TDYama
Yes! I have tried some toy examples and a9_prelim works perfectly between scores. No crashes so far. This may solve my long-term need for concatenating long scores. I will put the plugin to some heavier tests soon. Thank you!
In reply to Yes! I have tried some toy… by Erik A
Thanks for the feedback. I’ll keep this as the “base” for the next set of updates.
I currently don’t recommend using the plugin when measure actual is different than the nominal. When saving, a corrupt measure warning comes up. If you go to each measure in error, click in the measure and press the DEL key, the discrepancy seems to clear. Then, you can save the file.
I’m trying to fix it but until it’s fixed, I think only measures where actual equals nominal should be copied.
Edit: A musescore bug. It has been reported via GitHub. No workaround found, except to clear measures manually after copy-paste.
I have used the plugin extensively and it works well. Thank you! I am using it to append movements of orchestral music after each other, thus creating one long score from several shorter.
If you at some point would find the time and inspiration to improve it further, here are some suggestions. Please regard them as friendly suggestions, not requests or criticism. :)
In reply to I have used the plugin… by Erik A
Thanks for using it. The coding is quite ugly but it guess it gets the job done. I’ll describe some points why I probably won’t do much more on it. I’ll take your input for a far-future update. Also, musescore 3.7 reads 4.x files and may make more sense for some of your work but I don’t actually know. I thought some old MS versions could perform some appending but that went away at some point.
There will be extensive changes to the musescore “plugin” system at some point. I don’t know when, but all current plug-ins won’t work in some “future” musescore so I don’t want to spend too much time on complicated work. My motivation is low due to the new information and lack of other information.
The issue of actual measure being different than nominal measure requires a user to press DEL to reset the measure. There is a bug in the musescore plugin api for the function to change actual measure. I made a GitHub bug report earlier on the problem but it probably will never be fixed in musescore. It is a P4 level issue, meaning probably never in the old plug-in system though maybe it will work in the new “extensions” system. This further lowers my motivation to expand on the current plugin.
There is a separate plugin for tempo marks but I think it can’t work between separate scores in 4.x.
For tempo and system text, there is an alignment issue. It could be accomplished using a sacrificial voice for alignment purposes. I consider tempo and system marks some somewhat complicated so it’s unlikely I’ll work on it.
Again, look at version 3.7 “evolution” maintained by Jojo.
I believe key changes can’t be detected using the plugin interface so that isn’t possible. I could be wrong but that’s my current knowledge.
Bar lines are possible. I did some basic work on them and it should be possible.
Speed can’t be greatly improved. It does perform extra work because it needs to load all the information into the copy/paste buffer, read it back, and add time signatures. Adding time signatures is slow in musescore because each one added causes a recalculation of all the measures following it. If you copied 50 measures at a time in ten steps, it could be faster due to fewer trailing measures, which are reprocessed every time a time signature is added. That is speculation. It may not be worth it the hassle because it’s easy to make a mistake when breaking it up. Plug-in-wise, adding measures at the start works but adding them as needed gave me some problems. There seem to be quirks in performing various tasks and I have to keep to the current process.
When the new extension system is done, and if the main program doesn’t copy time signatures, etc. and there is a method to perform the functions, I’ll likely work on something to do the work. But that is future work.
MS progress will happen and it’s a bit more of a change than I was expecting.
In reply to Thanks for using it. The… by TDYama
The short answer is, I thought previously that a current plugin could be carried over in some manner to many future musescore versions but that seems unlikely based on newer information.
Therefore, I’ll probably wait. When the new system is working, I’ll learn and use it.
In reply to The short answer is, I… by TDYama
Thank you for the detailed explanation! Under the circumstances, I fully understand that you are not developing the plugin further.
When I copy/paste measures of non-nominal duration, they revert to their nominal duration. I fix them when I anyway check the concatenated score for missing key changes, tempo marks, etc. I get no warning message and do not need to reset them using DEL.
I will try to find more info about the mysterious MS 3.7. Thank you for the suggestion! You may be right that this would work for me—I generally like v3 better than v4.
In reply to Thank you for the detailed… by Erik A
See https://github.com/Jojo-Schmitz/MuseScore/wiki
In reply to See https://github.com/Jojo… by Jojo-Schmitz
Does 3.7 concatenate scores?
Edit: including those with time signature changes and actual measure values different than nominal??
In reply to Does 3.7 concatenate scores? by TDYama
No, but a PR against it does, as it does reimplement the Album feature
In reply to No, but a PR against it does… by Jojo-Schmitz
So you could merge and bring it back :-)
In reply to So you could merge and bring… by TDYama
It isn't ready for merge, unfortunately
In reply to See https://github.com/Jojo… by Jojo-Schmitz
Using the latest plugin, MS 3.7 does copy the “measure actual” over correctly. When pasting the notes over, they are automatically aligned to “actual measure size.”
One issue is that it only saves in ms3 format, so some ms 4 types may not transfer over. You will have to load and save in 3.7, then load in 4.3 to check if everything is there.
Also, after the measure number is changed, the display isn’t instantly updated for the extra space, if there is one. But, pasting into the measures is correct. This is better than 4.x versions.
In reply to Thank you for the detailed… by Erik A
Feedback from Musescore developer on future of plugins:
https://github.com/musescore/MuseScore/issues/23419#issuecomment-221994…
I think it will be like this:
In version 4.5 we will declare the old system obsolete (but we will support its operation)
We will support the operation of the old system until version 5.0 at the latest, unless there are very serious reasons to stop supporting it earlier. i.e. the old system will be operational for about another year.
Porting from the old system to the new one is not very complicated, i.e. you won't have to rewrite everything from scratch, but some changes will need to be made.
We will prepare documentation about all this.