lilypond-user
[Top][All Lists]
Advanced

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

Re: Intended use of the empty chord <> construct


From: David Kastrup
Subject: Re: Intended use of the empty chord <> construct
Date: Wed, 02 May 2018 01:04:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Trevor Bača <address@hidden> writes:

> I recently discovered the empty chord <> construct. From some initial
> tests, it looks like <> might solve a small handful of very difficult
> spanner-termination cases I've been wrestling with for years.
>
> Before I go further, I'd like to check my understanding of <> and how it
> works:
>
> [2. For the developers: is <> intended to remain a part of LilyPond
> distributions for the longterm, ie, on the order of years? I assume the
> answer is yes, but I want to check, given the low profile of the construct
> in the docs.]

It's not a special construct but just a chord without notes.  It might
be conceivable that at some point of time giving it a duration might get
a warning or complaint because in <>4 the duration is actually being
ignored.  Well, apart from setting the default duration.

> The summary in #3 seems to be what my tests are showing me. But given that
> <> appears, somehow, to format symbols at a just-future point beyond the
> current moment *while also NOT advancing musical time*, I want to make sure
> I'm not missing something obvious. No other LilyPond construct would appear
> to behave quite this same way.

s1*0 is pretty much the same but it messes with the current default
duration and that can lead to ugly surprises later on.  For example
because \addlyrics with lyrics all having a length of 0 is going to look
rather bad and people don't expect the default duration to have any
effects on \addlyrics content.  And it doesn't for non-zero lengths.

> musicA = {
>     a'4 \startTrillSpan
>     a' \stopTrillSpan
> }
>
> musicB = {
>     b'4
>     b'
> }
>
> \new Staff {
>     \set Score.proportionalNotationDuration = #(ly:make-moment 1 12)
>     \musicA
>     \musicB
> }
>
> %%% END EXAMPLE #1 %%%

[...]

> However, the empty chord <> construct appears to allow for a fully semantic
> way of encoding exactly what I'm looking for:
>
> %%%  BEGIN EXAMPLE #3 %%%
>
> \version "2.19.80"
>
> musicA = {
>     a'4 \startTrillSpan
>     a'
>     <> \stopTrillSpan
> }
>
> musicB = {
>     b'4
>     b'
> }
>
> \new Staff {
>     \set Score.proportionalNotationDuration = #(ly:make-moment 1 12)
>     \musicA
>     \musicB
> }
>
> %%% END EXAMPLE #3 %%%
>
> (The output is the same as #2.)
>
> To me, this is like magic: the empty chord <> appears to afford the
> ability to say "here's a chunk of music of two As with a trill spanner
> covering both" by appealing to the notional understanding I introduced
> at the top of this mail: the empty chord functions as an
> 'anchor-yet-to-come' to which the trill's endpoint can attach **even
> without knowing what that upcoming note / rest / chord is going to
> be**.
>
> I hope somebody else finds this (admitted corner case of a use) as
> special as I do. And, hopefully, I'm not misusing the purpose of the
> <> construct in setting up externalized variables in this way.

Let me quote from the Notation Reference ("Chorded notes"):

   A chord acts merely as a container for its notes, its articulations
and other attached elements.  Consequently, a chord without notes inside
does not actually have a duration.  Any attached articulations will
happen at the same musical time as the next following note or chord and
be combined with them (for more complex possibilities of combining such
elements, see *note Simultaneous expressions::):

     \relative {
       \grace { g'8( a b }
       <> ) \p \< -. -\markup \italic "sempre staccato"
       \repeat unfold 4 { c4 e }  c1\f
     }

     [image]

-- 
David Kastrup



reply via email to

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