[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generate music with scheme
From: |
Leo Correia de Verdier |
Subject: |
Re: Generate music with scheme |
Date: |
Mon, 11 Apr 2022 12:49:38 +0200 |
An addition:
MarkEvent is not added to the note, but to the staff (it’s often used for
things like rehearsal marks), if you want the markup added to the actual note
you can write it like this:
%%%%%%%%%%%%%
\version "2.18.0"
\score {
{
$ (make-sequential-music
(map (lambda (x)
(make-music 'NoteEvent
'pitch
(ly:make-pitch 0 x)
'duration
(ly:make-duration 2)
'articulations
(list (make-music 'TextScriptEvent
'text
(markup #:line (#:fontsize -3
"10"))))))
(list 1 2 3 4)))
}
}
%%%%%%%%%%%%%%%
2.18 is some years old, by the way.
Best
/Leo
> 11 apr. 2022 kl. 11:50 skrev Henrik Frisk <frisk.h@gmail.com>:
>
> Hi,
>
> I have not worked with scheme and lilypond for some years. I realize that
> this is more of a scheme question than Lilypond, but perhaps someone knows
> how to do this. I can generate four notes with the following:
>
> \version "2.18.0"
> \score {
> {
> $ (make-sequential-music
> (map (lambda (x)
> (make-music 'NoteEvent
> 'pitch
> (ly:make-pitch 0 x)
> 'duration
> (ly:make-duration 2)))
> (list 1 2 3 4)))
> }
> }
>
> However, if I would like to add a markup to each note to each note I fail. I
> would have guessed something like this would do it but it generates an
> (almost) empty staff:
>
> \version "2.18.0"
> \score {
> {
> $(make-sequential-music
> (map (lambda (x)
> (make-music 'NoteEvent
> 'pitch
> (ly:make-pitch 0 x)
> 'duration
> (ly:make-duration 2))
> (make-music 'MarkEvent
> 'label
> (markup
> #:line
> (#:override (cons (quote font-size) -3) "10"))))
> (list 1)))
> }
> }
>
> /h
>