lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function question


From: David Kastrup
Subject: Re: Scheme function question
Date: Sat, 23 Nov 2013 06:50:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> 2013/11/22 David Kastrup <address@hidden>:
>
>> #(defmacro-public make-relative (variables reference music)
>>   "The list of pitch or music variables in @var{variables} is used as
[...]
>> in contrast, does not make sense.
>> "
>>
>>   ;; pitch and music generator might be stored instead in music
>>   ;; properties, and it might make sense to create a music type of its
>>   ;; own for this kind of construct rather than using
>>   ;; RelativeOctaveMusic
>>   (define ((make-relative::to-relative-callback variables music-call 
>> ref-call)
>>            music pitch)
>>     (let* ((ref-vars (map (lambda (v)
>>                             (if (ly:pitch? v)
>>                                 (make-music 'NoteEvent 'pitch v)
>>                                 v))
>>                           variables))
>
> I didn't try it, though, two closing parens missing, c/p-error?

Not yet.  The let* is not finished yet.  The error comes later (git uses
"less" for display, and less by default cuts off lines at the edge of
the terminal).  Indeed, two closing parens after the following line
missing, well-spotted:

>>            (after-pitch (ly:make-music-relative! (apply ref-call ref-vars) 
>> pitch
>>            (actual-vars (map (lambda (v r)
>>                                (if (ly:pitch? v)
>>                                    (ly:music-property r 'pitch)
>>                                    v))
>>                              variables ref-vars))
>>            (rel-music (apply music-call actual-vars)))
>>       (set! (ly:music-property music 'element) rel-music)
>>       after-pitch))
>>   `(make-music 'RelativeOctaveMusic
>>                'to-relative-callback
>>                (,make-relative::to-relative-callback
>>                 (list ,@variables)
>>                 (lambda ,variables ,music)
>>                 (lambda ,variables ,reference))
>>                'element ,music))
>
> Cheers,
>   Harm
>
>

-- 
David Kastrup



reply via email to

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