This is my replacement for the original BarCounter.nw (https://forum.noteworthycomposer.com/?topic=9198.0) object, with a few extended features I found necessary on large scores. I'm very grateful to NWC for the initial code for this plugin, which I only extended at a few places:
- Hide the number at left margin: This is useful if a bar counter is used on a lower staff in a large (e.g. orchestral) score so that there are no numbers colliding with the vertical line connecting all staves at the left margin.
- Every n-th bar: Scores for marching bands often have numbers at every other bar (I found this also helpful in our choral scores); some scores are numbered at every fifth bar.
- Optional suffix: If a score's numbers must correspond with some existing voice or other scores, but e.g. a repeated section is expanded (e.g. to improve page handling; or for differing articulations), it is helpful to distinguish the now equally numbered bars somehow, e.g. with a suffixed "a".
- Excluded numbers: Sometimes numbers collide with other signs (crescendos in choral scores are notorious for that, as they are usually shown above the staves); easily dropping one or a few numbers can be helpful.
- Font: Font selector; default is "StaffBold".
- Scale: Label sizing in percent; default 100%.
- Last, but not least, this plugin honors the "Exclude From Bar Count" checkbox on bars.
The attached file shows a few demo cases and explains them. However, the real use of these feature can only be seen in larger scores. If someone is interested in such examples, please let me know.
Nice work! I have one small suggestion that would make the object even more versatile: rather than have a "Use Lyrics Font" checkbox, why not just add a "Font" dropdown, which defaults to StaffBold but can be set to any of the available fonts? And if you want to really go whole hog, you could add a "Text Scale (%)" parameter.
Keep up the great work!
Thanks Mike - I have rewritten it per your suggestion; and also (hopefully) fixed a numbering bug when a bar has both "Force System Break" and "Exclude From Bar Count" checked.
The plugin needed a tiny correction because of a bug; and the example score needed an update because it had some old fields in it. These changes bumped the version to 0.3.
I have encountered a small bug. I insert a "Boundary Change" to drop the start of the staff on the page. This is followed a couple measures in with a "Boundary Change Reset" to return to the staff default. The BarCounter is inserted as you would think, at the beginning. Occasionally, a measure number is skipped over, eg, the measure count goes form 7 to 9. It doesn't seem to be predictable. When I scroll slowly to find where the problem lies, everything looks normal until one final scroll arrow click causes all the measure numbers to vanish momentarily and then reset to the +1 values.
As a workaround, I found that if I immediately follow the "Boundary Change reset" with an additional instance of BarCounter, everything works perfectly. [Version 0.3}
"Mhm" - yes, I think I have seen something like that, but only once or twice. Do you have a score that has this problem so that I can look into it? Thanks for the workaround, in any case!
Hello there, HM. I've stripped down the score to just one failing instrument (the tuba, of course).
It's pretty straightforward. Hopefully, it will reliably fail for you, too.
I found an instance where the "workaround" also fails. BarCounter absolutely does not like to precede the MMR plugin in a measure. To correct the problem, I added an instance of BarCounter after each measure containing MMR (which worked). Experimenting, I moved the "workaround" back one measure (to avoid the MMR). Problem also went away. I adjusted the previous-posted failing score for illustration.