Forums => General Discussion => Topic started by: MatthijsG on 2016-12-23 06:52 pm
Title: Bulk Save NWC files
Post by: MatthijsG on 2016-12-23 06:52 pm
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,
Title: Re: Bulk Save NWC files
Post by: Rick G. on 2016-12-24 07:18 am
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.
Title: Re: Bulk Save NWC files
Post by: MatthijsG on 2016-12-24 11:25 am
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 .. :-/
Title: Re: Bulk Save NWC files
Post by: hmmueller on 2016-12-24 11:46 am
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.
Title: Re: Bulk Save NWC files
Post by: Flurmy on 2016-12-24 12:07 pm
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.
Title: Re: Bulk Save NWC files
Post by: Mike Shawaluk on 2016-12-24 12:53 pm
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.
Title: Re: Bulk Save NWC files
Post by: MatthijsG on 2016-12-24 01:28 pm
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.
Title: Re: Bulk Save NWC files
Post by: Flurmy on 2016-12-24 01:44 pm
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.
Title: Re: Bulk Save NWC files
Post by: Mike Shawaluk on 2016-12-24 01:48 pm
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.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.
Title: Re: Bulk Save NWC files
Post by: Flurmy on 2016-12-24 02:19 pm
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.
Title: Re: Bulk Save NWC files
Post by: Mike Shawaluk on 2016-12-24 03:39 pm
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? :)
Title: Re: Bulk Save NWC files
Post by: NoteWorthy Online on 2016-12-24 03:41 pm
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...
Title: Re: Bulk Save NWC files
Post by: Bart on 2016-12-24 03:55 pm
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.
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