Re: Custom percussion style is ignored for the first note when it is a grace note

Thomas Morley <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <CABsfGyVNdOF-5418pgEWmNXp7wXa-VpZnivfgK7xeV9=nbMFGg@mail.gmail.com>
Am Mi., 25. Jan. 2023 um 17:54 Uhr schrieb David Kastrup <[email protected]>:
>
> Stu McKenzie <[email protected]> writes:
>
> > There seems to have been various reports of bugs when the first note
> > is a grace note, but this bug has been in many LilyPond versions to
> > date.
> >
> > When the first note of a drum score has a grace note, LilyPond outputs
> > the default note, rather than the custom percussion style.
> >
> > In this case, \acciaccatura is used to create each grace note - main
> > note combination.
> >
> > Here's a "Tiny example":
> >
> > \version "2.24.0"
> > #(define mydrums '( (hightom default #f 3)))
> > \score {
> >   \new DrumStaff <<
> >     \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
> >     \new DrumVoice { \voiceTwo \drummode { \partial 2 \acciaccatura
> > tomh8 tomh4 \acciaccatura tomh8 tomh4 } }
> >   >>
> > }
>
> This is not a bug.  You specify you _want_ simultaneous music by using
> << ... >> and the settings of DrumStaff.drumStyleTable are performed
> _on_ the beat while the grace notes are performed _before_ the beat.
>
> This is _exactly_ as you tell LilyPond you want things to happen.  If
> you want to have things to happen in sequence, you have to write them in
> sequence.
>
> Using { ... } instead of << ... >> here probably gives something closer
> to your expectations.
>
> Now for things that _pervade_ a context rather than switch around, it
> makes sense not to set them at the first time step but generally, by
> using a \with block:
>
> \version "2.24.0"
> #(define mydrums '( (hightom default #f 3)))
> \score {
>   \new DrumStaff \with { drumStyleTable = #(alist->hash-table mydrums) }
>   {
>     \new DrumVoice { \voiceTwo \drummode { \partial 2 \acciaccatura tomh8 tomh4 \acciaccatura tomh8 tomh4 } }
>   }
> }
>
> --
> David Kastrup
>

It's unfortunate that we provide an example like:

\new DrumStaff <<
  \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
  \new DrumVoice { \voiceOne \up }
  \new DrumVoice { \voiceTwo \down }
>>

as first code example in NR 2.5 Percussion Custom percussion staves.

I've put up https://gitlab.com/lilypond/lilypond/-/merge_requests/1822
to fix the docs

Cheers,
  Harm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.