Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Opagust

401
User Tools / Re: Change Clef
Update 18/02-2015 : new version :
 - correction of a bug (inserting clef after selection); this involved change of input type ('Clip Text' ==> 'File Text')
 - rewritten in script language Lua ==> change of installation instructions

See original message in this topic
403
User Tools / Re: Lua as user tool script
I realise now I didn't show the output of my coding. Here are both the code and the output
Code: [Select · Download]
local function ShowVar(name, var)
if Testing then
nwcut.warn(name.." ==> ", var, "\n")
end -- if
end -- ShowVar
 
local line = item:__tostring()
ShowVar("line", line)
local durs = item.Opts.Dur
ShowVar("#durs",#durs)
for i = 1 , #durs do
ShowVar("dur"..i , durs[i])
end -- for
Output:
Quote
line ==> |Note|Opts:Stem=Down|Pos:1|Dur:Half
#durs ==> 0

I had setlevel(2). That's why I included to _tostring line, to show the contents of item.
The result shows that the item.Opts.Dur is nil. Why isn't it = "Half"?
404
User Tools / Re: Lua as user tool script
I think you need to put [ ] around the keys in your assignment (i.e. around the "16th", etc.). Also, you probably want to change 32th to 32nd :)

The square brackets do the job! I also changes 32th into 32nd, thanks.

Mind you, I have not done much with nwcut, but I think your problem is that Dur is not part of the Opts segment of the nwctext. (Opts only contains the Stem=Down part.) Try changing "item.Opts.Dur" to "item.Dur".

That's not the reason. For accessing the Stem, I have to use "item.Opts.Opts.Stem".
Thanks anyway, I'm sure Rick will  come with the answer soon :)
405
User Tools / Re: Lua as user tool script
Two other problems:
1)
Code: [Select · Download]
local NoteLengths = { "16th" = 48, "32th" = 24, "4th" = 192, "64th" = 12, "8th" = 96, "Half" = 384, "Whole" = 768 }
gives this error:
Code: [Select · Download]
 '}' expected near '=' 

2)
Code: [Select · Download]
local function ShowVar(name, var)
if Testing then
nwcut.warn(name.." ==> ", var, "\n")
end -- if
end -- ShowVar

local line = item:__tostring()
ShowVar("line", line)
local durs = item.Opts.Dur
ShowVar("#durs",#durs)
for i = 1 , #durs do
ShowVar("dur"..i , durs[i])
end -- for

I expected 'durs' to be a string = "Half", but when I treated it as a string I got an error stating that it was a table. So I included the ShowVar() calls, with following result:
Quote
line ==> |Note|Opts:Stem=Down|Pos:1|Dur:Half
#durs ==> 0

What did I do wrong?
407
User Tools / Re: Lua as user tool script
My first problems:
1) I want to write several lines on stderr, so I included a string "\r\n" (return/newline) but that has no effect
  See line 4 in:
Code: [Select · Download]
nwcut.setlevel(2)
local DynamicFound = false
for i = 1, #arg do
nwcut.warn(arg[i], "\r\n")
end -- for i
for item in nwcut.items() do
if item:Is("Dynamic") then
if arg[1] == "Absolute" then
item.Opts.Pos = arg[2]
elseif  arg[1] == 'Relative' then
item.Opts.Pos = item.Opts.Pos + arg[2]
elseif arg[1] == 'Keep_position_first_dynamic' then
local FirstPos = DynamicFound and FirstPos or item.Opts.Pos
item.Opts.Pos = FirstPos
end --if arg
end -- if item
nwcut.writeline(item)
end --for item

This is what I get in stderr:
Quote
Absolute -2

This is what I expected:
Quote
Absolute
 -2

2) How can I use the return codes as explained in http://www.noteworthysoftware.com/nwc2/help/intro_usertooldev.htm
 I want to use return code 1 in case of an error and 0 for a warning. Reason : with nwcut.warn, the user can click 'OK' or 'Cancel'. I don't want that in case of an error.

I found out : http://lua.noteworthycomposer.com/nwcut.html##(nwcut.const).rc_Error
409
User Tools / Re: Lua as user tool script
Many thanks, Rick!

A few other questions :
  • What does setlevel() do?
  • How do I access the arguments?
  • Is there any documentation on nwcut available?
410
User Tools / Lua as user tool script
At the moment, I'm learning the Lua script language. I want to experiment with writing some simple user tools, but I don't know how to access stdin, stdout and stderr.
 
411
User Tools / Layering voices
In many song sheets for choirs, each group of two voices is on 1 staff. In NWC, you can do this by entering chords, or by layering each group of two staffs.But both methods are not ideal:
– Entering chords is not very easy + you don’t always have control over the stems of the individual notes of a chord, which is necessary to differentiate between the two voices.
– When layering, you not only have to set the stems. In order not to have a messy result after layering, you also have to set the properties ‘Use stem for articulation’, ‘Slur direction’ and ‘Tie direction’.
This can easily be done by selecting a whole staff. But that’s not always enough: you have to check the whole staff for situations where you have to set the properties ‘Extra note spacing’ and/or ‘Extra accidental spacing':
– when the distance between the note on the top staff and the note on the bottom equals 1,
– when you have notes with accidentals,
– when the top note is lower then the bottom note,
– when you have chords.
This tool takes care of all this (with the active staff as top staff and the next as bottom staff).

In addition:
– The label and the abbreviated label of the top staff is modified by concatenating with those of the bottom staff, since the former are used when printing the layered staffs. (When the labels are equal, there will be no concatenation.)
– If both staffs have lyrics, the property ‘Placement’ will be set to ‘Top’, resp. ‘Bottom’.

By choosing the action ‘Unlayer’, you can undo all the actions described above.

Installation instructions:
- Download and save the file in YourScriptsFolder and change the extention' txt' to 'js'.
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
- Enter the name of the tool and choose a group or enter the name of a new group
Command Line: Wscript  C:\Users\Gust\MijnScripts\LayerVoices.js <PROMPT:Action:=|Layer|Unlayer|Help”
Input Type:  File Text
Under ‘Options: Check ‘Returns File text’

28/12/2017: New version attached, written in lua. See next post for some details.
14/03/2017: Bug corrected in lua script. See reply #2
412
User Tools / Re: Extend Staff
I discovered and corrected a bug. The barcount in the active staff didn't handle multimeasurerests.
New version in the original post.
413
User Tools / Re: MetroNomeStaff
The specific error message is "Command process failed"
Please check that your command line starts with WScript + space

Is there a special place I should store the  MetronomeStaff.js file? Right now it is still in my download folder.
You can store the file where you want, as long as you specify the right path in your command line.
So  your command line should look like "WScript C:\Users\XXXX\Documents\Downloads\MetronomeStaff.js <PROMPT:Action:=|Make_Rehearsal_File|Undo|Help|TestMake> <PROMPT:Foreground Volume:=*120]> <PROMPT:Background Volume:=*80>."

I hope this was helpful.
414
User Tools / Re: MetroNomeStaff
Thank you so much for the tool, I downloaded it just now. Unfortunately when I ran the metronome I got an error message:-
                   "STDERR"

Hello FRbass,

I have a few questions:

-Didn't you get a specific error message?
-Did you install correctly ?
-Do you get the same result when you run the tool on another file?

415
User Tools / Re: Make Rehearsal File
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'.
418
User Tools / MetroNomeStaff
This tool creates a new staff 'Metronome' with metronome ticks.

It's inserted above the active staff, has zero Staff Lines, Channel 10, (hidden) Percussion Clef and 'Woodblock' as Staff Instrument.
The other properties are inherited from the active staff.
The notes have 'x' noteheads and zero stemlength.

You can download the tool from the attached file or my website: http://opagust.wordpress.com/my-user-tools/
Don't forget to change the extension to '.js'.

To Install in NoteWorthy:
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
-  Enter the name of the tool and choose a group or enter the name of a new group

   Command Line: "Wscript YourScriptsFolder\MetronomeStaff.js <PROMPT:Action=|Create_MetronomeStaff|Help>"
   Input Type: File Text
   Under 'Options: Check 'Returns File text'
423
User Tools / OGNoteNames
With this tool you can insert note names into your song file.

You can download the tool from the attached file or my website: http://opagust.wordpress.com/my-user-tools/
Don't forget to change the extension to '.js'.

To Install in NoteWorthy:
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
-  Enter the name of the tool and choose a group or enter the name of a new group
- Command Line: “Wscript YourScriptsFolder\OGNoteNames.js <PROMPT:Act upon:=|All_Staffs|Visible_Staffs|Active_Staff|Help> <PROMPT:NoteNames:=|A_B_C_...|do_re_mi...> <PROMPT:Insert as:=|Lyrics|Text|>
-  Input Type: File Text
- Under ‘Options: Check ‘Returns File text’
424
User Tools / OGNoteRange
This tool inserts a chord of muted grace notes at the cursor position.
This ‘range chord’ contains the highest and lowest note found in the selection or, if nothing is selected, in the part of the active staff after the cursor position.
Accidentals and Key Signatures are taken into account.

You can download the tool from the attached file or my website: http://opagust.wordpress.com/my-user-tools/
Don't forget to change the extension to '.js'.

To Install in NoteWorthy:
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
-  Enter the name of the tool and choose a group or enter the name of a new group
- Command Line: “Wscript YourScriptsFolder\OGNoteRanges.js <PROMPT:Option:=|Create_Range_Chord|Help>”
-  Input Type: File Text
- Under ‘Options: Uncheck ‘Returns File text’
425
User Tools / Re: Courtesy Accidentals
There seemed to be some problems with my website, where I had copied the code of my tools as text in specifiic webpages.

So now I've changed my method: I uploaded all tools in my website (with extension '.doc') and provided  links to these files, instead of pages with the copied code.

You can download them on http://opagust.wordpress.com/my-user-tools/
427
User Tools / Courtesy Accidentals
Update: Don't use the links below, use http://opagust.wordpress.com/my-user-tools/ instead and click on the name of the tool to download (changing the extension into '.js').


http://opagust.wordpress.com/courtesyaccidentals-js/

With this tool you can create courtesy accidentals according to the Key Signature. It acts on a selection, if present, or on the whole active staff.

The courtesy accidentals are inserted as text items,
 - with the font StaffSymbols(normal size) or StaffCueSymbols(small size);
 -  with or without parentheses;
 - repeated or not if the same note occurs more than once within a measure.

If you choose 'Undo', all 'texted' accidentals are removed, regardless of the choices on size, parentheses or repeats.

To download the tool from the link above :
- Select and copy all the text within the frame
- Open a text editor like Wordpad or a Java Script Editor and past the copied text
- Click on the name of the tool
- Save as ’CourtesyAccidentals.js' in YourScriptFolder

To Install in NoteWorthy:
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
-  Enter the name of the tool and choose a group or enter the name of a new group
-  Command Line: "Wscript YourScriptsFolder\CourtesyAccidentals.js <PROMPT:Action:=|Create_CourtesyAccidentals|Undo|Help> <PROMPT:Parenthesize?=|Yes|No> <PROMPT:Repeat in same measure?=|Yes|No> <PROMPT:Size:=|Normal|Small>"
-  Input Type: Clip Text
-  Under 'Options: Uncheck 'Returns File Text'

P.S.I also modified the tool http://opagust.wordpress.com/changeclef-js/ to also move the courtesy accidentals, inserted by CourtesyAccidentals.js.
429
General Discussion / Re: The downside of selectors
Thanks, Mike.

P.S. Just  purse your lips and whistle, that's the thing.

Code: [Select · Download]
!NoteWorthyComposerClip(2.51,Single)
|Clef|Type:Treble|OctaveShift:Octave Down|Visibility:Always
|Key|Signature:F#|Tonic:G
|Tempo|Tempo:104|Text:"Swing"|Pos:9
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Bar
|Note|Dur:Half|Pos:-2
|Note|Dur:8th,Slur|Pos:-4|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:2
|Rest|Dur:4th
|Bar|Style:MasterRepeatOpen
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Bar
|Note|Dur:Half|Pos:-2
|Note|Dur:8th,Slur|Pos:-4|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:2
|Rest|Dur:8th
|Note|Dur:8th|Pos:-5
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:0
|Note|Dur:4th|Pos:0
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-4
|Note|Dur:8th|Pos:-7
|Bar
|Note|Dur:8th|Pos:-6|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:Half,Dotted|Pos:-5|Opts:Crescendo
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=End
|Note|Dur:Half|Pos:-1
|Bar
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Note|Dur:4th,Dotted|Pos:-4
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:Half,Dotted|Pos:-1
|Note|Dur:4th|Pos:0
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Bar
|Note|Dur:Half|Pos:-2
|Note|Dur:8th,Slur|Pos:-4|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:2
|Rest|Dur:4th
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:2
|Rest|Dur:4th
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:0
|Rest|Dur:4th
|Bar
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Rest|Dur:4th
|Bar
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:Half,Dotted|Pos:-5
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-1
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Note|Dur:8th|Pos:-4
|Note|Dur:8th|Pos:-4
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Crescendo,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Crescendo,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Crescendo,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Crescendo,Beam=End
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Crescendo,Beam=First
|Note|Dur:8th|Pos:-4|Opts:Stem=Up,Crescendo,Beam
|Note|Dur:8th|Pos:-3|Opts:Stem=Up,Crescendo,Beam
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Crescendo,Beam=End
|Bar
|Note|Dur:Half,Dotted|Pos:-1
|Note|Dur:4th|Pos:0
|Bar|SysBreak:Y
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Bar
|Note|Dur:Half|Pos:-2
|Note|Dur:8th,Slur|Pos:-4|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:2
|Rest|Dur:4th
|Bar|Style:MasterRepeatClose|SysBreak:Y
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2
|Bar
|Note|Dur:Half|Pos:-2
|Note|Dur:8th,Slur|Pos:-4
|Note|Dur:8th|Pos:-5
|Note|Dur:4th|Pos:-4
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th|Pos:5
|Note|Dur:4th|Pos:3
|Rest|Dur:8th
|Note|Dur:8th|Pos:0
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=End
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:-1|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:-2
|Rest|Dur:4th
|Rest|Dur:Half
|Bar|Style:SectionClose|SysBreak:Y
!NoteWorthyComposerClip-End
430
General Discussion / Re: The downside of selectors
Quote
It's been previously documented that the selectors can be customized by the user, so it would not be difficult to add custom shortcut keys to the dynamics selector.

I know that the shortcut for bringing up a selector can be customized in the selector file via "Title(&s)" in File info.

But how can I assign shortcuts to the individual items in a selector?
432
User Tools / Re: Change Clef
You might want to consider editing earlier posts to remove pervious versions.  Anytime someone visits your thread, they can only get the L & G version (latest and greatest) when you remove and replace attachments or use some other method.

Point taken.
433
User Tools / Re: Change Clef
Quote
I haven't studied your code, but it seems other clefs could be added easily.

Warren, did you use my latest version? It handles Treble, Bass, Tenor, Alto and Percussion. That are all the clefs I know of.
In addition, my first version didn't handle notes and chords with accidentals correctly, which is showed in your outputclip.
434
User Tools / Re: Change Clef
I discovered and corrected 2 typos ('optarry' and 'optary' instead of 'optarray' in function GetOpt).
435
User Tools / 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.
436
User Tools / Re: How do I install a new user tool in Windows 8.1?
Tried that, thanks, Rick.  Doesn't work.

When I open the user tool menu, I get a window headed User Tool Description.  This has three blank fields. The first one, Group, has an arrow, but when it's selected, a small window opens.  I think it should have a list of the four Groups that show in the User Tool Description, but it's blank. The next field, Name, is blank too. 

You have to make your own group(s) for the tools you install, so just fill in the Group field with whatever you want. In the name field, fill in how you want the tool to be presented in the User Tool Window when you  select your group.
437
User Tools / Re: Dynamics, Velocity and Volume
Seems we both are doing similar things, Warren.
I noticed your tool swaps the velocity and volume values. I used Tina Billet's formula to calculate the volumes.
 
Let's leave it to the forum readers to choose which suits them the best.

438
User Tools / Dynamics, Velocity and Volume
If you want to know all about dynamics, velocity and volume, you should read Tina Billet's document on the NWC Scriptorium  http://nwc-scriptorium.org/helpful/dynamics.pdf. (If you get "Forbidden File Access", copy the link into a new browser window.)

It also describes how to change the default dynamics to vary in volume rather than velocity, so that crescendo and decrescendo not only effect the loudness of each note at the start, but also varies while the note is playing. It contains a formula for calculating the right dynamic volumes, using the wanted Velocities and maximum staff volume. It then describes how to change the dynamics using the built in User Tool adp_GlobalMod.This tool is to be executed for each staff individually. That's because at the time the document was made, User Tools could only work on 1 staff at a time.

In the present version  of NWC2 a User Tool can work on an entire file (Input Type 'File Text'). So I have tried to make it somewhat easier. It takes a few additonal steps, but they have to be done only once , or once per existing NWC file. So here is what I suggest:
1.   Decide what for you are the ideal Velocities (DynVel) and Channel Volume.  You can set the velocities by making your own itree, as explained in Tina Billet's document. This is to be done only once.
2.   If you want it to take effect on an existing NWC file, you should do this via the Staff Properties, Instrument Tab. You may also want to change the Channel Volume (Midi Tab). This is to be done only for the top staff. You can then copy and paste the new Volumes and Velocities using my tool 'CopyVolVel.js'.
3.    Then use my tool 'SetDynVol.js' to change the Dynamic Volumes,  according to Tina's formula "(Velocity * default volume)/highest dynamic velocity" for calculating the required volume of a specific dynamic.

That's what you can do for your existing NWC files. Next you can make your own custom Dynamics selector that you can use when making a new NWC file:
1.   Move your mouse cursor over the Dynamics selector, rightclick and choose "Customize...". The selector file will open.
2.   Save a copy: go to 'File'/'Save as..." in your Config Folder (*) and choose a non existing name of the form '10#.nwc', where # = 0, a, b, c, d, e or f (100.nwc being selector 11, ... 10f.nwc selector 16).
3.   Do step 2 and 3 above on this file.
4.   If you want to use a specific short cut key, say 'v' (for volume), change the title from "Dynamics Selector (&d)" to "Dynamics Selector (&v)"
(*) If you don't know where to find your Config Folder, go to 'Tools/Options...' and select the 'Foldesr' tab

In attachment, you find the 2 tools mentioned above. Don't forget to change the extension to '.js' after downloading.

14/09/2023: updated the installation instructions (see first lines in the attached files)
441
User Tools / Re: Change Clef
I enclosed a new version of ChangeClef.js, with corrected handling of accidentals, chords with "pos2" and option "Stem" in Restchords.

P.S. Don't forget to change the extension to "js" after downloading.
445
General Discussion / Dynamics, Volume and Velocities
I'm working on a tool to change Dynamic Volumes according to Tina Billet's document http://nwc-scriptorium.org/helpful/dynamics.pdf, in order to have a (de)crescendo has also affect during the playing of long notes.
So I will use her formula "(Velocity * default volume)/highest dynamic velocity" for calculating the required volume of a specific dynamic.
But I'm not sure about the velocities: shall I leave them unchanged, or do I have to use the highest dynamic velocity for each dynamic?
Example: If the default volume is set to 120 and DynVal = (25,35,45,55,68,80,92,108), we become, using the formula, a value of 50 for the volume of dynamic 'p'. That's clear. But should it become "p[-, 50]" (which will be the same as p[45,50], or is p[108,50] the correct result?

Thanks in advance for all expert advices!
446
User Tools / Re: Change Clef
Just a note:
Bryan Creer posted a "Clef Change" php some years ago, which includes (if I remember correctly) Tenor and Alto clefs, with option of octave up / down.

The scores we use for the songs of our choir only have Treble and Bass clefs. For the other clefs, I didn't know the exact position. After a look into the script of Bryan Creer, I could modify mine to include also Tenor, Alto and Percussion.

The result is that there are two tools now that do exactly the same. The difference lies in the script language. (PHP seems to me a little obscure, so I prefer Java Script.)
In attachment you find the new version. (Don't forget to change the extension 'txt' to 'js')

New Command Line : "Wscript YourScriptsFolder\ChangeClef.js <PROMPT:New Clef:=|Treble|Bass|Tenor|Alto|Percussion> <PROMPT:Octave Shift:=|None|Octave_Up|Octave_Down> <PROMPT:Execution Mode:=|Modify|Show|Help>"
448
User Tools / Change Clef
This tool changes the clef, moving all notes and chords up or down appropriately.
Update 18/02-2015 : new version :
 - correction of a bug (inserting clef after selection); this involved change of input type ('Clip Text' ==> 'File Text')
 - rewritten in script language Lua ==> change of installation instructions

Installation instructions:
- Download and save the file in YourScriptsFolder and change the extention' txt' to 'js'.
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
- Enter the name of the tool and choose a group or enter the name of a new group
- Command Line: "Wscript YourScriptsFolder\ChangeClef.js <PROMPT:New Clef:=|Treble|Bass> <PROMPT:Octave Shift:=|None|Octave_Up|Octave_Down> <PROMPT:Execution Mode:=|Modify|Show|Help>"

- Drag and drop the downloaded file upon the NWC window and click "Yes" on the pop up window "Please Confirm"
- Click "Edit" in the window "User Tools"
- Choose Input Type: Clip Text
- Under 'Options: Uncheck 'Returns File Text'

Any comments are welcome.

P.S. You can find this and other tools also on my website http://opagust.wordpress.com
449
User Tools / Extend Staff
This tool extends the current staff, so that it has an equal number of measures and ‘structure’ as the previous staff.

Installation instructions:
- Download and save the file in YourScriptsFolder and change the extention' txt' to 'js'.
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
- Enter the name of the tool and choose a group or enter the name of a new group
- Command Line: "Wscript YourScriptsFolder\ExtendStaff.js <PROMPT:Fill measures with whole rests?:=|Yes|No> <PROMPT:Execution Mode:=|Modify|Show|Help>"
- Input Type: File Text
- Under 'Options: Uncheck 'Returns File text'

Any comments are welcome.

450
User Tools / Add empty staff
This tool creates a new, ‘empty’ copy of the active staff.

Possible uses:
– to start with a new staff (not filled with rests) that inherits the ‘structure’ of the copied staff, so you’ll just have to enter the notes in the empty measures;
– to create a tempo or a conductor staff (filled with whole rests).

Installation :
- Download and save the file in YourScriptsFolder and change the extention' txt' to 'js'.
- Open a NoteWorthy File
- Choose ‘Tools’, ‘User Tool…’ or enter Alt-F8
- Click ‘New…’
- Enter the name of the tool and choose a group or enter the name of a new group
- Command Line: "Wscript YourScriptsFolder\AddEmptyStaff.js <PROMPT:Execution Mode:=|Show|Modify|Help> "
- Command Line: “Wscript YourScriptsFolder\AddEmptyStaff.js <PROMPT:Fill measures with rests?=|No|Yes,Visible|Yes,Visibility=Never> <PROMPT:Copy Lyrics?=|Yes|No> <PROMPT:Execution Mode:=|Modify|Show|Help>”
- Input Type: File Text
- Under  'Options': check 'Returns File Text'

P.S. You can find this and other tools also on my website http://opagust.wordpress.com

Any comments are welcome.