lilypond-user
[Top][All Lists]
Advanced

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

Re: Dot-separated list as music function argument


From: Abraham Lee
Subject: Re: Dot-separated list as music function argument
Date: Tue, 08 Jul 2014 16:24:23 -0006

On Tue, Jul 8, 2014 at 9:48 AM, David Kastrup <address@hidden> wrote:
Simon Albrecht <address@hidden> writes:
Hello everybody, I just wrote a music function to mark grobs as editorial addition by colouring them grey. See the code and an example: \version "2.19.8" ed = #(let ((string-or-list? (lambda (grob) (or (string? grob) (list? grob))))) (define-music-function (parser location grob mus) (string-or-list? ly:music?) #{ \override $grob . color = #(x11-color 'grey40) $mus \revert $grob . color #} ) )
"See the code" is a euphemism. Try telling your mail client not to reformat stuff.
\relative { \ed NoteHead c' \ed #'(Staff Accidental) { cis dis } es }
The 2.18 changes document says that #'(Staff Accidental) and Staff.Accidental were now interchangeable, however if I replace it in the second function call, I get errors (unexpected "." etc.). Is there a way to avoid this in the coding of the function or should it be considered a bug?
Your predicate string-or-list? accepts a string, so LilyPond does not look for . or anything else. That's a really bad predicate to use here. Try symbol-list-or-symbol? instead. That should be pretty close to what one would expect from override-similar syntax. Probably symbol-list? alone is fine as well, but it will, of course, not accept #'Accidental (which is not a symbol list), even though it _will_ accept Accidental without any quotes.
--
David Kastrup _______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user

Simon,

Disregard my response. After re-reading your initial post and seeing Janek's and David's responses, I realized that I misunderstood your question.

Regards,
Abraham

reply via email to

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