61
!NoteWorthyComposerClip(2.0,Single)
|Chord|Dur:4th|Pos:b-1,#1|Opts:Stem=Down|Dur2:Half|Pos2:#1
!NoteWorthyComposerClip-End
IMO, there should not be so much space between the flat and the sharp.
74
This program shows the notes used. Ambit is the anglicized form of Ambitus. Usually this is used to find the range for a vocalist but, in my extended form, more useful data is provided.
After MIDI import, transposition or shifting of notes, one is usually must go through the entire staff to check for stange enharmonic note spellings. After fixing them, another search is usually needed to verify. This tool can expedite this.
It produces a short series of muted grace note clusters representing all the note/acccidental positions occurring in the selection. This varies if accidentals are forced. Both the forced and unforced results are useful.
Option Explicit ' Ambit.vbs, ver 1.1
' NWC2 UserTool to show all notes used in selection
' &Command: WScript Scripts\Ambit.vbs
' Reference: https://forum.noteworthycomposer.com/?topic=6786.0
' History:
' 2009-12-28: 2.1 Beta 5 aware (1.1)
' 2009-04-10: Initial release (1.0)
Const Template = "|Chord|Dur:Whole,Grace|Pos:?|Opts:Muted"
Dim d: Set d = CreateObject("Scripting.Dictionary")
Dim a1, a2, e, i, s
For Each e In Array("", "n", "b", "#", "x", "v")
Set d(e) = CreateObject("Scripting.Dictionary")
Next
Dim aIn: aIn = Split(WScript.StdIn.ReadAll, vbCrLf)
For i = 1 To UBound(aIn) - 2
a1 = Split(aIn(i), "|")
Select Case a1(1)
Case "Note", "Chord", "RestChord"
For Each e In Filter(a1, "Pos")
For Each s In Split(Split(e, ":")(1), ",")
a2 = aPos5(s)
d(a2(0))(a2(0) & a2(1)) = ""
Next
Next
End Select
Next
For Each e In d
s = Join(d(e).Keys, ",")
If Len(s) Then aIn(0) = aIn(0) & vbCrLf & Replace(Template, "?", s)
Next
If InStr(aIn(0), vbLf) Then aIn(0) = aIn(0) & vbCrLf & "|Bar|XBarCnt:Y"
WScript.Stdout.Write Join(aIn, vbCrLf)
Function aPos5(ByVal s) ' NotePos to array
Dim r(4), e ' retval, element
If InStr("nb#xv", Left(s, 1)) Then r(0) = Left(s, 1) ' accidental
If InStr(s, "^") Then r(3) = "^" ' tie
If InStr(s, "!") Then r(4) = Mid(s, InStr(s, "!"), 2) ' color
For Each e In r: s = Replace(s, e, "", 1, 1): Next
If Not IsNumeric(s) Then r(2) = Right(s, 1) ' notehead
r(1) = Replace(s, r(2), "")
aPos5 = r ' acc, pos, head, tie, color
End Function
Rose.png shows the result for the Vocal staff of the sample file: Rose.nwc
Edit: 2009-12-28: made 2.1 Beta 5 aware (1.1), older version below.
Option Explicit ' Ambit.vbs, ver 1.0
' NWC2 UserTool to show all notes used in selection
' &Command: WScript Scripts\Ambit.vbs
Const Template = "|Chord|Dur:Whole,Grace|Pos:?|Opts:Muted"
Dim d: Set d = CreateObject("Scripting.Dictionary")
Dim a1, a2, e, i, s
For Each e In Array("", "n", "b", "#", "x", "v")
Set d(e) = CreateObject("Scripting.Dictionary")
Next
Dim aIn: aIn = Split(WScript.StdIn.ReadAll, vbCrLf)
For i = 1 To UBound(aIn) - 2
a1 = Split(aIn(i), "|")
Select Case a1(1)
Case "Note", "Chord", "RestChord"
For Each e In Filter(a1, "Pos")
For Each s In Split(Split(e, ":")(1), ",")
a2 = aPos(s)
d(a2(0))(a2(0) & a2(1)) = ""
Next
Next
End Select
Next
For Each e In d
s = Join(d(e).Keys, ",")
If Len(s) Then aIn(0) = aIn(0) & vbCrLf & Replace(Template, "?", s)
Next
If InStr(aIn(0), vbLf) Then aIn(0) = aIn(0) & vbCrLf & "|Bar|XBarCnt:Y"
WScript.Stdout.Write Join(aIn, vbCrLf)
Function aPos(s) ' NotePitchPos to array
Dim test: test = Split("nb#xv ? oxXz ^")
Dim r(3), c, i ' retval, char, index
r(1) = s: c = Left(s, 1) ' acc?
For Each i In Array(0, 3, 2)
If InStr(test(i), c) Then r(i) = c
r(1) = Replace(r(1), r(i), "", 1, 1)
c = Right(r(1), 1) ' tie?, head?
Next: aPos = r ' acc, pos, head, tie
End Function
76
!NoteWorthyComposerClip(2.0,Single)
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=First
|Rest|Dur:16th|Opts:VertOffset=-15
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Slur=Downward,Beam=First
|Rest|Dur:16th|Opts:VertOffset=-15|Visibility:Never
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:16th,Slur|Pos:0|Opts:Stem=Down,Slur=Downward,Beam=First
|Rest|Dur:16th,Slur|Opts:VertOffset=-15|Visibility:Never
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:16th,Slur|Pos:0|Opts:Stem=Down,Slur=Downward,Beam=First
|Rest|Dur:16th,Slur|Opts:VertOffset=1|Visibility:Never
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=End
!NoteWorthyComposerClip-End
This clip is a bit strange. The first and last group display the way I would expect in the Editor and Print Preview (except that the slur should be closer to the beam). As for the center two groups ...
IMO, beams should ignore hidden rests. Slurs should ignore hidden rests. That said, slurs should continue to observe the position of hidden muted grace notes unless some superior method is devised to increase slur curvature.
78
On most NWC's pages outside this forum, there is an option to Copy Url.
If, for example, I click on Copy Url for <this page>, it places this in my clipboard:Commands
http://ntworthy.com/nwc2/help/HELP_ONCOMMANDS.htm
It would more useful to me if this were placed in my Clipboard instead:
[url=http://ntworthy.com/nwc2/help/HELP_ONCOMMANDS.htm]Commands[/url]
87
Layer:
!NoteWorthyComposerClip(2.0,Single)
|Rest|Dur:Whole
|Bar|SysBreak:Y
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
!NoteWorthyComposerClip-End
with:!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab
|TimeSig|Signature:Common
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
!NoteWorthyComposerClip-End
Whole Measure Rests align in the editor, but not in Print Preview.
Workaround is to add invisible barlines:!NoteWorthyComposerClip(2.0,Single)
|Bar|Visibility:Never
|Rest|Dur:Whole
|Bar|SysBreak:Y
|Bar|Visibility:Never
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
!NoteWorthyComposerClip-End
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab
|Bar|Visibility:Never
|TimeSig|Signature:Common
|Rest|Dur:Whole
|Bar
|Bar|Visibility:Never
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
!NoteWorthyComposerClip-End
IMO, Whole Measure Rests must align in any given bar across the entire system regardless of signature contents/visibility.
92
!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Treble
|Key|Signature:C|Visibility:Never
|TimeSig|Signature:Common
|Note|Dur:Whole|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
|Bar
|Ending|Endings:1
|Note|Dur:Whole|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
|Bar|Style:MasterRepeatClose
|Note|Dur:Whole|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
|Bar|SysBreak:Y
!NoteWorthyComposerClip-End
Using a 300dpi printer, space from bar to note is 36 pixels with Special Ending, 52 pixels without. Same problem in NWC 1.75b
IMO, presence/absence of Special Ending should not change the distance from bar to note. I am not looking for a workaround.
93
The attached tool will insert object(s) into a staff when the notehead type changes.
Usually, an X or diamond notehead indicates a change of instrument patch, volume and/or pitch. Putting these on separate staves can be tedious.
Normally, information is added to the command line to alter the behaviour of the tool. But this tool needs far too much info for that method. Instead, it reads the info from the end of the staff (what I call the 'definition area'). I use |Ending|Endings:7 to indicate this which keeps the defintions from playing or being exported to MIDI.
Listen to this clip:!NoteWorthyComposerClip(2.0,Single)
|Clef|Type:Bass|OctaveShift:Octave Down
|Key|Signature:Bb,Eb,Ab
|Tempo|Tempo:150|Pos:11
|TimeSig|Signature:AllaBreve
|Dynamic|Style:f|Pos:-7
|Bar|Style:LocalRepeatOpen
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:6
|Note|Dur:4th|Pos:3x
|Note|Dur:8th|Pos:3x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:n-2
|Note|Dur:8th|Pos:0^
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:n5
|Note|Dur:4th|Pos:3x
|Note|Dur:8th|Pos:3x|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-4^|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-1
|Note|Dur:8th|Pos:1^
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Bar|Style:LocalRepeatClose|Repeat:4
|Ending|Endings:7|Visibility:Never
|Instrument|Name:"[o]"|Patch:36|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0|Visibility:Never
|Bar|Visibility:Never
|Instrument|Name:"[x]"|Patch:115|Trans:-2|DynVel:10,30,45,60,75,45,108,127|Pos:10|Justify:Center|Placement:AtNextNote
|Dynamic|Style:f|Pos:-9|Justify:Right|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0x|Visibility:Never
|Bar|Visibility:Never
|Text|Text:"{^}"|Font:StaffBold|Pos:10|Justify:Center|Placement:AtNextNote|Visibility:Never
|Note|Dur:4th|Pos:0X|Visibility:Never
|Bar|Style:SectionClose
!NoteWorthyComposerClip-End
Then run the tool on the entire staff and listen again. Each time the tool is run, anything added by it before is removed. I do this by tagging the additions: "|Color:6|Visibility:Never", hardly a normally needed attribute.
96
Playing around with nwctxt, I produced this:
!NoteWorthyComposer(2.0)
|StaffProperties|Volume:-1|StereoPan:-1
|PerformanceStyle|Style:Tenuto|Pos:14
|Instrument|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:10
|Instrument|Trans:0|DynVel:0,30,45,60,75,92,108,127|Pos:6
|Dynamic|Style:ppp|Pos:-7
|Note|Dur:4th|Pos:-2
|Dynamic|Style:p|Opts:Velocity=-1|Pos:-11
|Note|Dur:4th|Pos:-2
|Dynamic|Style:p|Opts:Velocity=0|Pos:-7
|Note|Dur:4th|Pos:-2
|Dynamic|Style:p|Opts:Velocity=-128|Pos:-11
|Note|Dur:4th|Pos:-2
|Dynamic|Style:p|Opts:Velocity=0|Pos:-7
|Note|Dur:4th|Pos:-2
!NoteWorthyComposer-End
And was somewhat surprised to get this output from Mf2T:
MFile 1 2 192
MTrk
0:0:0 Meta Text "Generated by NoteWorthy Composer"
0:0:0 Meta TrkEnd
TrkEnd
MTrk
0:0:0 Meta 0x21 00
0:0:0 Meta TrkName "Staff"
0:0:0 On ch=1 note=g5 vol=110
0:1:0 On ch=1 note=g5 vol=0
0:1:0 On ch=1 note=g5 vol=255
0:2:0 On ch=1 note=g5 vol=0
0:2:0 On ch=1 note=g5 vol=255
0:3:0 On ch=1 note=g5 vol=0
0:3:0 On ch=1 note=g5 vol=128
1:0:0 On ch=1 note=g5 vol=0
1:0:0 On ch=1 note=g5 vol=128
1:1:0 On ch=1 note=g5 vol=0
1:1:0 Meta TrkEnd
TrkEnd
What MF2T calls "vol", NWC2 calls "Velocity". Playing this on my AWE32 synth produced no problems. It sounds as though it translates vol=255 into vol=127 and vol=128 into vol=0. YMMV
NWC2's action seems to be to accept any numeric input and kill all but the lowest 8 bits. If this results in zero, it is ignored and the current running velocity is used instead.
It seems to me that when dealing with 7bit data, zero should mean zero. -1 should mean: "keep the running status". This is how Volume and StereoPan work in StaffProperties.
8bit data should not be output where 7bit data is expected.
IMO, Volume, StereoPan, DynVel and Velocity should all work the same. The User Interface spinbox should range from -1 to 127. Any numeric input should be accepted from a Clip or nwctxt. If the input evaluates to True (i.e., -1), the running status should be used. Otherwise, the lowest 7 bits should be used.
This would simplify the program, the documentation, User Tools and Nwctxt Converters. The checkboxes could be eliminated (they are not exported anyway).