Skip to main content
Topic: Merging Staffs (Read 10604 times) previous topic - next topic

Merging Staffs

Is there a way to combine two staffs into one without manually entering them?

This is what I have:
<Image Link>

This is what I want:
<Image Link>

Re: Merging Staffs

Reply #1
G'day Metroid,
I see you are an NWC2tester - this is good news as it becomes almost trivial...

Using the NWC2 user tool facility and a tool written by Andrew Purdam you can indeed merge those staves.

First, I'd create a backup copy of the work - users tool can sometimes result in something other than what you're looking for...

Now, if you haven't already installed it, download and install "Scratch" from the Scripto:
http://nwc-scriptorium.org/nwc2scripts_scratch.html

Now, you select the section of the second staff you want to merge with the first staff, <AltF8>, Select your new Scratch tool and run it with a "copy" parameter.

Next, highlight the section this is to be merged with and <Alt-F8>, <Enter> (Scratch should already be selected) and run with a "merge" parameter.

Do the same for the third staff and voila!

Scratch is quite powerful but it IS still a beta and may well remain so.  This doesn't stop it from working very well, it just means that ocasionally something breaks.  In those cases, <Ctrl-Z> is your very good friend ;)

Another possibility, which I haven't tested so I'm not sure if it will actually work might be to set the 3 staves to the same MIDI channel, export to MIDI and then re-import.  As they would all be on the same channel I'm kinda expecting the import to put it all on one staff.  As I said, I haven't tested this so I'm not sure.  To avoid silly note values and rests, set a legato style on each staff before the export.

<edit> I have now tested the above method.  It does work, but only if the export is to a type 0 MIDI.  This is good, as it means the method is available to NWC1 users too - just thought you'd like to know...
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: Merging Staffs

Reply #2
As you are a user of NWC2, there was a User Tool script written by Andrew Purdam called Scratch.  It can be found here along with tutorial on the Scriptorium.

Re: Merging Staffs

Reply #3
Looks like Lawrie beat me to the punch.

Re: Merging Staffs

Reply #4
I don't get how I use the user tool feature. How do I run something with a "copy" parameter. I keep getting, "command process failed"

Re: Merging Staffs

Reply #5
G'day Metroid,
I don't get how I use the user tool feature. How do I run something with a "copy" parameter. I keep getting, "command process failed"

Hmm, not sure why you would get that - lets take the process (almost) step by step, including installing the user tool starter kit...

  • If you haven't already done so, download and install the User Tool Starter Kit:
    http://www.noteworthysoftware.com/nwc2/usertools/nwc2_UserToolStarter_v1_22.exe
  • Download and install the "Scratch" user tool:
    http://nwc-scriptorium.org/nwc2scripts_scratch.html
  • Installation of Scratch is simply a matter of downloading the file from the above link, renaming it by removing the .txt second extension (it should be called scratch.php) and moving it to your "C:\Program Files\Notworthy Composer 2\Scripts" folder
  • You then need to set up an invocation for it:  From NWC2 (with a song open) press <Alt-F8>; click New; Give it a name E.G. Scratch; Copy the entire following line into the command field:
    php\php.exe Scripts\scratch.php <PROMPT:Enter your scratch modification expression:=*>
    and Click OK
  • You should now have a "Scratch" tool in your list - you don't have to do this again for this tool.
  • Click Close
  • Open the song you want to merge, if you haven't already
  • On the second of the three staves, select the section you want to merge with the first staff and press <Alt-F8>
  • Select your new "Scratch" tool and click OK - you will be prompted for a command, type "copy" (no quotes) and press <Enter>
  • On the first staff, select the section to be merged TO and press <Alt-F8>
  • Scratch should already be selected, press <Enter> and the type the command "merge" (no quotes) and press <Enter> again
  • This will merge the 2 sections
  • Repeat for the third staff

Some good reading:

Instructions for Scratch:
http://nwc-scriptorium.org/ftp/nwc2scripts/scratch.pdf

Basic installation instructions for user tools in general:
http://nwc-scriptorium.org/nwc2scripts.html#Installation

A general discussion about user tools:
http://nwc-scriptorium.org/ftp/nwc2scripts/generaldiscussion.pdf

A reasonably full explanation about how to invoke user tools in a way that best suits your needs:
http://nwc-scriptorium.org/ftp/nwc2scripts/invocationinstructions.pdf
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: Merging Staffs

Reply #6
Well, I got the User Tool to work. But I am trying to do it on a different song. When I try to merge the staffs I get this from the user tool:
In the following error report, where a merge can't take place, one of the merge items appears after the other, marked in Color 1 (red by default) and set as a grace note.

Cannot merge Chord and Chord/RestChord at bar 29. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 35. I'm not smart enough.
Cannot merge Note and Chord at bar 38. The positions get tangled.
Cannot merge Chord and Chord/RestChord at bar 40. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 53. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 54. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 61. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 62. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 68. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 70. I'm not smart enough.
Cannot merge Note and Chord at bar 70. The positions get tangled.
Cannot merge Chord and Chord/RestChord at bar 73. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 83. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 86. I'm not smart enough.
Cannot merge Chord and Chord/RestChord at bar 87. I'm not smart enough.

Some of it merged, but most it was messed up. "I'm not smart enough" Thats the lamest excuse I have ever got from a program! Haha

Re: Merging Staffs

Reply #7
"I'm not smart enough" Thats the lamest excuse I have ever got from a program! Haha
Unusually humble. At least it didn't blame the user.

I've had good luck with this process:
  • mute all, then unmute the staves you want to merge
  • add playing style: Tenuto to each of these staves
  • make the MIDI channel the same for each staff to be merged
  • Export as: Type 0 MIDI file
  • Import it

Attached is a demo of Metroid9824's example.
Registered user since 1996

Re: Merging Staffs

Reply #8
is there also a way to do this in NWC 1.7?

Re: Merging Staffs

Reply #9
Does this tool mean that I can "layer" just a few bars of a piece without having to enter an infinty of empty bars?

Tony

Re: Merging Staffs

Reply #10
is there also a way to do this in NWC 1.7?
yes. The MIDI export/import in Reply # 7 will work with any version.
Does this tool mean that I can "layer" just a few bars of a piece without having to enter an infinty of empty bars?
Less than infinity, but no. Layering requires that you start at the beginning and continue to at least the last note/rest that need to be layered.


Registered user since 1996

Re: Merging Staffs

Reply #11
hm, i tried to do that, but it didnt work, i probaply did something wrong, can u plz give some more detail on how to do that, ty :)

Re: Merging Staffs

Reply #12
Sorry, gRaViJa
In NWC2, it is called export/import.
To export in NWC 1.7+, you Save As...->Save as type: Type 0 Midi File
To import, you open the *.mid file created in the previous step.
Registered user since 1996

Re: Merging Staffs

Reply #13
I am running v. 2.5.2 in Windows 7. I followed the instructions and installed the Scratch script to a group I called New Tools. I ran the tool and received the following error:

Quote
Note: [in C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2\Scripts\scratch.php, at line 598]
--> fopen(SCRATCH.TXT): failed to open stream: Permission denied
Can't open SCRATCH.TXT file. Sorry.

Any help would be appreciated.

Thanks,
David

Re: Merging Staffs

Reply #14
Hi David,
From the comments section at the start of the script:
Quote
Cut or copied data is saved to a file called SCRATCH.TXT in the folder
that the tool runs in (normally the NWC2 program folder).

From the error message you've provided I'd say that you don't have sufficient file system rights in the:
"c:\Program files\Noteworthy Software\Noteworthy Composer 2"
or equivalent folder...

Normally with versions of Windows later than XP you will only have "Read & Execute" rights at this location, inherited from C:\Program files.

If you navigate to "c:\Program files\Noteworthy Software\" in Explorer and the right click the "Noteworthy Composer 2" folder, you will be able to select Properties, open the security tab and change the rights to "Full control" to either yourself, OR the group "Users".

There are other ways, but if you are the only user of the machine OR you're not really worried about file system security related to NWC then this is the easiest way.

I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: Merging Staffs

Reply #15
That worked. Thanks so much!

David