lilypond-user
[Top][All Lists]
Advanced

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

Re: Dynamic mark at the end of a bar


From: David Nalesnik
Subject: Re: Dynamic mark at the end of a bar
Date: Thu, 28 May 2015 15:45:04 -0500

Hi Simon,

On Thu, May 28, 2015 at 2:28 AM, Simon Albrecht <address@hidden> wrote:

This sounds like a usecase for \afterGrace. I cooked up a music function for that, which works quite fine. Does that help you?


This is nice.  I should point out that \afterGrace places the grace notes using SimultaneousMusic and skips.  Here's the definition:

afterGraceFraction = #(cons 6 8)
afterGrace =
#(define-music-function (parser location main grace) (ly:music? ly:music?)
   (_i "Create @var{grace} note(s) after a @var{main} music _expression_.")
   (let ((main-length (ly:music-length main))
         (fraction  (ly:parser-lookup parser 'afterGraceFraction)))
     (make-simultaneous-music
      (list
       main
       (make-sequential-music
        (list

         (make-music 'SkipMusic
                     'duration (ly:make-duration
                                0 0
                                (* (ly:moment-main-numerator main-length)
                                   (car fraction))
                                (* (ly:moment-main-denominator main-length)
                                   (cdr fraction))))
         (make-music 'GraceMusic
                     'element grace)))))))

%%

DN


reply via email to

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