David Kastrup <[email protected]> writes:

> Federico Bruni <[email protected]> writes:
>
>> Hi David,
>>
>> thanks for the hint
>>
>> Il 24/10/2011 23:12, David Kastrup ha scritto:
>>> systemgrace = #grace
>>> grace = #(define-music-function (parser location m)
>>>              #{ \tag #'grace \systemgrace $m #})
>>>
>>> Then define your music in \mymusic as usual (it will use the changed
>>> version of \grace).  When you want the version without graces, call the
>>> music with \removeTag #'grace \mymusic.
>>>
>>> Something like that.
>>
>> you probably meant \removeWithTag
>
> Yup.
>
>> grace = #(define-music-function (parser location m)
>>             #{ \tag #'grace \systemgrace $m #})
>
> Well, the real surprise here is the absence of a syntax error.  The type
> signature is missing after the argument list.  If you add (ly:music?)
> after (parser location m), the example compiles and does what you want.
> It would require a thorough analysis to understand just _what_ this
> definition actually does without that.
>
> Of course, it complains about not being able to end the slur that
> started inside of the grace note.

Well, maybe the redefinition of grace is not really all too fabulous
with regard to being user-understandable.  A likely cleaner approach
would just be to do something like

\version "2.15.14"

ungrace = #(define-music-function (parser location m) (ly:music?)
  (music-filter
    (lambda (m) (not (eq? 'GraceMusic (ly:music-property m 'name))))
  m))

music = \relative c'' {
  a16( e) cis( b cis a) \grace e'( fis8~ fis16
  \grace { gis16 fis } e) cis16 e( fis e) cis( b) |
}

\score {
  \new StaffGroup <<
  \new Staff \music
  \new TabStaff \with { stringTunings = #guitar-asus4-tuning }
  \ungrace \music
  >>
  \midi{}
  \layout {}
}

-- 
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to