lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme: change duration of NoteEvent


From: Lukas-Fabian Moser
Subject: Re: Scheme: change duration of NoteEvent
Date: Sun, 9 Aug 2020 12:45:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

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

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