Engraving music using Scheme expressions: Difference between revisions
Appearance
Import snippet from LSR |
m New category |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
You can engrave music using just Scheme expressions. Although those expressions reflect the inner mechanism of LilyPond, they are rather clumsy to use, so avoid them, if possible. | You can engrave music using just Scheme expressions. Although those expressions reflect the inner mechanism of LilyPond, they are rather clumsy to use, so avoid them, if possible. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=122 | %% http://lsr.di.unimi.it/LSR/Item?id=122 | ||
| Line 29: | Line 29: | ||
[[Category:Scheme]] | [[Category:Scheme]] | ||
[[Category:Scheme]] | [[Category:Scheme]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:35, 21 November 2025
You can engrave music using just Scheme expressions. Although those expressions reflect the inner mechanism of LilyPond, they are rather clumsy to use, so avoid them, if possible.
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=122
#(define (make-note-req p d)
(make-music 'NoteEvent
'duration d
'pitch p))
#(define (make-note elts)
(make-music 'EventChord
'elements elts))
#(define (seq-music-list elts)
(make-music 'SequentialMusic
'elements elts))
fooMusic = #(seq-music-list
(list (make-note (list (make-note-req (ly:make-pitch 1 0 0) (ly:make-duration 2 0))))
(make-note (list (make-note-req (ly:make-pitch 1 1 0) (ly:make-duration 2 0))))))
\score {
\fooMusic
}