Hi Elaine,
I already do this. But this is not sufficient for creating the effect
necessary (as seen in the original example images). Frenching is
perfectly sufficient so long as the staffs are never in the same system.
But it does not enable the transition between the two to be done within
a system as found in the old vocal scores. This is why it is necessary
to do mid-system (i.e., usually, mid-measure) switches to the "group".
Best,
Daniel
On 8/3/21 9:54 PM, Flaming Hakama by Elaine wrote:
---------- Forwarded message ----------
From: "D. B. Miller" <[email protected]
<mailto:[email protected]>>
To: Jean Abou Samra <[email protected]
<mailto:[email protected]>>, LilyPond User Group
<[email protected] <mailto:[email protected]>>
Cc:
Bcc:
Date: Tue, 3 Aug 2021 19:45:07 +0000 (UTC)
Subject: Re: How do I do a transition between a grouped and a
non-grouped part (example attached)
Thanks Jean. This is quite useful. Unfortunately I'm not quite
sure how
to make it into the generalized solution I need. This works well if I
have a specific number of systems, and I know how many systems I will
need before turning on the grouping --- which causes problems if I
don't
want to break manually (which I try to avoid if possible).
Returning to
the solo also requires going to a new part with this. The mid-staff
bracket works well, though.
Maybe this is just beyond LP's current capabilities, at least when it
comes to things you don't have to do manually. Maybe a better
solution
could involve some sort of invisible staff (?) which is meant to
overlap
with the solo staff, or something else quite out there. Preferably I
would like a way to turn the grouping's visibility on and off, but I
can't see a way to do this via overrides in the music.
All the best,
Daniel
Jul 30, 2021 17:36:37 Jean Abou Samra <[email protected]
<mailto:[email protected]>>:
>
>
> Le 30/07/2021 à 14:46, Daniel Benjamin Miller a écrit :
>> Hi all,
>>
>> I want to replicate this feature, often found in manually-engraved
>> vocal scores. Although the feature I am talking about should be
>> obvious from the images, I will attempt to describe it.
Basically, the
>> staff group starts partway through a system, as we switch from
a solo
>> to a choral part. If necessary, another staff appears (filled with
>> rests as appropriate).
>>
>> I know it is possible to insert a [ bar manually (although I
cannot
>> quite figure out how to do this in a way that looks like a
staff group
>> across staffs). Since the staff grouping needs to continue in the
>> following systems, and since I don't want to manually break my
score,
>> I don't think that's a reasonable option either.
>>
>> The solution I have been trying to work out essentially involves
>> trying to having the systems all be part of the staff group,
but to
>> suppress the engraving of the staff group bracket where
appropriate
>> (or something like that?). Still, it's proven to be a bit too
>> intricate for me.
>>
>> Has anyone else done this? I know there are some of you who have
>> greater expertise, and I'm probably not the first person to at
least
>> try to include this element in a score.
>>
>> All the best,
>> Daniel
>
>
> Hi Daniel,
>
> Too bad that I can't find the snippet again -- anyway, here is a
> remixed version of a hacky piece of code I once wrote for the
> French list:
>
> \version "2.22.1"
>
> #(define add-bracket
> (grob-transformer 'stencil
> (lambda (grob original)
> (let* ((vag (ly:grob-object grob 'axis-group-parent-Y))
> (elts (ly:grob-array->list
> (ly:grob-object vag 'elements)))
> (system-start-delim
> (filter
> (lambda (g)
> (and (grob::has-interface g
> 'system-start-delimiter-interface)
> (not (eq? 'SystemStartBar (grob::name
g)))))
> elts)))
> (if (eqv? 1 (length system-start-delim))
> (ly:stencil-combine-at-edge
> original
> X
> LEFT
> (ly:grob-property (first system-start-delim)
> 'stencil)
> (ly:grob-property grob 'padding))
> (ly:warning "should have 1 delimiter, found ~a"
> (length system-start-delim)))))))
>
> forceBar =
> \context Timing \applyContext
> #(lambda (context)
> (if (null? (ly:context-property context 'whichBar))
> (set! (ly:context-property context 'whichBar)
> "")))
>
> midStaffBracket = {
> \forceBar
> \once \override StaffGroup.SpanBar.stencil = #add-bracket
> }
>
> \layout {
> \context {
> \StaffGroup
> % Padding added between the bracket and the bar in case they
> % are both present.
> \override SpanBar.padding = 0.8
> }
> }
>
>
>
> \new StaffGroup \with {
> %% Change the number of systems with no bracket at the beginning.
> \alterBroken transparent #(make-list 2 #t) SystemStartBracket
> }
> <<
> \new Staff {
> \repeat unfold 20 c'1
> c2 \midStaffBracket c2 \midStaffBracket
> \repeat unfold 79 c'1
> }
> \new Staff \repeat unfold 100 c'1
>>>
>
>
>
> (From a development perspective...)
>
> To enable doing this more properly, one would have to start out
> by making system start delimiters items rather than spanners. The
> use of \alterBroken is not super natural here, it's tripped up
> other before... Last time I looked, the problem was that in
> theory you can always take the X-extent and X-offset of an
> item before line breaking, and system start braces (as opposed
> to brackets) have a horizontal extent that depends on the amount
> of space between staves. So I wasn't very sure about the approach,
> but probably this could be picked up.
>
>
> Cheers,
> Jean
I''m not sure if you've explored this, but to me it sounds like you
should rather use frenched scores.
Which is to say, you will have 2 concurrent entities:
* A single staff (or a staffgroup with one staff),
* A staffgroup with 2 staves
When you want only the single staff, ensure that the staves in the 2nd
staffgroup are empty (contain only spacers)
When you want the double staff, ensure that the first staff is empty
(contains only spacers)
Then to get the frenched score, which will omit staves that are empty,
set \Staff \RemoveEmptyStaves in the \layout block.
If you can't get your line breaks exactly when you switch to/from
single to double staves,
you might need to have rests in those measures of the unused
staff/staves that appear, instead of spacers.
HTH,
Elaine Alt
415 . 341 .4954 "/Confusion is highly underrated/"
[email protected] <mailto:[email protected]>
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-