lilypond-user
[Top][All Lists]
Advanced

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

Re: conditional when-property function not working as intended


From: Kieren MacMillan
Subject: Re: conditional when-property function not working as intended
Date: Thu, 15 Sep 2016 11:25:47 -0400

Hi all,

Solved my own problem (I think?): the modified version (below) appears to work 
as expected.

On a related topic: I [clearly] don’t understand when “layout props” is 
necessary, and when it’s not.
Is this explained in the docs somewhere?

Thanks,
Kieren.

%%%%  SNIPPET BEGINS
\version "2.19.46"

#(define-markup-command (when-property layout props symbol markp) (symbol? 
markup?)
  (if (chain-assoc-get symbol props)
      (interpret-markup layout props markp)
      empty-stencil))

#(define-markup-command (mm-feed layout props amount) (number?)
 (let ((o-s (ly:output-def-lookup layout 'output-scale)))
   (ly:make-stencil "" '(0 . 0) (cons 0 (abs (/ amount o-s))))))

#(define-markup-command (put-mm layout props dir amount arg)
 (ly:dir? number? markup?) (interpret-markup layout props
   (markup #:put-adjacent Y dir arg #:mm-feed amount)))

\header {
  testA = "True!"
  testC = "True!"
}

\paper {
  scoreTitleMarkup = \markup \center-column {
    \when-property #'header:testA { \put-mm #UP #25 \fromproperty 
#'header:testA }
    \when-property #'header:testB { \put-mm #UP #25 \fromproperty 
#'header:testB }
    \when-property #'header:testC { \put-mm #UP #25 \fromproperty 
#'header:testC }
  }
}

\score {
  c'4
}
%%%%  SNIPPET ENDS

________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: address@hidden




reply via email to

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