lilypond-user
[Top][All Lists]
Advanced

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

Extract pitch and duration from ly:music


From: Paolo Prete
Subject: Extract pitch and duration from ly:music
Date: Wed, 21 Feb 2018 09:51:17 +0000 (UTC)

Hello,

is it possible to extract pitch and duration, inside a function, from a ly:music (a simple note) parameter?

I would like to obtain something like:

func = #(define-music-function (parser location note dur) (ly:music) 
#{ ....  $mypitch $myduration .....  #}  )

... But I don't understand if is there a way to obtain $mipitch and $myduration

I know that I can extract them with scheme:

((mypitch (ly:music-property note 'pitch '()))
    (myduration (ly:music-property note 'duration '())))


But I see that it is not possible to use $mypitch and $myduration in the #{ ... #}  scope.

Thanks for your help.

reply via email to

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