lilypond-user
[Top][All Lists]
Advanced

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

Re: \score block as variable/function


From: -Eluze
Subject: Re: \score block as variable/function
Date: Fri, 18 Mar 2011 07:31:40 -0700 (PDT)


Xavier Scheuer wrote:
> 
> 
> I'd like to use a music function in order to be able to write
> 
>   % writeScore  is the music function I want but I was not able to define
> 
>   one = \writeScore { c'1 }
>   two = \writeScore { d'1 }
> 
>   \markup \fill-line {
>     \one \two
>   }
> 
> 

then you should try this (contributed by Nicolas Sceaux 
http://old.nabble.com/%5Cscore-inside-define-markup-command-ts22153506.html
http://old.nabble.com/%5Cscore-inside-define-markup-command-ts22153506.html 
)
which seems nearly what you're looking for!

\version "2.13.54" 
#(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))))
music = {a' b' c'' d''}
one = \markup { \testmusic ##{ \music #} }
two = \markup { \testmusic ##{ \music #} }
three = \markup { \testmusic ##{ \music #} }
\markup \fill-line { 
  \one 
  \two 
  \three
}

cheers
Eluze
-- 
View this message in context: 
http://old.nabble.com/%5Cscore-block-as-variable-function-tp31147554p31181636.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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