Drawing extenders for the full duration of a note

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Drawing extenders for the full duration of a note

Lucas Werkmeister
Hi everyone,

I’m transcribing an old choral score for LilyPond (full source at [1]),
and while I’ve been mostly successful so far, one thing I haven’t
figured out yet is the extenders. In the original score, several notes
have extenders in the lyrics, to indicate the duration of the note
relative to the other voices, and those extenders span the full duration
of the note (see [2] for an example). This short snippet can be used to
test the behavior:

<<
  { c'1 r } \addlyrics { o __ }
  \relative c' { c8 d e f g f e d c4 g' c,2 }
>>

The second voice ensures a certain minimal width for the whole bar, and
I would like the extender in the lyrics for the first voice to span this
whole width, as that’s how long the note is. I can get close to this by
manually tweaking the LyricExtender’s minimum-length (if there’s no rest
after the extender, even setting it to +inf.0 works, it automatically
terminates at the next lyrics), but I’d prefer a solution that doesn’t
require eyeballing a close-enough value.

Cheers,
Lucas

[1]: https://github.com/lucaswerkmeister/il-est-bel-et-bon
[2]: https://i.imgur.com/9GQ0cJH.png

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Graham King-4
Lucas,
how about abusing a hidden grace note?  I can't guarantee that this kludge will be robust against future changes...

\version "2.19.82"

<<
 { \afterGrace 15/16 c'1 {\hideNotes c'16} R1 } \addlyrics { o __ }
 \relative c' { c8 d e f g f e d c4 g' c,2 }
>>

HTH,
-- Graham

On 17 Oct 2018, at 21:59, Lucas Werkmeister wrote:

> <<
>  { c'1 r } \addlyrics { o __ }
>  \relative c' { c8 d e f g f e d c4 g' c,2 }


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Vaughan McAlley
In reply to this post by Lucas Werkmeister
On Thu, 18 Oct 2018 at 08:01, Lucas Werkmeister <[hidden email]> wrote:
Hi everyone,

I’m transcribing an old choral score for LilyPond (full source at [1]),
and while I’ve been mostly successful so far, one thing I haven’t
figured out yet is the extenders. In the original score, several notes
have extenders in the lyrics, to indicate the duration of the note
relative to the other voices, and those extenders span the full duration
of the note (see [2] for an example). This short snippet can be used to
test the behavior:

<<
  { c'1 r } \addlyrics { o __ }
  \relative c' { c8 d e f g f e d c4 g' c,2 }
>>

The second voice ensures a certain minimal width for the whole bar, and
I would like the extender in the lyrics for the first voice to span this
whole width, as that’s how long the note is. I can get close to this by
manually tweaking the LyricExtender’s minimum-length (if there’s no rest
after the extender, even setting it to +inf.0 works, it automatically
terminates at the next lyrics), but I’d prefer a solution that doesn’t
require eyeballing a close-enough value.

Cheers,
Lucas

[1]: https://github.com/lucaswerkmeister/il-est-bel-et-bon
[2]: https://i.imgur.com/9GQ0cJH.png

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

And here's some more kludge, but it looks good, and MIDI should work. Replace

e1. r2

with

      \once \hide Tie e1.*2/3 ~
      \once \hide NoteHead
      \once \hide Stem
      \once \hide Tie
      e4.~ |
      \once \hide NoteHead
      \once \hide Stem e8 r2 |

Vaughan


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Kieren MacMillan
In reply to this post by Lucas Werkmeister
Hi Lucas,

> I’d prefer a solution that doesn’t require eyeballing a close-enough value.

Best Solution: Lilypond should have a switch/parameter to do what you’re asking (defaulting to ##f, to mimic current behaviour).

Next Best Solution: Someone could build a Scheme engraver that searches across all staves in the current system, and extends all LyricExtenders the correct amount.

Manual Solution: Use a NullVoice which holds the "extender-worthy" durations.

%%%%  SNIPPET BEGINS
\version "2.18.2"
\language"english"

upper = {
  c'1 1
}

lower = {
  c'8 d' e' f' g' f' e' d' c'4 g' c'2
}

extenders = {
  c'8( d' e' f' g' f' e' d') c'4 g' c'2
}

theLyrics = \lyricmode {
  a __
}

<<
  \new Staff <<
    \upper
    \new NullVoice = "extenders" \extenders
  >>
    \new Lyrics \lyricsto "extenders" \theLyrics
  \new Staff \lower
>>
% %%%  SNIPPET ENDS

Note that you could almost certainly use the tag system to build "extenders" out of existing variables/notes, thus avoiding the need for a whole separate, manually-created variable.

Hope this helps!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Kieren MacMillan
Hi Lucas,

> Note that you could almost certainly use the tag system to build "extenders" out of existing variables/notes, thus avoiding the need for a whole separate, manually-created variable.

e.g.

%%%  SNIPPET BEGINS
\version "2.18.2"
\language"english"

upper = {
  c'1
  R1
}

lower = {
  \tag #'extenders { c'8-\tag #'extenders-only -( d' e' f' g' f' e' d'-\tag #'extenders-only -) }
  c'4 g' c'2
}

theLyrics = \lyricmode {
  a __
}

<<
  \new Staff <<
    \new Voice = "notes"
        \removeWithTag #'extenders-only \upper
    \new NullVoice = "extenders"
        \keepWithTag #'(extenders extenders-only) << \upper \lower >>
    \new Lyrics \lyricsto "extenders" \theLyrics
  >>
  \new Staff \removeWithTag #'extenders-only \lower
>>
%%%  SNIPPET ENDS

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Lucas Werkmeister
Hi Kieren and Graham,

thank you both for your responses. Kieren, I really like the idea in
your suggestion – but it doesn’t seem to be a good fit for my situation:
while the tag solution is neat, in my case the ends of the extenders
align with different voices at different times (there are four voices in
total), so I would probably need some adventurous combination of
multiple tags, and it looks like this also requires me to keep both
voices (real and null) alive for most of the score even though the
extended notes only appear in a few places.

In the end, I went for a variation of Graham’s suggestion instead,
encapsulated in a music function:

extendedNote =
#(define-music-function
     (parser location note)
     (ly:music?)
   #{
    \afterGrace 15/16 $note { \once \hideNotes \absolute $note }
   #})


I needed a few iterations to work out the details ($note instead of
#note; make the grace note \absolute to avoid it adjusting the octave a
second time), but with this version I was able to just insert
\extendedNote before all the relevant notes and it worked out
automagically. You can see the full change I made on GitHub [1].

Thanks again for the help!
Cheers, Lucas

[1]:
https://github.com/lucaswerkmeister/il-est-bel-et-bon/commit/724cbd8d75cb97b5c7317f95474656f8d09bad7

On 20.10.18 18:23, Kieren MacMillan wrote:

> Hi Lucas,
>
>> Note that you could almost certainly use the tag system to build "extenders" out of existing variables/notes, thus avoiding the need for a whole separate, manually-created variable.
>
> e.g.
>
> %%%  SNIPPET BEGINS
> \version "2.18.2"
> \language"english"
>
> upper = {
>   c'1
>   R1
> }
>
> lower = {
>   \tag #'extenders { c'8-\tag #'extenders-only -( d' e' f' g' f' e' d'-\tag #'extenders-only -) }
>   c'4 g' c'2
> }
>
> theLyrics = \lyricmode {
>   a __
> }
>
> <<
>   \new Staff <<
>     \new Voice = "notes"
>         \removeWithTag #'extenders-only \upper
>     \new NullVoice = "extenders"
>         \keepWithTag #'(extenders extenders-only) << \upper \lower >>
>     \new Lyrics \lyricsto "extenders" \theLyrics
>   >>
>   \new Staff \removeWithTag #'extenders-only \lower
>>>
> %%%  SNIPPET ENDS
>
> Cheers,
> Kieren.
> ________________________________
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: [hidden email]
>

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

Lucas Werkmeister
On 23.10.18 19:11, Lucas Werkmeister wrote:

> In the end, I went for a variation of Graham’s suggestion instead,
> encapsulated in a music function:
>
> extendedNote =
> #(define-music-function
>      (parser location note)
>      (ly:music?)
>    #{
>     \afterGrace 15/16 $note { \once \hideNotes \absolute $note }
>    #})
>
> I needed a few iterations to work out the details ($note instead of
> #note; make the grace note \absolute to avoid it adjusting the octave a
> second time)

I only noticed another problem after sending this email: the invisible
grace note still affects the ambitus, and because it’s \absolute it can
be quite far away from the rest of the voice. I fixed that by using a
drum note instead of the argument $note for the grace:

extendedNote =
#(define-music-function
     (parser location note)
     (ly:music?)




   #{
     \afterGrace 15/16 $note { \once \hideNotes \drummode { bd } }




   #})

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

David Kastrup
In reply to this post by Lucas Werkmeister
Lucas Werkmeister <[hidden email]> writes:

> Hi Kieren and Graham,
>
> thank you both for your responses. Kieren, I really like the idea in
> your suggestion – but it doesn’t seem to be a good fit for my situation:
> while the tag solution is neat, in my case the ends of the extenders
> align with different voices at different times (there are four voices in
> total), so I would probably need some adventurous combination of
> multiple tags, and it looks like this also requires me to keep both
> voices (real and null) alive for most of the score even though the
> extended notes only appear in a few places.
>
> In the end, I went for a variation of Graham’s suggestion instead,
> encapsulated in a music function:
>
> extendedNote =
> #(define-music-function
>      (parser location note)
>      (ly:music?)
>    #{
>     \afterGrace 15/16 $note { \once \hideNotes \absolute $note }
>    #})
>
>
> I needed a few iterations to work out the details ($note instead of
> #note; make the grace note \absolute to avoid it adjusting the octave a
> second time),

That would not help if the absolute pitch does not agree with what you
need there.

You didn't bother specifying a \version statement, but the afterGrace
optional argument syntax is 2.19.47, so it seems safe to use 2.19.22
parser/location non-syntax.

\version "2.19.47"

extendedNote =
#(define-music-function (note) (ly:music)
  (make-relative (note) note
  #{ \aftergrace 15/16 $note { \once \hideNotes $note } #}))

At any rate, I was late in the discussion and have no clue what this is
about, but it's quite possible that you want \single \hideNotes rather
than \once \hideNotes here in order to definitely affect only that
single note.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Drawing extenders for the full duration of a note

David Kastrup
David Kastrup <[hidden email]> writes:

> You didn't bother specifying a \version statement, but the afterGrace
> optional argument syntax is 2.19.47, so it seems safe to use 2.19.22
> parser/location non-syntax.
>
> \version "2.19.47"
>
> extendedNote =
> #(define-music-function (note) (ly:music)
>   (make-relative (note) note
>   #{ \aftergrace 15/16 $note { \once \hideNotes $note } #}))

\afterGrace , of course.  Also if you use \single, you don't need { }
since \single \hideNotes $note is, well, a single music expression.

> At any rate, I was late in the discussion and have no clue what this is
> about, but it's quite possible that you want \single \hideNotes rather
> than \once \hideNotes here in order to definitely affect only that
> single note.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user