lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing single drums-style entry


From: Thomas Morley
Subject: Re: Changing single drums-style entry
Date: Sat, 31 Mar 2012 00:54:16 +0200

Am 30. März 2012 08:40 schrieb lesmondo <address@hidden>:
> Hi,
>
> I'm trying to alter the triangle entry in drums-styles.
>
> I've read through the manual and created the new style in a new list.
>
> #(define mydrums '(
>
> (triangle doThin #f 6)
>
> ))
>
>
> This gives me the correct output for my new triangle.
>
> However, I don't want to copy the entire drums-style list, just modify a
> single entry.  I found this message:
>
>
> http://lists.gnu.org/archive/html/lilypond-user/2009-02/msg00287.html
>
>
> about changing the hash set entry in the existing drums-style but I'm now
> stuck on what the actual syntax should be. I tried
>
>
> #(hashq-set! drums-style 'triangle '(doThin 6 0))
>
>
> but this didn't work.
>
> Thanks
>
> Les

Hi,

try:

\version "2.14.2"

changeDrumStyleTable =
#(define-music-function (parser location)()
  (make-music 'ApplyContext
              'procedure
              (lambda (x)
         (let* ((ctx (ly:context-property-where-defined x 'drumStyleTable))
                (dr-st-tab (ly:context-property ctx 'drumStyleTable)))
         (hashq-set! dr-st-tab 'triangle '(doThin #f 6))
  ))))

%--- Test

mus = \drummode {
        bd4  sn  bd toml8 tri
        bd ssh ss ssl  sna sn hh hh
        hhc4 r sn tri
}

\new DrumStaff { \changeDrumStyleTable
        \mus
        <<
        \new DrumVoice { \voiceOne \mus }

        \new DrumVoice { \voiceTwo \mus }
        >>
}


HTH,
  Harm



reply via email to

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