|
From: | Gilles Thibault |
Subject: | Re: concatenating notes with a music expression |
Date: | Tue, 15 May 2018 00:40:30 +0200 |
User-agent: | Webmail Free/1.3.3 |
Le 2018-05-12 00:16, Sirius Barras a écrit :
I have a sequence of notes and a music expression. How could be done a function concatenating each element of the sequence with the music expression?For instance, if the sequence is {c b a } and the music expression is { f g} I would like to obtain c f g b f g a f g
Don't known what Lilypond version you have. This should work in 2.18 and 2.19
%%%%%%%%%%%%%%%%%% #(define (foo seq1 seq2) (map (lambda(note) ;(ly:music-deep-copy ;; if music is re-used (make-sequential-music (cons note (ly:music-property seq2 'elements)))) (ly:music-property seq1 'elements))) seqI = { c b a } seqII = { f g } #(for-each display-lily-music (list seqI seqII)) #(display "=>\n") #(for-each display-lily-music (foo seqI seqII)) %%%%%%%%%%%%%%%%%%% Output : { c4 b4 a4 } { f4 g4 } => { c4 f4 g4 } { b4 f4 g4 } { a4 f4 g4 } Good week. -- Gilles
[Prev in Thread] | Current Thread | [Next in Thread] |