lilypond-user
[Top][All Lists]
Advanced

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

Re: combine different note heads (drumset)


From: Thomas Morley
Subject: Re: combine different note heads (drumset)
Date: Sun, 22 May 2016 12:07:36 +0200

2016-05-22 10:34 GMT+02:00 Daniel E. Moctezuma <address@hidden>:
> Hello,
>
> I would like to define a note head type (or modify/tweak an existing one) 
> that uses a combination of 2 existing note heads from the Feta font.
> I'm trying to use the notation proposed by Norman Weinberg in his book Guide 
> to Standardized Drumset Notation.
>
> Hi-Hat and Cymbals for instance use both Cross and Diamond shape note heads 
> as follows:
> 1. Half-note and whole-note use a diamond, very similar to s0miThin except 
> the height of s0miThin is kind of short.
> 2. Quarter-note and below use a cross shaped note-head such as s2cross.
>
> I did manage to make Lilypond show the above note heads accordingly using 
> tweaks.
> The disadvantage is that in order to achieve the desired result I would have 
> to do something like "\customDiamond cymc2" every time I have to input half 
> or whole notes.
> So I'm looking for an easier way to input those kind of notes as well as to 
> support chords.
>
> In the following sample code you can see how modifying the stencil can give 
> you somewhat what I'm looking for, but here are some concerns:
> 1. It doesn't work when using chords (for example: hitting the crash cymbal 
> and the snare drum at the same time).
> 2. When using s0miThin noteheads the stem is not conected to the diamond's 
> left vertex.
>
> Maybe a better approach could be, instead of the "cross" note head defined in 
> "mydrums" drum style table could be something like "crossdiamond" so it can 
> include the above mentioned note heads.
> Probably just modifying the existing "cross" notehead could be enough since 
> Weinberg's book doesn't mention any usage of both s0cross and s1cross.
>
> Do you have any ideas on how to achieve something like this, as well as to 
> fix the above 2 points mentioned?
>
> Sample:
>
> \version "2.18.2"
>
> #(define mydrums '(
>          (crashcymbal cross #f 6)))
>
> % Based on: 
> https://www.mail-archive.com/lilypond-user%40gnu.org/msg108679.html
> #(define (my-note-head grob)
>   (let ((duration (ly:grob-property grob 'duration-log)))
>    (if (>= duration 2)
>     (grob-interpret-markup grob
>      (markup #:musicglyph "noteheads.s2cross"))
>     (grob-interpret-markup grob
>      (markup #:scale (cons -0.65 1.2)
>              #:musicglyph "noteheads.s0miThin")))))
>
> \new DrumStaff <<
>   \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
>
>   \drummode {
>     \cadenzaOn
>     \autoBeamOff
>     \override NoteHead.stencil = #my-note-head
>     cymc32 cymc16 cymc8 cymc4 cymc2 cymc1 \bar "|."
>   }
>>>
>
> --
> Best regards


Maybe:

\version "2.18.2"

#(define mydrums '(
         (crashcymbal cross #f 6)
         (snare () #f 1)))

#(define (my-note-head grob)
  (let ((duration (ly:grob-property grob 'duration-log))
        (drumtype
          (ly:prob-property (ly:grob-property  grob 'cause) 'drum-type)))
  (if (eq? 'crashcymbal drumtype)
      (if (>= duration 2)
          (grob-interpret-markup grob
             (markup #:musicglyph "noteheads.s2cross"))
          (begin
            (let ((stem-attachment (ly:grob-property grob 'stem-attachment)))
              (ly:grob-set-property! grob 'stem-attachment
                (cons (car stem-attachment) 0))
              (grob-interpret-markup grob
                 (markup #:scale (cons -0.65 1.2)
                         #:musicglyph "noteheads.s0miThin")))))
      (ly:note-head::print grob))))

\new DrumStaff
  \with {
    drumStyleTable = #(alist->hash-table mydrums)
    \override NoteHead.stencil = #my-note-head
  }
  <<
    \drummode {
      \cadenzaOn
      \autoBeamOff
      cymc32 cymc16 cymc8 cymc4 cymc2 cymc1 \bar "|." \break
      <sn cymc>32 <sn cymc>16 <sn cymc>8 <sn cymc>4 <sn cymc>2 <sn cymc>1
    }
  >>

HTH,
  Harm



reply via email to

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