lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function


From: David Kastrup
Subject: Re: Scheme function
Date: Wed, 10 Jun 2015 21:22:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Víctor <address@hidden> writes:

> Thank you very much for your answer, this works very well. I'll be
> studying the scheme tutorial so I don't have to bother you people with
> basic things.
> Regards,
> Víctor.
>
> El 10/06/15 a las 12:04, Nathan Ho escibió:
>> Hi Victor,
>>
>> Here's one way to do it:
>>
>> solfa =
>> #(define-music-function
>>     (parser location framed number note)
>>     (string? string? string?)
>>   (make-music
>> 'TextScriptEvent
>>     'direction 1
>>     'text
>>     (markup
>>        (if (not (equal? framed ""))
>>           (markup #:box #:pad-to-box '(0 . 0) '(0 . 2.2) framed)
>>           "")
>>         #:simple number
>>         (if (not (or (equal? number "") (equal? note "")))
>>           (markup #:simple ":")
>>           "")
>>         #:italic note)))

Well, this can be made less intimidating by judicious use of #{...#}
like you did in your proposed code.

(make-music 'TextScriptEvent 'direction 1 'text (markup x))

is the same as #{ ^\markup #x #} and (markup ... can usually be replaced
by some more familiar #{ \markup ... #} construct.

-- 
David Kastrup



reply via email to

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