On Thu 30 Jan 2025 at 09:13:42 (-0800), Stu McKenzie wrote:
> On 2025-01-29 03:55, Valentin Petzel wrote:
> > 
> > > I sometimes add sticking to drum scores to assist readers by showing the
> > > preferred hand for each stroke.
> > > 
> > > I'm aware of the ability to change the horizontal position of lyrics
> > > using '\override LyricText.self-alignment-X'.
> > > 
> > > When I use '= #LEFT', the lyric is under the notehead, rather than the 
> > > stem.
> > > 
> > > When it comes to sticking, and when the vocalist is a drummer, I'd like
> > > to see the lyrics further left, i.e. right below the stem.  Is there a
> > > tweak that will provide that?
> > Lyrics are generally aligned to the PaperColumn, not to the Notes, unless 
> > you
> > set an associated voice, in which case they are aligned to the associated 
> > note
> > columns.
> > 
> > So the cleanest solution would be to first align the Lyrics to a Voice:

[ snipped the code ]

> Thank you for the reply and the score Valentin.
> 
> I processed the content and the result doesn't have the sticking under
> the stems of the notes.
> 
> The first bar is slightly to the left of the stem, and the second bar
> is to the right of the stem.
> 
> Here's the output generated:

[ snipped the blurry PNG with some aliasing problems ]

They do say "Careful what you wish for!"

But I think your eye may be being fooled by the optical effects
of the letter shapes, coupled with the stem attachments being
on opposite sides for up and down stems.

A small vertical adjustment in Valentin's snippet, rendered as
a PDF (which you can magnify arbitrarily), clearly shows that
you got what you wished for. (You can take a ruler to that.)

> I managed to get the output that I want using:
> 
> Sticking = \lyricmode {
>   \override Lyrics.LyricText.font-series = #'bold
>   \override LyricText.self-alignment-X = #RIGHT
> 
>   \repeat unfold 4 { R8 L }
> }

That's good (though not what you asked for).

> For Lyrics with more than 1 character using:
> 
> Lyrics = \lyricmode {
>   \override Lyrics.LyricText.font-series = #'bold
>   \override LyricText.self-alignment-X = #-0.8
> 
>   \repeat unfold 4 { Right8 Left }
> }

This is where self-alignment comes into its own, for
the conventional treatment of melisma etc. But you don't
say whether it's satisfactory for you. It looks rather
odd under a single unbeamed note.

Cheers,
David.
% Drums
Drums = \drummode {
   \repeat unfold 8 sn8
   \stemUp
   \repeat unfold 8 bd8
}

% Sticking
Sticking = \lyricmode {
   \override Lyrics.LyricText.font-series = #'bold
   \override Lyrics.LyricText.before-line-breaking =
   #(lambda (g)
      (let* ((note-column (ly:grob-parent g X))
             (stem (ly:grob-object note-column 'stem)))
        (if (ly:grob? stem)
            (ly:grob-set-parent! g X stem))))
   \override Lyrics.LyricText.self-alignment-X = #CENTER
   \override Lyrics.LyricText.self-alignment-Y = #DOWN

   \repeat unfold 4 { R L }
 %%\repeat unfold 4 { R L }
}

\score {
  \new OneStaff {
  <<
    \new DrumStaff \new DrumVoice = "Drums" { \voiceTwo \Drums }
    \new Lyrics \lyricsto "Drums" {
      \override Lyrics.LyricText.extra-offset = #'(0 . -1.5) \Sticking
      \override Lyrics.LyricText.extra-offset = #'(0 . 0.0) \Sticking
    }
  >>
  }
}

Attachment: valentin.pdf
Description: Adobe PDF document

Reply via email to