Skip to main content
Topic: Make Rehearsal File (Read 9185 times) previous topic - next topic

Make Rehearsal File

This tool is intended to make seperate rehearsal scores for the different voices of polyphonic songs.

Before running this tool, make a group "Piano" for the instrumental staffs.

When running the tool, you have to to set two volumes, for 'Foreground' and 'Background'.

The result will be:

- The Staff Velocities(DynVel) from the first visible staff will be copied to the next staffs.

- For the staffs in the "Piano" group:
  - Staff Volume = BackGround Volume;
  - Default Dynamics (with varying Velocities and constant Volume);
  - StereoPan = 64;
  - StaffColor = 'Default';

- For the active staff:
  - Staff Volume = Foreground Volume;
  - Dynamics with constant (highest)Velocity, and Volumes calculated using Foreground Volume and the Staff Velocities ;
  - StereoPan  = 0;
  - StaffColor = 'Highlight 2';

- For the other staffs:
  - Staff Volume = Background Volume;
  - Dynamics with constant (highest) Velocity, and Volumes calculated using Background Volume and the Staff Velocities ;
  - StereoPan  = 127;
  - StaffColor = 'Default' (unless the StaffName = "All" >> 'Highlight 2');

There are 3 execution modes : 'Modify', 'Show' and 'Help'. 'Modify' is the normal mode, 'Show' shows the generated output in stdout (without modifying your file), 'Help' shows the Helptext.

Installation instructions:
  Command Line: "Wscript YourScriptsFolder\MakeRehearsalFile.js <PROMPT:Foreground Volume:=*120> <PROMPT:Background Volume:=*80> <PROMPT:Execution Mode:=|Modify|Show|Help><PROMPT:Action:=|Make_Rehearsal_File|Undo|Help> <PROMPT:Foreground Volume:=*120]> <PROMPT:Background Volume:=*80>" (You may use other pre-filled values then 120 and 80.)" (You may use other pre-filled values then 120 and 80.)
  Input Type: File Text
  Under 'Options: Check 'Returns File text'

Don't forget to change the extension to ".js" after downloading.

Any comments are bug reports are welcome.

02/01/2017: Attached a lua version of the tool.
------------------------------------------------
Updated lua version 20/11/2017
* New Parameters:
  - Foreground Staves : one or more staff names (instead of active staff + staff named 'All')
  - Foreground Color (instead of fixed 'Highlight 2')
  - What to Color :key signature & clef or whole staff
* You can add arguments to the command line to set the value or default for one or more parameters.
Syntax: <parameter>=<value>['?']. The arguments pairs must be seperated by 1 or more spaces. There must not be a space within an argument.
If an argument ends with a '?', the value will be used as default in the dialog, otherwise the value will be assiged to the parameter, which will be skipped in the dialog.
See 'Help on command line parameters' for description of the paramters and valid values.).

21/11/20017 : test switch off.
Always look on the bright side of life!

Re: Make Rehearsal File

Reply #1
I added a  new option 'Undo'.

This implies a modified command line: "Wscript YourScriptsFolder\MakeRehearsalFile.js <PROMPT:Action:=|Make_Rehearsal_File|Undo|Help> <PROMPT:Foreground Volume:=*120]> <PROMPT:Background Volume:=*80>" (You may use other pre-filled values then 120 and 80.)

The action 'Undo' is not really a recovery; you should have saved your file before using the action 'Make_Rehearsel_File', if you want that.
Instead, the result will be:
- The staffs in the "Piano" group: remain unchanged.
- For the other staffs:
   - Staff Volume = ForeGround Volume;
  - Dynamics with constant (highest)Velocity, and Volumes calculated using Foreground Volume and the Staff Velocities ;
  - StereoPan = 64;
  - StaffColor = 'Default'.
Always look on the bright side of life!

Re: Make Rehearsal File

Reply #2
Hi!
Stumbeled upon this user tool and tried it.  Just what I was looking for.
However:
Got error in Wscript:  Line 482 Char 1 Error: The handle is invalid
Running NWC 2.75 on Win 10

Any suggestions? 

Re: Make Rehearsal File

Reply #3
Try running it as a User Tool from within NoteWorthy Composer.

Line 482 is:
Code: [Select · Download]
FileInput = WScript.StdIn.ReadAll();
This will err if there is no STDIN
If you are running it as a User Tool, there will always be STDIN
Registered user since 1996

Re: Make Rehearsal File

Reply #4
I rewrote this tool in Lua, see attachment in first post.
Changes:
- If the active staff's name ends with '/Layered'(*)or '/Muted', then a staff with a name = the part before the '/' will also be treated as Foreground Staff.
- The help text is rewritten (less technical and hopefully more comprehensible). I also included a reference to Tina Billet's formula, with is used to calculate the Volumes and Velocities of the dynamics (Document 'Dynamics.pdf' in http://nwc-scriptorium.org/helpful.html#Explanations).

(*) If you executed the tool 'LayerVoices.og', the original staves were set invisible and the layering was done on visible, muted copies of these staves.
Always look on the bright side of life!

 

Re: Make Rehearsal File

Reply #5
Updated Lua version: see original post
Always look on the bright side of life!