Some random brainstorming thoughts…
Le 02/11/2021 à 22:50, Lukas-Fabian Moser a écrit :
[…]
- I'm not sure if "staff-group names with brackets" should be done as
a new Layout object / by a new engraver, or if this should be added to
the functionality of InstrumentName and the Instrument_name_engraver.
Conceptually, I was never really happy with the staff group names
being called InstrumentName's, but I have to admit it's convenient,
and for reasons of backwards compatibility, it should probably stay
that way.
It's likely that you will want a different padding default for GroupName
or whatever you want to call it. So I'd lean towards a new grob. On the
other hand, you could reuse the standard SystemStart* grobs for the
brackets, possibly adding a ‘light’ version of SystemStartBracket along
the way.
What I don't see clearly right now is what engraver should be
responsible for this job. The System_start_delimiter_engraver already
has a lot of logic for adding support between brackets; that would be
best reused rather than duplicated. On the other hand, it doesn't sound
right for clarity and configurability to have it create the GroupName
grobs. Perhaps you could split out the support functionality from
System_start_delimiter_engraver in a new engraver that would also handle
the support for these new kinds of system start delimiters? (I would
have to dig more deeply in the code to figure it out.)
- The ability to deal with the needs of multi-staff groups
specifically might make it reasonable to create a dedicated engraver
(Group_name_engraver?) that mimicks and extends the
Instrument_name_engraver. The context definitions of StaffGroups etc.
then could be changed such that only Staff (and TabStaff etc.)
contexts \consist the standard Instrument_name_engraver, whereas the
grouping contexts should have the Group_name_engraver.
Or just extend the Instrument_name_engraver to do what you want.
- Grouping staves visually by a bracketed instrument name means that
it might be reasonable not to have SystemStartBracket's etc. for the
same group. I think this is a good opportunity to add something I've
wanted for a long time, namely a staff grouping context that provides
_only_ logical grouping and has no hardwired visual grouping elements
(SpanBar, SystemStartBracket etc.), and from which StaffGroup and all
the other contexts should be derived. Maybe StaffCollection would be a
suitable name?
It may be more convenient to reuse the SystemStart* grobs for the group
names, possibly wrapping the delimiter and the group name in a
SystemStartNameGroup axis group (or however named) that would handle the
placement of both grobs via side positioning. Look at TrillPitchGroup in
the master branch for an example.
A StaffCollection context type may be separately desirable.
- Vertical ("rotated") printing of the Group Name should be available
as a boolean option, not depend on manual markup rotation.
Yes.
- The hard part seems to be horizontal spacing. Two layout options
come to mind which should both be supported: Staff names on the inside
("on the right"), group name with bracket on the outside ("on the
left"); and vice versa: group name with bracket on the inside ("on the
right"), and single staff names on the outside ("on the left"). These
pose different layout problems: For the first option, the machinery
creating the GroupName has to know the extents of all the single-staff
InstrumentNames. For the second option, the GroupName machinery has to
increase the padding for the single staff names. I'm not clear yet if
this requires a separate implementation of the two options.
I wouldn't expect it to be hard. The extent that matters is the combined
extent of the StaffSymbol grobs in all staves, not that of the
InstrumentName grobs, is it? There is no difference for this between the
two cases then. The conditional padding may be a little more tricky to
design a good interface for. Actually, this is one of the numerous
problems that would be solved by making system start delimiters and
instrument names breakable items…
- The first option wished for by Adam (horizontal alignment of all the
brackets) is very easy to implement; this is just a matter of fixed
paddings.
Only in the case where the regular instrument are on the outside. If
they are on the inside, the padding will be relative to them and they
have variable extents.
One way to handle it would be to make SystemStartNameGroup created by a
separate engraver that you could \remove in StaffGroup and \consists in
Score.
As Harm already stated that he won't have time to work on this for
now, I'd be happy to try my hands on this a bit.
Good luck!
Jean