lilypond-user
[Top][All Lists]
Advanced

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

Re: composing Scheme identifiers?


From: David Kastrup
Subject: Re: composing Scheme identifiers?
Date: Sun, 02 Mar 2014 19:56:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Paul Morris <address@hidden> writes:

> Simon Albrecht-2 wrote
>> scoreSetup =
>> #(define-music-function
>> (parser location letter)
>> (string?)
>> #{
>> \score {
>> \new Staff = "bassus" \with { instrumentName = "bassus" }
>> % this is supposed to give the same result as @code{\bassK} for example…
>> #(string->identifier (string-append "bass" $letter))
>> }
>> #}
>> )
>
> I recently tried a music function like this.  I wanted it to return a score,
> but I always got:
>
>   error: music function cannot return #<Score>

Ah, overlooked that one.

> I wonder whether music functions can return a score at all,

No, use define-scheme-function for that.  With regard to using that
scheme function as a score replacement then, it may conceivably work
only with recent versions of 2.19.  I think that I pulled some commits
for that purpose into 2.18, but that will only get available with 2.18.2
I think.

It's not really all that important as you can always leave out the
\score, and then do use a music function and \score { \scoreSetup ... }
as long as what you want in \scoreSetup does not include output or
header definitions.

-- 
David Kastrup



reply via email to

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