lilypond-user
[Top][All Lists]
Advanced

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

Syntax for reading object property values?


From: Peter Hays
Subject: Syntax for reading object property values?
Date: Wed, 28 Sep 2005 15:39:37 -0400

Hello users,

I bet this is a simple one. How do I read the value of an object property for use in a markup string? For example, how do I get the value of 'currentBarNumber' and use in place of 'x' in the following code?

===== ex 1 ==========
\version "2.6.3"

\score {
        \relative c'{
        c1
        \mark \markup {"<" x ">"}
        c
        }
        \layout{ raggedright = ##t }
}
====================

Obviously, I am trying to tweak how bar numbers are generated. I am interested, in general, in the syntax for using an object property/value in a markup string. I am not simply looking for ways to format bar numbers (e.g. <>, boxes, circles). I have the regular BarNumber and RehearsalMark stuff working, and the following snippit works as it should.

===== ex 2 ===========
\set Score.markFormatter = #(lambda (mark context)
                                (make-bold-markup
                                 (make-box-markup
                                  (number->string (ly:context-property context 
'currentBarNumber)))))
\mark \default
====================

I can not, however, figure out how to translate the use of 'currentBarNumber' in ex. 2 for use in ex. 1.

Lily is great!

Thanks,
Pete






reply via email to

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