lilypond-devel
[Top][All Lists]
Advanced

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

Re: order of function arguments


From: Janek Warchoł
Subject: Re: order of function arguments
Date: Tue, 23 Apr 2013 19:19:42 +0200

2013/4/23 David Kastrup <address@hidden>:
> Janek Warchoł <address@hidden> writes:
>
>> 2013/4/23 David Kastrup <address@hidden>:
>>> Janek Warchoł <address@hidden> writes:
>>>> So, a \tweak gets, so to speak, "internally transformed to an
>>>> override"?  This is cool!!
>>>
>>> Well, it no longer has music to apply to, only a grob name.  I am not
>>> enthused about the resulting syntax/order when one _does_ need to
>>> specify properties or subproperties for a command using \tweak
>>> internally when employing it as an override.
>>>
>>> But at least as a tweak, it looks nice.
>>
>> I've just read the definition of \tweak.  From what i understand, it's
>> entirely possible to write a function that will do a tweak if one of
>> its arguments is a symbol, and do an override if that argument is a
>> symbol-list?  Something like this:
>>
>> foo =
>> #(define-music-function (parser location prop value music)
>>    (symbol-list-or-symbol? scheme? music?)
>>    (if (symbol? item)
>>        #{ \tweak #prop #value #music #}
>>        #{ \once\override #(append a b) = #value #}))
>
> Uh, this is such a confused mess that I propose you first make this work
> before discussing it.
>
> What's a, b, item?

OMG, i can't believe i've sent such an unholy mess.  Sorry - i got too
excited, apparently.
I meant something like this (unfortunately, this doesn't compile under
2.17.13, saying that i have to be in Lyricmode for NoteHead - but at
least it makes some sense):

foo =
#(define-music-function (parser location prop value music)
   (symbol-list-or-symbol? scheme? music?)
   (if (symbol? prop)
       #{ \tweak #prop #value #music #}
       #{ \once\override #prop = #value #}))

{
  \foo NoteHead.color #red
  c'1-\foo #color #red ->
}



reply via email to

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