lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax for multiple slurs per Voice?


From: Trevor Bača
Subject: Re: Syntax for multiple slurs per Voice?
Date: Tue, 1 May 2018 19:49:44 -0500

On Mon, Jul 31, 2017 at 5:29 PM, Trevor Bača <address@hidden> wrote:
Hi David,

On Thu, Jul 27, 2017 at 8:11 PM, David Nalesnik <address@hidden> wrote:
Hi Trevor,

On Thu, Jul 27, 2017 at 8:38 AM, Trevor Bača <address@hidden> wrote:
> Hi David (Nalesnik),
>
> On Tue, Oct 20, 2015 at 11:49 AM, David Nalesnik <address@hidden>
> wrote:
>>
>> Hi Trevor,
>>
>> On Tue, Oct 20, 2015 at 11:31 AM, Trevor Bača <address@hidden>
>> wrote:
>>>
>>> Hi,
>>>
>>> I'm coming late to this discussion, but potentially *very* excited about
>>> what this might mean. Will the available of spanner IDs mean that a single
>>> voice will (eventually) be able to carry multiple *text spanners*???
>>>
>>> This would be incredibly useful in my own scores (and probably also in
>>> the scores of very many other composers who work with simultaneous
>>> continuous transitions). I've attached a PNG of an example from a recent
>>> cello piece. The score is in LilyPond, but the engraving required multiple
>>> (redundant) invisible markup voices. Would be so elegant to be need only a
>>> single voice.
>>>
>>>
>>
>> I recently rewrote Text_spanner_engraver, incorporating 'spanner-id to
>> allow an unlimited number of TextSpanners per voice.  The entry method isn't
>> particularly pretty (basically it's equivalent to what you had to do with
>> slurs before David Kastrup came up with the current solution).
>>
>> I'd like to get this into the codebase, but I'm unsure if I need to port
>> it to C++.  Also, there's a chance another engraver to bind the simultaneous
>> spanners might be needed (as piano pedal lines are bound by an alignment
>> engraver).
>>
>> Attached is a more recent version than the one found here:
>> http://www.mail-archive.com/lilypond-user%40gnu.org/msg105470.html
>>
>> Hope this helps!
>
>
>
> I'm (finally!) working at integrating your alternateTextSpannerEngraver. My
> testing so far shows that it allows for very much of what I'm looking for
> (ie, multiple text spanners overlapping each other in a single voice).
>
> Two questions:
>
> 1. Is the version you attached as "text-spanner-id.ly" (way back in October
> 2015!) still the most recent version of your work?

Ugh -- I was going to say that a (perhaps) more current version is on
GitHub, but I seem to have never created a repository for it...  Old
age.

So I guess your version is the newest :(

Let me know if you run into any difficulties, and I'll be happy to
create that newer version.

Ok, great. Thanks very much; that was the confirm I was looking for. I'll let you know how integration goes.

Thanks!


Hi David (after almost a year!),

I'm finally finishing my integration of your alternateTextSpannerEngraver, and it's really exciting to finally be able to layer a bunch of parametric information in a single voice; this has been a tool missing from my LilyPond toolkit for many years! I have a few questions remaining, all concerning the vertical positioning of simultaneous text spanners. I've been working with modifications of your original example: text spanner "0" always appears in red; text spanner 1 always appears in green. Questions appear inline to the example sequence:

%%% BEGIN EXAMPLE #1 %%%

\version "2.19.80"
\include "text-spanner-id.ily"

\layout {
    \context {
        \Voice
        \remove Text_spanner_engraver
        \consists \alternateTextSpannerEngraver
    }
}

\relative c' {
    \override TextSpanner.style = ##f
    \override TextSpanner.thickness = 10
    \override TextSpanner.outside-staff-padding = 1.5

    a4
    -\tweak color #red
    \startTextSpan
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpan
    \stopTextSpanOne

    a
    b
    c
    d

    a
    -\tweak color #green
    \startTextSpanOne
    -\tweak color #red
    \startTextSpan
    b
    c
    d
    \stopTextSpan
    \stopTextSpanOne
}

%%% END EXAMPLE #1 %%%


QUESTION 1: In the output above, the first instance of (red) spanner 0 appears *above* (green) spanner 1; the second instance of (red) spanner 0 appears *below* (green) spanner 1. This is as I would expect. So is it true, in the general case, that the vertical stacking of simultaneous spanners is controlled by the lexical order in which the \startTextSpan commands appear in the LilyPond input file? Specifically, that lexically earlier \startTextSpan commands produce vertically higher text spanners?

The next examples concern manipulating the vertical stacking of spanners that start at the same time.

Example #2 produces what I would expect ...

%%% BEGIN EXAMPLE #2 %%%

\version "2.19.80"
\include "text-spanner-id.ily"

\layout {
    \context {
        \Voice
        \remove Text_spanner_engraver
        \consists \alternateTextSpannerEngraver
    }
}

\relative c' {
    \override TextSpanner.style = ##f
    \override TextSpanner.thickness = 10
    \override TextSpanner.outside-staff-padding = 1.5

    a4
    -\tweak color #red
    \startTextSpan
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpanOne

    a
    b
    c
    d

    a
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpan
    \stopTextSpanOne
}

%%% END EXAMPLE #2 %%%


... specifically, that (red) spanner 0 "supertends" both appearances of (green) spanner 1.

So far so good.

And example #3 also produces what I expect ...

%%% BEGIN EXAMPLE #3 %%%

\version "2.19.80"
\include "text-spanner-id.ily"

\layout {
    \context {
        \Voice
        \remove Text_spanner_engraver
        \consists \alternateTextSpannerEngraver
    }
}

\relative c' {
    \override TextSpanner.style = ##f
    \override TextSpanner.thickness = 10
    \override TextSpanner.outside-staff-padding = 1.5

    a4
    -\tweak color #red
    \startTextSpan
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpanOne

    a
    b
    c
    d

    a
    -\tweak color #green
    -\tweak staff-padding 7
    \startTextSpanOne
    b
    c
    d
    \stopTextSpan
    \stopTextSpanOne
}

%%% END EXAMPLE #3 %%%

... specifically that the second appearance of (green) spanner 1 is pushed up above (red) spanner 0 via the staff-padding tweak. Which is great. Super important for the layout of my scores.

However, example #4 produces seems to contradict this behavior ...

%%% BEGIN EXAMPLE #4 %%%

\version "2.19.80"
\include "text-spanner-id.ily"

\layout {
    \context {
        \Voice
        \remove Text_spanner_engraver
        \consists \alternateTextSpannerEngraver
    }
}

\relative c' {
    \override TextSpanner.style = ##f
    \override TextSpanner.thickness = 10
    \override TextSpanner.outside-staff-padding = 1.5

    a4
    -\tweak color #red
    \startTextSpan
    -\tweak staff-padding 7
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpanOne

    a
    b
    c
    d

    a
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d
    \stopTextSpan
    \stopTextSpanOne
}

%%% END EXAMPLE #4 %%%
... because it appears that it is not possible to tweak the staff-padding of (green) spanner 1 *independently of* the staff-padding of (red) spanner 0 in the case that both spanners start at the same moment. This is work-around-able, but it leads to the following question:

QUESTION 2: In the case that two text spanners begin at the same moment, what constraints restrict the relative vertical positioning of the two spanners? (Because they evidently can not be positioned completely independently.)

Last, testing revealed a case I can't explain:

%%% BEGIN EXAMPLE #5 %%%

\version "2.19.80"
\include "text-spanner-id.ily"

\layout {
    \context {
        \Voice
        \remove Text_spanner_engraver
        \consists \alternateTextSpannerEngraver
    }
}

\relative c' {
    \override TextSpanner.style = ##f
    \override TextSpanner.thickness = 10
    \override TextSpanner.outside-staff-padding = 1.5

    a4
    -\tweak color #red
    \startTextSpan
    -\tweak color #green
    \startTextSpanOne
    b
    c
    d

    a
    \stopTextSpan
    b
    \stopTextSpanOne
    -\tweak color #red
    \startTextSpan
    c
    -\tweak color #green
    \startTextSpanOne
    d

    a
    b
    c
    d

    a1
    \stopTextSpan
    \stopTextSpanOne
}

%%% END EXAMPLE #5 %%%
QUESTION 3: In example #5, why does the second appearance of (green) text spanner 1 appear *above* (red) text spanner 0? None of the previous tests would seem to indicate that this should happen: the second appearance of (green) text spanner 1 appears lexically after all the other spanner starts, and no explicit vertical tweaks should override whatever the stacking defaults are.

Ok, thanks once again very sincerely for your work integrating spanner ID into text spanners. It's difficult to explain how essential a gap this fills for me in my day-to-day LilyPond usage. If you have time to address any of the (lengthy) questions above, that would really cement my new use of the engraver!

Trevor.

--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]