[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Note head as a custom image chosen according to note duration
From: |
Aaron Hill |
Subject: |
Re: Note head as a custom image chosen according to note duration |
Date: |
Mon, 21 Nov 2022 15:31:25 -0800 |
On 2022-11-21 3:13 pm, Valentin Petzel wrote:
The duration of the NoteHead is not in fact a property of the grob, but
of the music event
that leads to creation of the grob, accessible from the grob by the
"cause"-property. Thus
Jean uses
(ly:event-property (event-cause grob) 'duration)
to get the duration of the note head and then uses different markups
for different values.
But NoteHead has a duration-log property ready to go:
%%%%
\version "2.22.0"
\layout {
\override Voice.NoteHead.stencil =
#(grob-transformer 'stencil
(lambda (grob orig)
(grob-interpret-markup grob #{
\markup
\with-dimensions-from \stencil $orig
\overlay {
\raise #1.25
#(number->string
(ly:grob-property grob 'duration-log))
\stencil $orig
}
#})))
}
{ 1 2 4. 8 }
%%%%
-- Aaron Hill
duration-log.cropped.png
Description: PNG image
- Note head as a custom image chosen according to note duration, Jean Faure, 2022/11/21
- Re: Note head as a custom image chosen according to note duration, Jean Abou Samra, 2022/11/21
- Re: Note head as a custom image chosen according to note duration, Valentin Petzel, 2022/11/21
- Re: Note head as a custom image chosen according to note duration,
Aaron Hill <=
- Re: Note head as a custom image chosen according to note duration, Jean Abou Samra, 2022/11/21
- Re: Note head as a custom image chosen according to note duration, Aaron Hill, 2022/11/21
- Message not available
- Re: Note head as a custom image chosen according to note duration, Jean Abou Samra, 2022/11/24
- Re: Note head as a custom image chosen according to note duration, Jean Faure, 2022/11/30
- Re: Note head as a custom image chosen according to note duration, Jean Abou Samra, 2022/11/30
- Re: Note head as a custom image chosen according to note duration, Jean Faure, 2022/11/30
- Re: Note head as a custom image chosen according to note duration, Jean Abou Samra, 2022/11/30