Hi Warren,
have a snippet from a staff that gives some errors...
!NoteWorthyComposerClip(2.751,Single)
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:1
|Rest|Dur:4th
|Note|Dur:4th|Pos:-2
|Rest|Dur:4th
|Bar
|Note|Dur:Half|Pos:-9
|Note|Dur:4th|Pos:-6
|Rest|Dur:4th
|Bar
|Note|Dur:4th|Pos:-6
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-6^|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-6
|Bar
|TimeSig|Signature:2/4
|Note|Dur:Half|Pos:-9
|Bar|Style:MasterRepeatClose
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:-6
|Rest|Dur:4th
|Rest|Dur:Half
|Bar|Style:SectionClose|SysBreak:Y
!NoteWorthyComposerClip-End
If you run the tool over the whole staff, you get a "too few" in the last bar.
If you run the tool over the 2/4 bar you get:
No errors if you don't include the closing barline
If you DO include the barline you get:"Measure 1 too few: 2 beats
If you have an empty bar prior to the repeat barline (I was testing stuff and this happened) you get both bar 4 and 6 with a too few error. NB the empty bar 5 would not be counted by NWC, I recommend your tool do the same or the bar numbering will get out of step.
I also suggest bars that are empty or have no durational objects in them be excluded a la the way barlines explicitly excluded from numbering are handled. E.G. I often use a construct like this (the section immediately following the system break):
!NoteWorthyComposerClip(2.751,Single)
|Text|Text:"Bm7"|Font:User6|Pos:12
|Note|Dur:8th|Pos:-3|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:#-4|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-3
|Text|Text:"E7"|Font:User6|Pos:12
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
|Bar
|Text|Text:"Bm7"|Font:User6|Pos:12
|Note|Dur:8th|Pos:-3
|Note|Dur:4th|Pos:-3
|Note|Dur:8th|Pos:-2^
|Text|Text:"E7"|Font:User6|Pos:12
|Note|Dur:8th|Pos:-2
|Note|Dur:4th|Pos:-3
|Note|Dur:8th|Pos:-3
|Flow|Style:ToCoda|Pos:16|Justify:Right|Placement:AtNextNote
|Bar|Style:Double
|Text|Text:"Bm7"|Font:User6|Pos:12
|Note|Dur:4th|Pos:-4
|Note|Dur:4th|Pos:#-4
|Text|Text:"E7"|Font:User6|Pos:12
|Note|Dur:4th|Pos:-3
|Note|Dur:8th|Pos:-9|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-8^|Opts:Stem=Up,Beam=End
|Bar
|Text|Text:"A6"|Font:User6|Pos:12
|Note|Dur:Half|Pos:-8
|Text|Text:"E7"|Font:User6|Pos:12
|Rest|Dur:Half
|Flow|Style:DSalCoda|Pos:16.5|Justify:Right|Placement:AtNextNote
|Clef|Type:Treble|AutoSys:N|Visibility:Never
|Key|Signature:F#,C#,G#|Tonic:A|HideCancels:Y|AutoSys:N|Visibility:Never
|Bar|Style:Double|SysBreak:Y
|Boundary|Style:Gap|Width:200|SystemConnections:N
|Flow|Style:Coda|Pos:-2.5|Visibility:Always
|Boundary|Style:Gap|Width:600|SystemConnections:N
|Clef|Type:Treble
|Key|Signature:F#,C#,G#|Tonic:A
|Text|Text:"Bm7"|Font:User6|Pos:12
|Note|Dur:4th|Pos:-4
|Rest|Dur:4th
|Note|Dur:4th|Pos:#-4
|Rest|Dur:4th
|Bar
|Text|Text:"E7"|Font:User6|Pos:12
|Note|Dur:4th|Pos:-3
|Rest|Dur:4th
|Note|Dur:4th|Pos:-2
|Rest|Dur:8th
|Note|Dur:8th,Slur|Pos:0^
|Bar
|Text|Text:"A6"|Font:User6|Pos:12
|Note|Dur:4th,Slur|Pos:0
|Note|Dur:Half,Dotted|Pos:-1^
|Bar|SysBreak:Y
|Text|Text:"F#m"|Font:User6|Pos:12
|Marker|Pos:6.5
|Note|Dur:Whole|Pos:-1^
|Bar
|Text|Text:"D"|Font:User6|Pos:12
|Marker|Pos:0.5
|RestChord|Dur:Half|Opts:Stem=Down,ArticulationsOnStem,HideRest|Dur2:Whole|Pos2:-1^
|Text|Text:"Bm"|Font:User6|Pos:12
|Marker|Pos:0
|Rest|Dur:Half|Opts:VertOffset=-2000
|Bar
|Text|Text:"E7"|Font:User6|Pos:12
|Marker|Pos:0.5
|Note|Dur:4th,Dotted|Pos:-1^
|Text|Text:"A"|Font:User6|Pos:11.5
|Marker|Pos:4
|Note|Dur:8th|Pos:-1
|Rest|Dur:Half
!NoteWorthyComposerClip-End
I also use transparent bars to aid object placement and force system breaks with an open staff:
!NoteWorthyComposerClip(2.751,Single)
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:1
|Rest|Dur:4th
|Note|Dur:4th|Pos:-2
|Rest|Dur:4th
|Bar
|Note|Dur:Half|Pos:-9
|Note|Dur:4th|Pos:-6
|Rest|Dur:4th
|Bar
|Note|Dur:4th|Pos:-6
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-6^|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-6
|Bar
|TimeSig|Signature:2/4
|Bar|Style:Transparent|SysBreak:Y
|TimeSig|Signature:2/4
|Note|Dur:Half|Pos:-9
|Bar|Style:MasterRepeatClose
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:-6
|Rest|Dur:4th
|Rest|Dur:Half
!NoteWorthyComposerClip-End