Skip to main content

Topic: ConnectBarlines.hmm (0.4) (Read 779 times) previous topic - next topic

ConnectBarlines.hmm (0.4)
Problem: In a choral score, you do not want bar lines connecting the staffs, because they interfere with the lyrics. But you want connected bar lines at the end of the staffs, as they help to group the staffs optically. Also, sometimes (e.g. at double bars or at a repetition), you need connected bars in between. See the attached pdf from Durante's Magnificat for an example.

Solution: Unselect "Bars Connected" for all staffs; and use this plugin to connect the bars at each line end and at specific places.

Details: Based on @Lloyd 's simple "ConnectBarlines" code, I have now written a user plugin that connects barlines automatically and with the correct lengths even in the presence of boundary objects that change the size or collapse staffs. The object can be used in two modes:

  • StaffSig - in this mode, the bar line at the end of each printed staff is connected up with the lines below/and or above (as indicated by the selector "Staff Location" with values "Top/Middle/Bottom Staff");
  • Standard - in this mode, the next bar line is connected.

For connecting bars to collapsing staffs, there is a flag "Active after next break" which mimicks the behavior of a "Boundary collapse" (which also collapses the staff after the next break). It's a little hard to explain - the demo score shows how it is used.

The demo score added is a "synthetic example" that shows all the features - it has no musical relevance whatsoever (as it does not contain a single note ...).
Of course, the plugin will automatically connect bars at NWC's automatic line breaks - you do not need a "line break staff" in your score as in the example (I only added it to produce a deterministic behavior for the collapsing section).

Thanks to
- @Lloyd for giving the initial basic solution to my problem; and encouraging the development along the way;
- @Mike for explaining the two iterator types - with that, it suddenly made "click" in my mind how I could do what I wanted;
- NWC, which has an interesting API that makes things possible and even not too difficult I didn't think would be possible.

I have also uploaded a .zip of all the test cases, for anybody who wants to modify the code and needs tests. In each test, it is expected that exactly the double bars are extended; and those going down from the first test staff must extend exactly to the "ending" line marking the boundary of the staff below.

  • Last Edit: 2017-09-19 06:59 pm by hmmueller

  • Lloyd
  • NWC2 User
Re: ConnectBarlines.hmm
Reply #1
Great Harald, great!!!
This is a good new add-on to NWC, good job!!
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: ConnectBarlines.hmm (0.2)
Reply #2
I uploaded a version 0.2 where the help text does not contain the test case descriptions.


Re: ConnectBarlines.hmm (0.3)
Reply #3
... and 0.3 - which fixes a bug with boundaries with an unchecked Lower/Upper checkbox.


Re: ConnectBarlines.hmm (0.4)
Reply #4
0.4 corrects a serious bug when other StaffSig objects are around - especially a Melismatic (which would by typical in choral scores).