Dies ist das Archiv des alten Forums (bis März 2017). Das aktuelle Forum ist unter https://lilypondforum.de zu finden. This is the archive of the old forum (until March 2017). You can find the current forum at https://lilypondforum.de.
traLaLa = { c'4 d'4 }#(define newLa (map ly:music-deep-copy (list traLaLa traLaLa)))#(define twice (make-sequential-music newLa))\twice
traLaLa = {c'4 d'4}#(define twice (make-sequential-music (list traLaLa traLaLa)))\twice
In the following example, a music fragment is stored in the variable traLaLa, and duplicated using Scheme.
\version "2.19.38"traLaLa = { c'4 d'4 }fooI =#(define-music-function (m) (ly:music?)(let ((m1 (extract-named-music m 'NoteEvent)) (m2 (extract-named-music m 'NoteEvent))) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color red)))) m1) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color green)))) m2) (make-sequential-music (append m1 m2)))) fooII =#(define-music-function (m) (ly:music?)(let ((m1 (extract-named-music (ly:music-deep-copy m) 'NoteEvent)) (m2 (extract-named-music (ly:music-deep-copy m) 'NoteEvent))) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color red)))) m1) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color green)))) m2) (make-sequential-music (append m1 m2))))\fooI \traLaLa\fooII \traLaLa
\version "2.18.2"traLaLa = { c'4 d'4 }fooI =#(define-music-function (parser location m) (ly:music?)(let ((m1 (extract-named-music m 'NoteEvent)) (m2 (extract-named-music m 'NoteEvent))) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color red)))) m1) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color green)))) m2) (make-sequential-music (append m1 m2)))) fooII =#(define-music-function (parser location m) (ly:music?)(let ((m1 (extract-named-music (ly:music-deep-copy m) 'NoteEvent)) (m2 (extract-named-music (ly:music-deep-copy m) 'NoteEvent))) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color red)))) m1) (for-each (lambda (n) (ly:music-set-property! n 'tweaks (list (cons 'color green)))) m2) (make-sequential-music (append m1 m2))))\fooI \traLaLa\fooII \traLaLa
hinter der Versionsnummer fehlt ein "