lilypond-user
[Top][All Lists]
Advanced

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

Scheme : "catching" property values


From: Éditions IN NOMINE
Subject: Scheme : "catching" property values
Date: Thu, 23 Sep 2010 12:02:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2

Hi list !
I'm training some Scheme stuff, especially by rewriting basic Lily functions in Scheme. I'm now trying to create a function that increases by 1 the degree of the note argument. So I have to "catch" the second figure of the
'pitch
(ly:make-pitch a b c))

to add 1 to it.

The function begins with :

 increasedegree= #(define-music-function (parser location note)(ly:music?)
         "adds 1 to the second figure of the pitch"
         (let ((result-note (ly:music-deep-copy note)))   ;local copy of the note passed as argument
              ((result-pitch (ly:music-property (first (ly:music-property result-note 'elements))                                 'pitch))) ;local copy of the pitch of result-note


How can I call for the second figure of the pitch?
This trick would be usefull for other functions I'm trying to write ! Maybe this trick is treated in the manual, but I haven't seen it...

have a good day !

JMarc

reply via email to

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