lilypond-user
[Top][All Lists]
Advanced

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

Re: undefined


From: Paul Morris
Subject: Re: undefined
Date: Fri, 17 Apr 2015 13:38:04 -0400

> On Apr 17, 2015, at 12:57 PM, David Nalesnik <address@hidden> wrote:
> 
> Nice function!  I think you also need to set types to reflect the change to a 
> slur.

Good catch!  Looks like there’s also a ‘spanner-id property on slurs, so I 
added that too for good measure.  Also a little code simplification.

Thanks,
-Paul


%%%%%%%%%%
\version "2.18.2"

beamsToSlurs =
#(define-music-function (parser location music) (ly:music?)
   (music-map
    (lambda (m)
      (if (ly:music-property m 'articulations)
          (for-each
           (lambda (a)
             (if (music-is-of-type? a 'beam-event)
                 (begin
                  (ly:music-set-property! a 'name 'SlurEvent)
                  (ly:music-set-property! a 'types
                    (append
                     (delete 'beam-event (ly:music-property a 'types))
                     '(slur-event)))
                  (ly:music-set-property! a 'spanner-id "")
                  )))
           (ly:music-property m 'articulations)))
      m)
    music))

%%%%%%%%%

% \displayMusic
\beamsToSlurs
% \displayMusic
{
  c8 [ d ] e ( f )
}




reply via email to

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