lilypond-user
[Top][All Lists]
Advanced

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

Re: Percussion Decorations


From: Thies Albrecht
Subject: Re: Percussion Decorations
Date: Thu, 25 Nov 2004 23:33:16 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910

Hi Gilles!

For example, after a gong note (represented below with a triangle head), there
should be a tilde-like "decoration" (to indicate that it must be scratched with
a metallic rod):

  |>~
  |

I can't exactly figure out how the decoration or the whole note shall look like. But perhaps my reply can give you a first hint to solve your problem.

Somewhere in the archives I found a solution for adding brackets to a note head. This is done by the following code:

#(define (parenthesize-callback callback)
     (define (parenthesize-stencil grob)
         (let* ((fn (ly:get-default-font grob))
       (pclose (ly:find-glyph-by-name fn "accidentals-rightparen"))
       (popen (ly:find-glyph-by-name fn "accidentals-leftparen"))
       (subject (callback grob))

       ; remember old size
       (subject-dim-x (ly:stencil-extent subject 0))
       (subject-dim-y (ly:stencil-extent subject 1)))

       ; add parens
       (set! subject
        (ly:stencil-combine-at-edge
         (ly:stencil-combine-at-edge subject 0 1 pclose 0.2)
         0 -1 popen  0.2))

   ; revert old size.
      (ly:stencil-set-extent! subject 0 subject-dim-x)
      (ly:stencil-set-extent! subject 1 subject-dim-y)
      subject))
  parenthesize-stencil)

Lines #4 and #5 are the crucial ones for you. The gylph-name (that what is inside the qoutes) in line #4 specifies the kind of symbol that will be set right after the note head. Possible values for the glyph-name can be found on C.3 The Feta font <http://lilypond.org/doc/v2.4/Documentation/user/out-www/lilypond/lilypond.html#The-Feta-font>. Perhaps "scripts-turn" is something that fits for you. To suppress the symbol in front of the note head, just replace line #5 by (popen '#()). The usage in your lilypond source then is something like this (right in front of :note that is to look like the way you described)

\once \override NoteHead #'print-function = #(parenthesize-callback Note_head::print)

Hope that works for you. Unfortunately I don't know your lilypond version., but that solution worked for me at least since version 2.0.x.

Right now (Thu Nov 25 17:40:43 CET 2004), the
     "lilypond-user archive search" doesn't work:

       Results:
       References: [ music: 0 ]
       No document matching your query.

From time to time I'm facing that problem, too. Putting an asterisk in front and behind each search term should be a workaround.

Kind regards
Thies Albrecht




reply via email to

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