lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \score inside define-markup-command


From: Nicolas Sceaux
Subject: Re: \score inside define-markup-command
Date: Tue, 24 Feb 2009 20:49:23 +0100

Le 23 févr. 09 à 10:36, Michael Käppler a écrit :


Hi,
I don't know if it will work, but perhaps you can try to type
\displayMusic {<< \clef #testclef a4 h c >>} to get the scheme version of your music,
and to copy/paste the output you got after the #:score markup ...
good idea! But it still doesn't work. Let's look at the following minimal example:

#(define-markup-command (testmusic layout props a b c) (number? number? number?)
(interpret-markup layout props (markup #:score
 (make-music
'SequentialMusic
'elements
(list (make-music
        'EventChord
        'elements
        (list (make-music
                'NoteEvent
                'duration
                (ly:make-duration 2 0 1 1)
                'pitch
                (ly:make-pitch a b c))))))
)))

Try the following:

\version "2.12.2"
#(define-markup-command (testmusic layout props music) (ly:music?)
  (let ((score (ly:make-score music))
        (score-layout (ly:output-def-clone $defaultlayout)))
    ;; possibly, change some settings in the \layout block
    (ly:output-def-set-variable! score-layout 'indent 0)
    ;; add the \layout block to the score
    (ly:score-add-output-def! score score-layout)
    (interpret-markup layout props (markup #:vcenter #:score score))))

\markup { a piece of music \testmusic ##{ a' b' c'' d'' #} inside a markup }

nicolas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]