On 2021-01-28 4:35 am, ebenezer wrote:
Hello everyone,

I have noticed that use of a custom percussion staff is different from
the manner in which one of the pre-defined percussion staves is used:

partBongo = \new DrumStaff \with {
  drumStyleTable = #bongos-style
} \staffBongo

... compared to ...

partPercCustom = \new DrumStaff \with {
  % -- drumStyleTable = #defPercCustom  % -- this doesn't work
} <<
  \set DrumStaff.drumStyleTable = #(alist->hash-table defPercCustom)
% -- works this way


Is this just the way it is, or am I missing something?

bongos-style (and its kin) are hash tables, which is what drumStyleTable expects. The documentation shows defining a custom drum style as an alist and then converting it to a hash table when you use it. An alternative would be to do the conversion when you define the style:

%%%%
\version "2.22.0"

custom-drum-style =
#(alist->hash-table
  '((bassdrum default "tenuto" -1)
    (snare diamond #f 0)
    (hihat cross #f 1)))

\new DrumStaff
\with { drumStyleTable = #custom-drum-style }
\drummode { bd4 hh8 8 sn2 }
%%%%


-- Aaron Hill

Reply via email to