Skip to main content
Topic: Copy and past measures of mutiple staves (Read 25408 times) previous topic - next topic

Copy and past measures of mutiple staves

With this tool you can copy and paste measures of multiple staves, including the lyrics.

Via the dialog you can specify
- the staves to process
- copy and past or cut
- the first measure to copy or cut
- the last measure to copy or cut
- the measure after which you want to paste.

Multimeasure rests are split, if necessary.

Attention: beware of ties and slurs that could be cut at the start or the end of the measures to copy.

Remarks and bug reports are welcome.

Installation:
- download the file into your tool folder;
- open any nwc file;
- drag and drop the downloaded file to your nwc window.

Edit 4/07/2019: added an option to rather cut than copy
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #1
Thank you for this. I will give it a try tomorrow. If it works, or to be more accurate, if I can figure out how to use it, it will be a big time saver!

Re: Copy and past measures of mutiple staves

Reply #2
Addendum: Although the subject tells you the tool is intended for treating multiple staves, you can also use it for 1 staff if you want to copy and paste staff objects + lyrics.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #3
This is great.  One useful additions would be the option to cut rather than copy.  Moving sections around is quite common (for me).

Re: Copy and past measures of mutiple staves

Reply #4
This is great.  One useful additions would be the option to cut rather than copy.  Moving sections around is quite common (for me).
New version with cut option: see original post
Always look on the bright side of life!

 

Re: Copy and past measures of mutiple staves

Reply #5
It's a year later, and I have finally had time to try out this new tool. It's strange to say, but I was afraid to spend extra time figuring out something new!

I was able to successfully cut out a chunk from an 8 stave composition, including the lyrics (which I have always had to edit manually previously). It was fairly quick and definitely faster than doing it individually (which can get confusing).

One glitch that happened twice (I redid it to check and see) was that one stave had one extra measure cut out of it. I'm not sure why this would be. Any insights?

A feature that would be useful would be an "undo" function.

Thank you for creating a useful tool! I can see myself using this regularly.

Re: Copy and past measures of mutiple staves

Reply #6
I'm glad you find this tool useful.

When I find the time I'll look into the 'glitch' that you mentioned.

As to the 'undo' function:  I don't think it can be included in the tool: NWC automaticcally closes down the tool after each modification and is not possible for the tool to save the old situtation in another file. But that shouldn"t be a problem: As long as you haven't saved your file, you can reopen it instead, which is infact an 'undo'. And when you run the tool for a second time for another chance, NWC shows a dialog box to ask if you want to save first.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #7
Thanks for the info on the “undo”work around.

Re: Copy and past measures of mutiple staves

Reply #8
One glitch that happened twice (I redid it to check and see) was that one stave had one extra measure cut out of it. I'm not sure why this would be. Any insights?

I looked at the code and couldn't find anything that could cause that glitch, unless: if in one of the staves a barline is missing in some place, the tool will count one measure for that stave, while two in the others.

So, maybe that was the cause? (That would be a glitch in your score  ;))

Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #9

Well I am known for missing bar lines but I didn’t see anything amiss. There was a single bar line instead of a double in one layer of a layered SA choral section. Would that cause it?

Re: Copy and past measures of mutiple staves

Reply #10
Single or double bar lines don't make any difference.
There are two situtations where the measurenumber is not increased on encountering a barline:
  • when the box 'Exclude from barcount' is checked
  • when there was no item with a duration after the previous barline



Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #11
This tool appeared to be great for me, but now I wonder:
Is it not meant to do what I want, or am I just too stupid to use it properly?
My purpose is to merge several songs of choir music (of types varying between SAB and SSAATTBB, each of
them with piano accompaniment) into a single file, thus restoring the medley they were originally separated
from as a whole.
Copying a bunch of staves at once, including lyrics, seems to go like a charm with the tool, but I can't figure
out how to paste these to a prescribed position of a separate file thereafter.
Actually, our choir's present programme consists of four musical medleys, each of which carrying between 5
and 8 single songs. Over the past year, I had supplied our members with rehearsal files of each of the single
songs, one after the other. Carelessly, I had recently announced I would try to provide the complete medleys
as well, as they are to be performed. But meanwhile I've realized what tremendous amount of dull work this
would be, copying staff after staff, and lyrics line after lyrics line...
Can anyone help me out?

Re: Copy and past measures of mutiple staves

Reply #12
HorstH,

I know that user tools are always working from within an open NWC file, but I never saw a user tool that opens a file from disk.
But, of coarse, it is not because I never saw it, that it must be impossible. Therefore, I looked at the source code for nwcut in github, but nothing there suggests that a usertool can open other NWC file.
So, I fear it is not possible to copy/cut/paste items between files with usertools.

Bart


Re: Copy and past measures of mutiple staves

Reply #13
Hi Bart, thanks for your contribution.
But maybe it wouldn't need that much automation of the user tool.
I think of having the destination file already open in the same NWC window, just under another tab.
Then, it would be of great help if, after copying a bunch of staves in the source file, then manually opening the destination file tab, I could have access to the copied stuff to manually paste it into the destination file.

Horst

Re: Copy and past measures of mutiple staves

Reply #14
A usertool can only be run within an open NWC file and can only do things with that file.
But 3 years ago Rick G. has written 2 tools:
1. for copying a staff from one file
2. for pasting that staff into another file
See: https://forum.noteworthycomposer.com/?topic=9659.0

I think that's what you need.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #15
Yes: Rick's pair of tools demonstrates the fundamental idea that apparently 2 separate tools are required for my task.
I had looked at them, but refrained from using them: Since they operate on a single staff, and place it in the destination file as a separate staff not allowing immediate concatenation with an existing one, they would hardly have reduced my workload with respect to the ordinary manual copy-paste procedure.
On the other hand, the fantastic power of your tool, Opagust, is that it handles a bunch of staves at once, and also does the concatenation job like a charm, albeit just within one file.
Doesn't that cry for a synthesis?
CopyPasteMeasures.og would need another option of 'Just Copy' which should finally provide the address of the copied stuff.
Then, the 'Paste' part of that tool would have to be separated into a stand-alone tool, to be operated from the destination file  and receiving the 'clipboard' address. It would, however, have to ask for the starting point in terms of first staff to be pasted to, and start measure (but why not, just the cursor position?).
Unfortunately, my own programming skills are quite ancient, so I can't readily cope with lua and the like myself.


Re: Copy and past measures of mutiple staves

Reply #16
Doesn't that cry for a synthesis?
CopyPasteMeasures.og would need another option of 'Just Copy' which should finally provide the address of the copied stuff.
Then, the 'Paste' part of that tool would have to be separated into a stand-alone tool, to be operated from the destination file  and receiving the 'clipboard' address. It would, however, have to ask for the starting point in terms of first staff to be pasted to, and start measure (but why not, just the cursor position?).

I don't promise anything by now, but I think it's possible to extend the tool to satisfy your needs.

Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #17
Horst,
After rereading your replies, I think I'm gonna write a seperate tool for this.

- As I understand, your aim is to export all measures and lyrics from all staves of a 'source file' and import them at the end of a 'destination file'?  Or should there be a possibility to select the staves and the measures, as in CopyPasteMeasures?

- You're talking about "types varying between SAB and SSAATTBB". So it will be necessary to provide all the voices in the first song of the medley (wich will be your destination file). The other songs that have to be added may have less voice parts, but the staff names will have to match with one of the destination file. The staves of the destination file that are not present in the source file, can then be extended with a boundary collapse and a multimeasure rest.

- I suppose the number of verses of the seperate songs can vary. That also will necassitate special treatment.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #18
Wow, Opagust: You appear already deeply immersed in my issue!
Yes, the destination file needs to be prepared first by blowing it up to the maximum number of staves that may follow, in a proper order. That applies as well to the number of lyrics lines per staff. Selectability on the copy side would be desirable (with the naturally implied option to take them all).
As to staff names, I was a bit divided: At first, I thought of designating a start staff at the destination, and from there just consecutively adding the copied staves.  But that would raise the question where to put the staves of subsequent songs with less voice parts. So, it appears advisable to adhere to a goal-finding mechanism by staff names. Though I haven't always been consistent with staff naming, repairing this first in the songs to be added seems a fair price to pay.
Filling up non-existent voice parts in the destination file by multi-measure rests, and potential collapsing, are good ideas.
Wish you good luck!
Horst

Re: Copy and past measures of mutiple staves

Reply #19
Wow, Opagust: You appear already deeply immersed in my issue!
My pleasure! (I'm recovering from a hip implant, so I have some free time to spend)

I have some more questions for the import side:
- Should the exported stuff always be added at the end of the destination file or have I to provide an option to insert after a specific measure?
- If desirable, I could add a text item above the first imported measure with the song title.


Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #20
For the present purpose to re-assemble a given medley from its constituents, inserting just at the end would certainly be sufficient. Later users, composers in particular who want to build their own medleys, might wish to be able to rearrange the songs. Then, selection of the starting measure would be desirable.
As to measure numbers: Since there seems to be no mechanism in NWC to set an arbitrary new measure number within a song, it appears natural to keep the measure numbers of the copied songs undetermined, making them adapt themselves to the existing ones. In my special case, with the measure numbers of the medley consecutively running through all the songs, I had adhered to them by properly setting the start number of each song; so, when re-placed in the medley, each song will retain its assigned measure numbers if put there in the proper order.
But if one thinks of the opposite case, where someone might wish to disassemble a given medley: Then it might be desirable to have an option to set the start number of each copied song.
Importing the song title of each copied song as a text item is great. It would save a lot of work one would otherwise have to do manually after copying.
Hip-hip-hurrah!
Horst

Re: Copy and past measures of mutiple staves

Reply #21
Just as a note: I'm quite opposed to using measure numbers in a tool. Measure numbers are for musicians in the final product; but while editing, they are ill-defined, especially over multiple staves. Better, in my experience, are simple text markers put into the staves - they remain stable even when things are added or removed before them; and can easily by copied and removed by small helper tools.

H.M.

Re: Copy and past measures of mutiple staves

Reply #22
Quote
Since there seems to be no mechanism in NWC to set an arbitrary new measure number within a song,
BarCounter.nw
BarCounter.hmm

I often use them for the parts of a piece.

Re: Copy and past measures of mutiple staves

Reply #23
Just as a note: I'm quite opposed to using measure numbers in a tool. Measure numbers are for musicians in the final product; but while editing, they are ill-defined, especially over multiple staves. Better, in my experience, are simple text markers put into the staves - they remain stable even when things are added or removed before them; and can easily by copied and removed by small helper tools.

H.M.

In the tool I'm writing now, measure numbers are used as 'coördinates' to know which part of a file is to be exported, and where in the destination file the import has to be inserted. There will be no manipulation of measure numbers. The only and logical effect will be that NWC will adjust the measure numbers in the destination file.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #24
Hi hmmueller,
I agree, as long as you see it with a composer's eyes.
But that's not me. I am just transcribing sheet music into NWC rehearsal files for my choir mates. And since I want to enable them to read the rehearsal file in parallel with the printed score, measure numbers do always matter for me. Of course, I sometimes use text markers as well to mark sections or points of special attention.
Regards,
Horst

Re: Copy and past measures of mutiple staves

Reply #25
Thanks Flurmy, for pointing to these plugins.
I didn't know them yet, and so I was referring to native NWC behaviour above. Quite probably, I'll make use of them in the
future, but I think they will not be required in the present context.
Regards, Horst

Re: Copy and past measures of mutiple staves

Reply #26
I'm in the stage of testing a new tool 'ExportImportMeasures'.
The bridge between the export and the import should ideally be the clipboard, but I don't think that's possible in a lua user tool. So one has to copy the exported side from the output screen and then pasting it back in the input screen for the import run.
But there seems to be a size limit on the input screen, so that a part or the exported part can be lost. So it will be necessary to check if the import is complete. If negative, you should use partial import/exports.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #27
So here is my first version of  'ExportImportMeasures.og'. Please let me know if it covers your needs or you've find any bugs.
When running, you can choose Action = 'Show Help' and 'Show Conditions' for further useful information.

I'm looking forward for your response(s).
A final version will be published in a separate post.

Gust
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #28
Hi Opagust,

I haven't tried the object yet; won't have time this weekend to get really into trying it.

Some quick thoughts though, if you haven't dealt with them already?

I think there are two uses for the tool: Creating two or more songs on the same page of printed music, or alternatively, to combine songs into a medley. 

I might want:

1. Options to have the transferred song continue with or without a system break.

2. Where there's to be a system break, it would be useful to have an option to increase the upper vertical space on the first top staff of the transferred bars to allow space to include a large, bold song title.

3. Some way to help the user remember to ensure the transferred staffs have the same instruments in the same sequence (that probably has been dealt with manually by the user before using the tool), and with transposition settings consistent with the  destination file's existing staffs.

4. If you use simple text markers, perhaps there should be two: one at the beginning and one at the end of each copied section.  This might help if two or more groups of staffs are added to the target file.


Re: Copy and past measures of mutiple staves

Reply #29
Hi David, thanks for your response.

First of all: this isn't an object, but a tool. The difference might not be clear for every user, so let me explain:
* an object is inserted in a file, you do it once, and it'll do whatever it's supposed to do every time the file is shwon, printed, played.
* a tool can be invoked from within a file and does then his job with the file, but the tool itself is not permanently included in the file.

That said, let me comment on your thoughts:

1.I have been thinking of it, but I wanted to keep the dialog short. The user can easily insert a system or page break himself.

2. At the start of the first measure of the top staf of the imported part, the tool will insert a text marker above the staff with the song title with the font 'Page Title Text'. Again, the user might insert a boundary offset change, if needed.

3. For as it is now, the tool checks that, for every staff in the imported part, there's a staff in the destination file wit the same name. If not, the tool ends with a simple error message (on the first mismatch). If all the imported staves have a match, they inherit all properties of the matching staff in the destination file.
Maybe I should check more then the name alone and provide more elaborate information when there's a mismatch. The properties shown in the score review panel might be an inspiration?

4. The song title is now a text marker at the beginning. Maybe I can also insert the song tile + ' - end' in a text market at the end (with a smaller font).

Again, thanks for your input,

Gust

(And whoever wants to comment on this, please don't hesitate!
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #30
Hi again, Gust
Quote
3. ... Maybe I should check more then the name alone and provide more elaborate information when there's a mismatch. The properties shown in the score review panel might be an inspiration?.

Yes, I think so.  Fools like me need "watch fors".  Depending on why I'm notating the music, I may or may not use the transposition or instrument settings and even where I do use them, I might not remember today the substitutes I used for the rarer instruments in a file I created a few years earlier ( rare instruments such as piccolo trumpet, flugelhorn, euphonium, bass sax, bass trombone, or the four lower members of the clarinet family ).  Or I may just not need to set transposition on the particular file I'm working on today but transposition has been set in the previously created target file.

d

Re: Copy and past measures of mutiple staves

Reply #31
Congratulations, Opagust: You've made it!
I have just completed the first medley out of 5 songs. The look of it appears really OK after a few manual modifications.
Sound check will follow tomorrow, and then, of course, a couple of comments.
Hope I can find sleep now, excited as I am...
Horst

Re: Copy and past measures of mutiple staves

Reply #32
Congratulations, Opagust: You've made it!
I have just completed the first medley out of 5 songs. The look of it appears really OK after a few manual modifications.
Sound check will follow tomorrow, and then, of course, a couple of comments.
Hope I can find sleep now, excited as I am...
Horst
Hi Horst,
I'm glad it worked out well for you!

Now I'm working on a new version, after some thoughts of David PalmQuist.
This version includes:
* more elaborate checking and reporting on staf property mismatches
* automatically extend incomplete lyric lines in the destination file with spaces and underscores
The coding for these additions is done, testing seems OK.
Next I will try to accomplish the automatically extension or creation  of incomplete or absent staves in the destination file.
If that woks out well, I expect the manual modifications to be reduced to a minimum.
Gust
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #33
Soundcheck of my first medley accomplished -- it ran flawlessly through all transitions on all staves and ended properly!
A few observations made during the first work on this:
-  Bar Lines:  The standard 'section close' at the end of a staff is not recognized as a bar line. So every staff that does not have an explicit bar line at the end will lack a bar line at the joint of the two components. The import mechanism should precede each imported staff with an extra bar line or, even better, a double one. (Didn't yet check the behaviour if the ending bar is a special one, like MRC, or if the imported staff starts with an MRO).
-  Song Titles:
   -  Size:  The 18pt size of the text items appeared a bit bombastic to me, inside the score.
      Changing them to 75% made them appear much more adequte in my eyes. Also, I pushed them up to pos. 21 in order to keep them from interfering with tempo markers.
   -  Strangely, all the title text items are shown in quotation marks. These should be avoided.
   -  More strangely, the word "Can't" in the title string appears as "Can\'t" in the text item.
   -  More as a hint to myself for the preparation phase:
      In order to have the first element consistently marked with its song title as well, the first destination file should not be that of the first song but an empty template instead. This should carry the title of the complete medley in its File Info. (Or could even that be handled by the import mechanism itself? It would avoid an extra copy-paste cycle.)
-  Truncation of overflowing text:
    It would be desirable if pasting could continue anyway, then signal the last bar number pasted.
    For the section(s) to follow, could there be an option in the selection box like 'last' or 'end'? This would avoid having to look up the last bar number.

In the first attempt, I had some confusion with lyrics, but that could be quickly traced back to flaws in my original files. In most cases, the mess was due to my habit to omit lyrics on every second staff where voices are running in parallel, then failing to mark all the notes  of that staff as bearing no lyric syllable. Having no observable effect in the single file, it perfectly prepared the muddle with any lyrics to follow on that staff.
So, my hint for the preparation phase: Any note that carries no lyrics has to be marked as such under Properties/Lyric Sylllable: Never.

BTW, in preparing my song files by adding missing staves, I was happy to find your older tool 'ExtendStaff.js' which smoothly did the job of filling them up. And with great joy I found above that my wish to have that tool incorporated in the import mechanism is about to be fulfilled before I could even utter it!
Would you like to see the result? Unfortunately I think I cannot post it here since it is certainly not in PD. What about PM?

Horst

Re: Copy and past measures of mutiple staves

Reply #34
Hi Horst,

Here are my thaughts on your comments:

- Bar Lines: I think I should insert a double bar if neither the end of the  destination staff ends, nor the start of the imported staff starts with a bar of some type.
- Song Titles: I use the font 'Staff Title Text', the actual size depends on the options of the destination file, but by definition it will always be large. Scaling to 75% is indeed a good idea, as is moving it to position 21.
- Quotaion marks within text markers: I don't see that im my test files. I'm using NWC version 2.8 Beta 1, maybe that's the reason. I will look if I can intercept it.
- Medley Title: I have the following idea, that might solve this problem.
Add a line with the medley title in the comments area of each of the separate songs, in the form 'medley title:' + the title.
If you take the first song file as destination file to start with, then on the first import (of the 2nd song), the destination file will still have it's original song title. The tool can copy that title to a text marker in the first measure, and change the song title to the medley title. It then copies the song title of the 2nd song in the first measure of the imported song. On te next imports, the song title of the destination file will match tke medley title in the comments area of the imported song, so only the song title of the imported song will be copied to a text marker. It will be necessary of course that all songs contain the medley title.
I hope I did clearly explain my thaughts about this.
- Truncation of overflowing text: Unfortunaly, when the import is truncated, it will not leave a clean result that can be pasted, because the truncation will occur somewhere in the middle of a staff, so some staves may be complete, while others won't be.
- Incomplete or fewer lyric lines in the destination file: the tool will take care of that.
- The same applies to incomplete or fewer staves.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #35
I'm popping to say that I look forward to trying out this tool, and to ask if you could let me know when you've finished the tweaks (posting in this thread should be enough). I was using your other cut/paste tool recently and thinking again about how thankful I was for the time savings!
Best wishes with your surgery recovery.

Re: Copy and past measures of mutiple staves

Reply #36
I'm popping to say that I look forward to trying out this tool, and to ask if you could let me know when you've finished the tweaks (posting in this thread should be enough). I was using your other cut/paste tool recently and thinking again about how thankful I was for the time savings!
Best wishes with your surgery recovery.
I'm still working on it, but I want it to be as good as I think it can be, so there's also quite a bit testing involved.
As to my surgery recovery: better than I thought it would be  :D , but as a consequence I spent less time in my sofa with my laptop >:( .
So please a little patience.


Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #37
I've put the final(? ::) ) version in a seperate post.

See ExportImportMeasures.og.

All comments or bug reports are welcome.
Always look on the bright side of life!

Re: Copy and past measures of mutiple staves

Reply #38
THANK YOU!!!!  I retroactively thank you, for the past 17 years!

Re: Copy and past measures of mutiple staves

Reply #39
I'm still super grateful for that plugin you created.  It's still saving me a lot of time!  Just wanted to say... thanks again!