401
User Tools / ! Error in lua documentation (nwcut.askbox) !
http://lua.noteworthycomposer.com/nwcut.html##(nwcut).askbox
The return value seems to be 1 for Yes and 0 for No
The flags work as mentioned : 1 for Yes (default), and 2 for No
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.
I think you would be better off iterating through the table using pairs(..) rather than a counting loop.
local function ShowVar(name, var)Output:
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
line ==> |Note|Opts:Stem=Down|Pos:1|Dur:Half
#durs ==> 0
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
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".
local NoteLengths = { "16th" = 48, "32th" = 24, "4th" = 192, "64th" = 12, "8th" = 96, "Half" = 384, "Whole" = 768 }gives this error:
'}' expected near '='
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
line ==> |Note|Opts:Stem=Down|Pos:1|Dur:Half
#durs ==> 0
Don't use "\r". Just use "\n".
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
Absolute -2
Absolute
-2
The specific error message is "Command process failed"
Is there a special place I should store the MetronomeStaff.js file? Right now it is still in my download folder.
Thank you so much for the tool, I downloaded it just now. Unfortunately when I ran the metronome I got an error message:-
"STDERR"
The following needs a bit of correction:
- Save as’ in YourScriptFolder
!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
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.
Thank you for reading this.
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.
I haven't studied your code, but it seems other clefs could be added easily.
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.
Updates will follow as soon as possible.
I added following function to the templates: GetProp, SetProp, RemoveProp, GetOpt, SetOpt, RemoveOpt
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.
Hmmm, seems to be a private website and requires a logon and password.