lilypond-user
[Top][All Lists]
Advanced

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

Re: hiding grace notes


From: David Kastrup
Subject: Re: hiding grace notes
Date: Wed, 26 Oct 2011 10:10:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

David Kastrup <address@hidden> writes:

> Federico Bruni <address@hidden> 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

reply via email to

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