Skip to main content
Topic: Bulk Save NWC files (Read 6320 times) previous topic - next topic

Bulk Save NWC files

Hi all,

As a new user of NW, i need to upgrade several old NWC-files to the new format.
1) how can i see which version a NWC is in?
2) can i re-save several (old) NWC-files?

Thanks in advance,

Re: Bulk Save NWC files

Reply #1
If you load an old file and modify it, it will save as an upgraded file.
If you do not need to modify it, there is little to be gained by "upgrading" it.
Registered user since 1996

Re: Bulk Save NWC files

Reply #2
I've a few hundred NWC-files who are also needed in XML-format. The converter from https://nwc2musicxml.appspot.com is working good for this, but not working with older files.

So, i'm looking for a way to re-save quite a lot NWC-files .. :-/

Re: Bulk Save NWC files

Reply #3
Well, I have around 1500, about half of which I like(d) to upgrade when NWC increased its version ... I do it by hand and call it a nice idiotic pastime for a holiday, which also reminds me of older arrangements and compositions I did.

What you can do: Write a macro e.g. for AutoHotKey (https://www.autohotkey.com/); either you open a bunch (whatever NWC allows you without crashing) and have a macro for Ctrl-S and the subsequent "Yes" (I want to save it as a new version) and then Alt-F-C (close), so that you can hit a single button a myriad of times to save all the files; or you fully automate it with an AutoHotKey loop ...

H.M.

Re: Bulk Save NWC files

Reply #4
Once upon a time there was NWC-CONV...
I think I remember that its functions are now included in NWC but I'm unable to find any reference to the NWC command line parameters.
I think this could be an easy and clean way to do things like the one MatthijsG is asking.

Re: Bulk Save NWC files

Reply #5
As @Flurmy  says, the conversion utility is built into NWC now. It can be invoked by typing the following at a Windows command prompt:

nwc2 -convert {input-file} {output-file}

It will automatically convert between .nwc, .mid or .nwctxt file types, based on the supplied extensions for {input-file} and {output-file} above. Unfortunately, I don't see a way to "convert" an old-style .nwc file to the current .nwc format (as @Rick G. mentioned earlier, NWC does this automatically when you open a file and save your changes.)

However, if your goal is convert the scores to MusicXML, you could convert your .nwc scores to .nwctxt, which the online converter supports. Typing the following at a command prompt will bulk convert all of the .nwc files in the current folder to .nwctxt files in a subfolder named "Converted":

for %i in (*.nwc) do "C:\Program Files (x86)\Noteworthy Software\Noteworthy Composer 2\nwc2.exe" -convert "%i" "Converted\%itxt"

If your NWC program is installed in a different location, be sure to update that in the above command. Also, the "Converted" folder needs to be created before you run the command.

Re: Bulk Save NWC files

Reply #6
As @Flurmy  says, the conversion utility is built into NWC now. It can be invoked by typing the following at a Windows command prompt:

nwc2 -convert {input-file} {output-file}

It will automatically convert between .nwc, .mid or .nwctxt file types, based on the supplied extensions for {input-file} and {output-file} above. Unfortunately, I don't see a way to "convert" an old-style .nwc file to the current .nwc format (as @Rick G. mentioned earlier, NWC does this automatically when you open a file and save your changes.)

However, if your goal is convert the scores to MusicXML, you could convert your .nwc scores to .nwctxt, which the online converter supports. Typing the following at a command prompt will bulk convert all of the .nwc files in the current folder to .nwctxt files in a subfolder named "Converted":

for %i in (*.nwc) do "C:\Program Files (x86)\Noteworthy Software\Noteworthy Composer 2\nwc2.exe" -convert "%i" "Converted\%itxt"

If your NWC program is installed in a different location, be sure to update that in the above command. Also, the "Converted" folder needs to be created before you run the command.

Yes, discovered the conversion utility. Tried to save from filename.nwc to filename-new.nwc, but didn't work. However, didn't try it to convert it to the .nwctxt format. Not sure what the results will be .. but a nice job for the holiday's ;-)

And @hmmueller , there's beside AHK also a graphic based automation tool to make some kind of loop for GUI's: Sikuli. There should be an extra step to move a converted from a folder, and then open the next one, repeat till all are done.
However, i prefer a CommandLine-option.

 

Re: Bulk Save NWC files

Reply #7
I don't see a way to "convert" an old-style .nwc file to the current .nwc format
Well, what about a two steps procedure?
First you convert all your files to .nwctxt, then you reconvert them to .nwc, of course in the latest file fomat.

I hope it's feasible. As, I already wrote, I'm unable to find any command line parameters reference.

Re: Bulk Save NWC files

Reply #8
Well, what about a two steps procedure?
First you convert all your files to .nwctxt, then you reconvert them to .nwc, of course in the latest file fomat.
That indeed will work.
I hope it's feasible. As, I already wrote, I'm unable to find any command line parameters reference.
If you go to your NWC2 executable folder, and type:

nwc2 -convert x

It will give you a popup with the command syntax.

Re: Bulk Save NWC files

Reply #9
That indeed will work.If you go to your NWC2 executable folder, and type:
nwc2 -convert x
It will give you a popup with the command syntax.
Nope. Version 2.75a beta 7 doesn't.

But the standard for help isn't "/h" or "/?"?

Peeking inside the executable I found:
Quote
Usage: nwc2.exe -convert "[input-file]" "[output-file]"
Both files are required on the command line, and the file extension determines the conversion.
Supported conversions include:
.nwc    -> .nwctxt, .mid, or .info
.nwctxt -> .nwc, .mid, or .info
Conversions to .mid support a "-0" option for type 0 files.
A mention in the program help is needed.

N.B. Searching the forum for "-convert" doesn't work.

O.T. It's a pity that windows doesn't allow the use of stdin and stdout for a program not compiled for console mode only.

Re: Bulk Save NWC files

Reply #10
Ah, I was forgetting:
Quote
You can invoke the NWC Lua interpreter by adding a -nwcut switch on the command line:
%USERPROFILE%\Test-NWC2\nwc2test -nwcut [YOURTOOL]< nwcfile.nwctxt > outfile.txt 2> errfile.txt
You must provide the redirects, as the program instance will not automatically attach to your current console session.

Re: Bulk Save NWC files

Reply #11
Nope. Version 2.75a beta 7 doesn't.

But the standard for help isn't "/h" or "/?"?
NWC2 doesn't seem to check for /h or /?, but for me it displays the popup info because the file "x" couldn't be found. Maybe you have a file with that name in your folder? :)

Re: Bulk Save NWC files

Reply #12
I just posted a batch file that might be useful here.

NWC 2.75 has a builtin INFO method that can be accessed from the command line. It shows you some summary stats about a file, including NWC version used to create it, play time, and fonts used. You can access this facility from the User Tool mechanism using the attached Windows batch file...

Re: Bulk Save NWC files

Reply #13
I see a lot of older files in my "2.75" nwc folder.
nwc-convert.exe is certainly a conversion tool and /? gives the expected commandline help which was already mentioned before.
But, since this program was made in 2011, it is not sure that it will still do the job for recent files.

Code: [Select · Download]
C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2>dir
 Volume in drive C is Windows
 Volume Serial Number is 2449-477F

 Directory of C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2

[code]12/12/2016  18:07    <DIR>          .
12/12/2016  18:07    <DIR>          ..
12/12/2016  18:07    <DIR>          AutoUserTools
12/12/2016  18:07    <DIR>          Fonts
12/12/2016  18:07    <DIR>          itrees
03/09/2015  22:30             1 878 LICENSE.RTF
20/12/2011  16:31            75 872 nwc-conv.exe
22/09/2015  14:16         1 909 976 NWC2.exe
17/09/2015  09:25            73 512 nwc2.ico
09/04/2014  13:26               210 NWC2.visualelementsmanifest.xml
22/09/2015  13:07           259 777 nwc2help.chm
29/06/2010  00:09            30 824 NWC2STDA.TTF
22/09/2015  12:16            10 100 Nwc2tips.tip
25/07/2007  13:54             1 078 NWCTXT.ICO
23/08/2013  23:01             2 708 piano.ini
22/09/2015  12:55             3 545 README.TXT
12/12/2016  18:07    <DIR>          SAMPLES
12/12/2016  18:07    <DIR>          Scripts
12/12/2016  18:07    <DIR>          Setups
12/12/2016  18:07    <DIR>          Template
12/12/2016  18:07            53 056 Uninstall.exe
              12 File(s)      2 422 536 bytes

Code: [Select · Download]
C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2>nwc-conv.exe /?
nwc-conv: version 2.5
This program is a front end command to the file convert options
available in the main NoteWorthy Composer 2 program.

Usage: nwc-conv IN_FMT OUT_FMT [-h|-v|-t|-0|-1]

IN_FMT
    This specifies the input file or format that will be used.
    This can be the name of a *.nwc or *.nwctxt file, or if
    STDIN is used, it should indicate "NWC" or "NWCTXT".

OUT_FMT
    This specifies the output file or format that will be used.
    The format can be one of NWC, NWCTXT, MID, or INFO, but may
    not be the same as the IN_FMT. This can be the name of the
    intended output file, or just the the format name if STDOUT
    is used.

-h  Shows this help message
-v  Shows the program name and version
-t  Conversion process will use "NWC2Test" program
-0  Use type 0 when converting to MIDI
-1  Use type 1 when converting to MIDI

Example: nwc-conv NWCTXT "out\test.mid" -1
    This creates a Type 1 MIDI file using the NWCTXT text
    provided on standard input (STDIN)

Example: nwc-conv "in\test.nwc" NWCTXT > "out\test.nwctxt"
    This converts the test.nwc file into NWCTXT which is sent
    via standard output (STDOUT) to a test.nwctxt file

NWC2 Instance: C:\PROGRA~2\NOTEWO~1\NOTEWO~1\nwc2.exe

C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2>

Bart

Re: Bulk Save NWC files

Reply #14
nwc-conv just acts as a front end to the nwc2 program.