NoteWorthy Composer Forum

Forums => Tips & Tricks => Topic started by: Richard Woodroffe on 2006-11-29 10:02 pm

Title: Do you want a play list for the NoteWorthy Viewer? Read on.
Post by: Richard Woodroffe on 2006-11-29 10:02 pm
Yes, I know you can do it with using Winamp with the NoteWorthy plugin - but supposing you don't have (and/or don't want) Winamp.

Or supposing you really want to see the music, perhaps for rehearsal purposes, or you want to play a complete suite comprising several NWC files ....  Then this tip is for you.

A bit tricky to set up, but once done, is easy to manipulate and change.

Play list functionality is set up using the NoteWorthy Viewer (with a couple of secret commands) and the old batch file command system. (Good old DOS - Rick will probably program an elegant windows scripting program that does the same thing but in the meantime, this does nicely ! - Rick, please feel free to do an equivalent windows script and post here)

You will have to set up 2 files. The first will be the actual play list. As an example, let's call it PLAY.TXT

In it, you will need to put in each file you want in your play list.
This will need to be the full path and filename. One NoteWorthy file to each line.

So let's suppose you want to play one file from your NoteWorthy 1.75 directory on the C Drive , one from your Version 2 directory and one from the viewer directory.
The format of the file will be :

Code: [Select · Download]
"C:\Program Files\NoteWorthy Composer\SAMPLES\rose.nwc"
"C:\Program Files\NoteWorthy Composer 2\SAMPLES\carmen.nwc"
"C:\Program Files\NoteWorthy Composer 2 Viewer\caverns.nwc"

So in other words, it doesn't matter where your files are in your computer as long as you give the full path and file name. You do not need to enclose the lines in quotes (except if there are spaces in them).

So that's set up your play list. Save it in an appropriate directory (folder).

Now you have to set up the file that starts up NoteWorthy Viewer and gives it the correct instructions.

Let's call it Play.bat (you can call it anything you like but it must end with .bat)

The following two lines need to be in the file exactly as displayed here except that some parts need to be relevant to your system and also the name you gave to your play list file. (above)

Code: [Select · Download]
for /f "delims=" %%q in (play.txt) do (
start /wait /max /d "C:\Program Files\NoteWorthy Composer 2 Viewer\" NWC2View.exe "%%q" /play /close)

So particularly note :
The set of brackets on the first line contains the name of the file that you set up as the play list.
You will need to change this if you called the file something else.

In the second line, in quotes, is the path to your NoteWorthy Viewer. This may be the same as displayed if you used the standard installation.

So save this file (Play.bat) in the same directory as your play list.

Now you just need to double click it to play your play list in the viewer. You can set up as many play lists as you like but you will either need to change the name in Play.bat when you want to play a different list or you could have several batch files each one containing a different play list.  (There is another way to supply the file name when you run the file - but let's keep this at a basic level).

That's it - happy playing.

For those that are interested, here is what is going on in the batch file.

/f tells the command processor to process an input file (Play.txt) a line at a time.
"delims="   tells the command processor that when it's reading in a file, to read all of the line - no delimiters. (If you don't have this instruction then it will read the first line only as far as the first space)
%%q  is the variable to which it assigns the record from the file.
do -  do the following set of commands for each record read in
start   -  start the program
/wait  - wait till the program has finished before looping back to the beginning
/max   - run the program in a maximised state
/d  This parameter tells the command processor which directory(folder)the program is in.
/play  - tells the NoteWorthy Viewer to automatically play. (It doesn't wait for you to tell it to play).
/close - tells the viewer to close when it has finished playing the file. (It doesn't wait for you to close it).