Hi Pavel,

Am 09.08.20 um 12:30 schrieb Павел:
I want to write simple function that will be change duration of note. But I stuck on the first step: I can't "extract" (or "see") the duration property:

\version "2.20.0"
mynote = c'
\displayMusic \mynote
#(display-scheme-music
    (ly:music-property mynote 'duration))

Try setting mynote = c'8 from the start.

LilyPond interprets your mynote as a naked pitch (and you obvioulsy can't extract a duration from a pitch). This can be seen by doing #(display-scheme-music mynote) which yields (ly:make-pitch 0 0), or simply by #(display mynote) which yields #<Pitch c' >.

It seems using \displayMusic hides this fact by first upgrading #mynote to a full-fledged NoteEvent; these implicit conversions happen all the time in LilyPond.

Best
Lukas

Reply via email to