Skip to main content
Topic: NonFlowBar.hmm (0.1) (Read 6026 times) previous topic - next topic

NonFlowBar.hmm (0.1)

As an answer to more complicated flows (see e.g. this thread), here is a simple object that draws certain bar lines so that they do not have any "repetition logic". A desired control flow can then be created with tricky "endings", as e.g. Rick has shown in the thread linked above.

For connecting to non-flow bars in the following staff, the staff's "Bars Connected" flag is used. For connection with the staff above, one must check the object's "Connect upwards" flag. There is currently no StaffSig version for this, so one has to do it on every instance of the object - that could be improved, but with copy/pasting the bars around, it should not be really necessary (or is it?).

The object does not have any "bar logic", so there will be no line breaks at it; or a change of the bar counter. If this is desired, one can add hidden single bars before or after the object.

The symbols do not line up with "real" bars, but as I cannot see that one would want "flow logic" on one (visible) staff and "non-flow" on others, this should not be a problem.

One tiny flaw: Back-to-back close and open local repeats do not line up properly with font types MusikDingsSerif and MusikDingsSans - but as local repeats are not used that often, I did not repair this ... could be improved.

Positioning of the bar symbols is done "by brute number force" - if there is a better, "more analytic" way, which is maybe more resilient to some size changes (I did not do much testing), someone let me know so that I can change it.

H.M.

Re: NonFlowBar.hmm (0.1)

Reply #1
I find surprising that the insertion point (anchor) for this plugin is on the right of the object.
Normally it is at the left. There's a reason for that?

Re: NonFlowBar.hmm (0.1)

Reply #2
Hm.

The "reason" is that "brute number force": The object has a width of 1.2 (not 0 as most objects), and it draws its bars 1.85...3 to the left of the leftmost point. The reason for these magic numbers is that by this, it aligns "somewhat" with standard bars. I just tried to reduce the width to 0; and/or move the bars more to the right, so the anchor would to the left of the symbol - both attempts garbled up the appearance in the edit mode (but not in the display mode = F11; and probably not when printing). So my answer is "that way, it seems to work; with other numbers, I couldn't make it work" ... not really satisfying, but I'm somewhat hesitant to invest more into this "maybe somewhat hepful" object ...

H.M.

Re: NonFlowBar.hmm (0.1)

Reply #3
When I reviewed the code before, I noticed that you were using a fixed width for the object.  It's possible to use the "width" hook to return the actual width, since nwcdraw.barSegment() returns the width of the bars drawn.

Edit: although that might be a bit tricky, now that I have experimented a bit.  During the "width" hook, you can't perform the nwcdraw.barSegment function, so there doesn't seem to be a way to return the width of the selected bar-line, outside of pre-calculating the widths and storing them in a static table.

 

Re: NonFlowBar.hmm (0.1)

Reply #4
Thanks, Mike. Your "Edit" is what happened to me ... so I just left it like it was, as this whole object is a workaround anyway, I'd say.

H.M.