Automatic Staff/System Spacing

Discuss the rules of notation, standard notation practices, efficient notation practices and graphic design.
User avatar
jan
Posts: 69
Joined: 22 Jun 2016, 08:29

Automatic Staff/System Spacing

Post by jan » 07 Mar 2017, 12:18

I am currently experimenting with a plugin for automatic staff/system spacing (for Finale).

Do you have any suggestions, rules, work processes, ideas of what you would like to see in such a feature ?

Here is a short screencam video where 5 systems are spread out on a part's page taking into account the closest distance of notational elements between thoses systems (marked with a blinking x in the middle of the video) - a space-saving way of spreading systems in a part, if you can't have equal distances because of too many systems per page:
https://www.youtube.com/watch?v=wBziVOxWTnk
In a score it also takes into account group brackets (i.e. more space between staves if a group like brass, strings, etc. starts).
One use case is for example to automatically create a balanced look on a huge orchestra scorre with the maximum zoom factor. (i.e. to automatically estimate a good zoom factor first and then to spread the staves accordingly).

Any other suggestions ?

User avatar
odod
Posts: 133
Joined: 25 Nov 2015, 15:10

Re: Automatic Staff/System Spacing

Post by odod » 07 Mar 2017, 13:47

a little out of topic ..
but i would love to see the numeric notation plugin sir ? like automated music notes to numeric notation ..

like this one

https://www.youtube.com/watch?v=pyHguTEzkMw
LogicX, Cubase 5, MacMini i7, Macbook Pro 2015, PowerMac G5, Sibelius 8, Finale, Musescore, Reaper, Apogee Duet, Universal Audio Apollo Twin MKII, FontLab, tons of Faith and Prayers

Serenade Music Engraving Service

Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: Automatic Staff/System Spacing

Post by Knut » 07 Mar 2017, 13:48

This is a great idea.

While Finale's own Vertical Collision Remover doesn't work very well, like some aspects of it, so maybe you could draw from that?
I'm particularly thinking of the ability to specify how much space you'd want between the staves, groups and systems, which I think would be mandatory for such a plug-in.

To deliver good, reliable results, I also think you need to make some kind of hierarchy of the visual elements going beyond the staff. My workflow for manual staff spacing might give you one idea as to how to think about this:

My system margins are set to 0 by default, and then reset before doing the final layout according to the elements beyond the top or bottom staff line in the following ways:

- Tempo indications takes overall precedence, and if present, the system margin always aligns to the top of the tempo indication.
- The same thing goes for chord symbols if present.
- If a notehead is the top/bottom element, the respective system margin is usually aligned with it.
- For other elements (stems, slurs, articulations, staff expressions, dynamics and sometimes even noteheads) I usually set the margin to the center of elements. That is to say, between the top/bottom of absolute outermost element and top/bottom of innermost element relative to the elements beyond the stafflines.

In extreme situations, if there is a big difference in vertical space between the lowest/highest outer points, I increase the margins by eye.

The whole goal is to create a kind of bounding box between each system, which should be as visually balanced with regard to whitespace as possible.

Of course, when spacing staves in a score, you don't have the luxury of margins, so these have to be done completely by eye, but the principles are for me much the same as with system spacing; I don't simply space the staves evenly without any regard for the kind of elements on the page, but try to create the same kind of evenness between primary elements (usually noteheads), while delegating less space to slurs, expressions etc.

Hope this helps and is understandable

User avatar
jan
Posts: 69
Joined: 22 Jun 2016, 08:29

Re: Automatic Staff/System Spacing

Post by jan » 07 Mar 2017, 14:04

Thanks, Knut, that's good input!

>That is to say, between the top/bottom of absolute outermost element and top/bottom of innermost element relative to the elements beyond the stafflines.
Taking the example from the video, do I understand this correct ?
margins.jpg
margins.jpg (26.08 KiB) Viewed 2670 times

Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: Automatic Staff/System Spacing

Post by Knut » 07 Mar 2017, 14:47

Your bottom margin looks fine, but the top margin is too high; it should be centered between the A in m. 1 and the accent in m. 2.

The reason is the relatively large distance between the empty m. 3 and the top note in m. 2. Under more even circumstances, your top margin is also fine.

User avatar
jan
Posts: 69
Joined: 22 Jun 2016, 08:29

Re: Automatic Staff/System Spacing

Post by jan » 07 Mar 2017, 14:59

Ah ok, now I understand the sentence. Thanks!

Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: Automatic Staff/System Spacing

Post by Knut » 07 Mar 2017, 18:36

Jan,

What I wrote above isn't entirely accurate. I've been working too much with tablature recently, which has different considerations from a regular 5-line staff, seeing as there aren't any dynamics at the bottom of a tablature staff.

In normal cases, like in your example, I would set the bottom system margin to 4 sp. (not 0), which gives all staves a kind of blanket space available for dynamics and expressions below the system. This is very important, as anything else would easily make the spacing too uneven.

If necessary, this blanket space is increased (or in rare cases, decreased) if necessary to make room for low bass notes or other elements going beyond this 4 sp. margin.

Ideally, a plug-in should take the vertical distance between elements directly above/below each other into account, but somehow I doubt that this is possible, unless there is an equal number of measures on each system, and the horizontal spacing is relatively even.

Inevitably, I think you would have to leave the fine-tuning to the user, but one other thing which might be of value is to let the user specify which kind of elements should be included in the calculation. At least, I can see this being relevant for more subordinate elements like slurs and text expressions.

User avatar
jan
Posts: 69
Joined: 22 Jun 2016, 08:29

Re: Automatic Staff/System Spacing

Post by jan » 07 Mar 2017, 21:42

>Ideally, a plug-in should take the vertical distance between elements directly above/below each other into account, but somehow I doubt that this is
>possible, unless there is an equal number of measures on each system, and the horizontal spacing is relatively even.
Isn't this what happens in the video above ? The spacing there is ONLY calculated based on the distance between the closest elements directly above/below (i.e. the plugin looks for the shortest distance between the systems and inserts a predefined amount of space at this point). Or do you mean something else ?
Of course, it's more difficult to only integrate this as one of several parameters.
And indeed in the video the spacing is not optimal yet, so more parameters have to be taken into account. Your suggestions are a good starter.
Thanks, Knut.

Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: Automatic Staff/System Spacing

Post by Knut » 08 Mar 2017, 00:06

jan wrote:
07 Mar 2017, 21:42
>Ideally, a plug-in should take the vertical distance between elements directly above/below each other into account, but somehow I doubt that this is
>possible, unless there is an equal number of measures on each system, and the horizontal spacing is relatively even.
Isn't this what happens in the video above ? The spacing there is ONLY calculated based on the distance between the closest elements directly above/below (i.e. the plugin looks for the shortest distance between the systems and inserts a predefined amount of space at this point). Or do you mean something else ?
I'm sorry Jan, Systems 3 and 4 looked too close together at first glance, but you're right that this is exactly what the plug-in does. You're also absolutely right that following this principle alone is not enough to achieve a sufficiently good visual balance, but I believe this is an excellent starting point for a plug-in.

I guess this goes without saying, but you would certainly get a lot of useful info from physically measuring distances between systems and staves in well engraved published scores. When you're done, you could write a post about your observations. I'm sure everyone here would love to read it and discuss further. :)

Happy coding!

User avatar
jan
Posts: 69
Joined: 22 Jun 2016, 08:29

Re: Automatic Staff/System Spacing

Post by jan » 08 Mar 2017, 08:56

>Systems 3 and 4 look too close together
Yes, because the plugin currently only looks at the vertical distance between two elements.
If if it had taken the vertical distance as radius, it would have detected a closer collision (between p and the top left corner of the G box instead of between the slur and the top of the G box), and the bottom system would have probably gotten a more pleasing position a bit further down.
distance.jpg
distance.jpg (71.62 KiB) Viewed 2629 times

I think systems 2 and 3 from the video (image below) are too far apart and would have looked better if the calculation took into account some of your thoughts about the "center" of the top/below staff areas. There is only a rather small peak in the middle of the 3rd system ("F Grave") and at the very left ("E") which leads to a very large system distance. The wide hairpin on the top staff seems to be a "calm" element which could come a little closer to the other staff in this case.
systems2-3.jpg
systems2-3.jpg (70.41 KiB) Viewed 2626 times

Here are some more aspects from my observations:
- take into account the overall size of the surface area covered above/below staff

- does the area have single/multiple peaks or is it rather smooth ?

- calculating Knut's "center" would take into account the average of the surface area in relation to peaks (number of peaks, top peak height) which may shift the center if necessary. So the "center" is not the mathematical center of the area above/below the staff, but also dependent on single peaks.

- a certain minimum distance between the closest elements must not be undershot (not the vertical distance as in the video, but a circular or probably even slightly elliptic one which allows a closer distance if the elements are not on top of each other, but slightly shifted as in systems 3/4 in the video)

- if a system distance becomes much larger than other system distances (e.g. system 2/3 in the video), check if it can be made smaller:
If it is a rather smooth area (one system full of many high pitched notes with many ledger lines), it probably can't.
If it is an area with one or two (small) peaks only, it probably can be reduced a little (see system 2/3).
Depending on the type of the closest elements, the reduction of the distance can be more or less severe.

- aspects for reducing the system distance closer than minimum:
  • position of peaks: peaks on the edges (e.g. clefs) disturb less than peaks in the center. Or in other words: with peaks on the edges, the system can move closer together than with peaks in the center
  • type of elements on top/bottom: very small elements like stems or "calm" (flat) elements like hairpins, letter boxes or stafflines seem to be less sensitive when moving the systems closer than minimum distance
  • could the top elements of the bottom staff be taken as a bottom element of the top staff (e.g. dynamics on top of bottom staff could also be dynamic on bottom of top staff), then keep them a bit further apart
  • different elements ? If the closest elements are of the same kind (e.g. bottom dynamics collides with top dynamics), they may need to be slightly further apart to avoid confusion

Post Reply