Skip to main content
Topic: ConnectBarlines.hmm (0.4) (Read 3926 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.


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).


Re: ConnectBarlines.hmm (0.4)

Reply #5
Hi Harald

I have just installed the connectbarlines object but it doesn't seem to work with a layered choral score where the SA are layered together and the TB are layered together. I get one longer line for the women and men but it doesn't connect up. Do you know what I am doing incorrectly?


Re: ConnectBarlines.hmm (0.4)

Reply #6
The ConnectBarlines does not like layered staves, that's true - because it works on each staff separately and cannot do a "common height computation".
If you attach your score (or part of it) to your score (or send it via a personal message), I can look what we could do to make it look as you want it ...


Re: ConnectBarlines.hmm (0.4)

Reply #7
This is just a guess, but I would like to suggest a short-term workaround: for your layered staves, make sure that the upper and lower margins are the same for each staff in the same layer. That way, the ConnectBarLines object should draw things correctly.

Re: ConnectBarlines.hmm (0.4)

Reply #8
I do this a a matter of course - maybe a bit OCD I suspect... ;)
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: ConnectBarlines.hmm (0.4)

Reply #9
I guess one for the wishlist - or maybe it is already here and I just don't know -

It would be nice to select several systems and set the properties at one time, rather than select each system on its own, and repeat the effort for each one.

Re: ConnectBarlines.hmm (0.4)

Reply #10
I realized that there is a separate setting for which stave I am adding the Connectbarlines to...when I corrected that, then the barlines were the correct length (or Height, I guess). I just put them at the second last bar to get the final connection.

I'm not sure if it's always needed. I just grabbed a handful of recently published choral scores and none of them had it. It is nice to have the option though.

When would you use it in the middle of a piece?

What are your thoughts on the necessity of it? I haven't checked BB yet. I asked my composition prof and she said that it was ok to not use it.


Re: ConnectBarlines.hmm (0.4)

Reply #11
It is not standard notation - in standard choral scores, the staves are not connected at the right side.

However, I have seen a few scores with this notation, and it helped (me) quite a lot for quickly seeing the structure - especially in the (rare) occasions where I conduct a choir and/or - even more - during rehearsals: Quickly going back a few measures over a line break and then immediately seeing which staff is e.g. the tenors ("you had an f there in measure 22, not an a!") is easier if the staves are also connected at the right side.

In the beginning, I also connecte double bars and repeat bars in the middle of a line - but I avoid it now, because it does not help that much and is somehow "unexpected" ...

The plugin can get tricky to use e.g. if a start-to-repeat barline is exactly at the line break - it wants to draw parts of the mark also before the line break. I sometimes have to use a simple barline before the repeat bar, in some cases even with a spacer in between, to make it work then ... and it gets weird if the upper and lower limits of the staves change (e.g. when lyrics require it). I give up in such cases and revert to standard notation without connected bar lines at the line ends ...