lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating markup macros (functions actually)


From: Nicolas Sceaux
Subject: Re: Creating markup macros (functions actually)
Date: Sat, 27 Nov 2004 12:21:54 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Paul Scott <address@hidden> writes:

> Ok, that looks pretty simple but I'm not quite sure yet how to combine
> my two definitions so I won't have to type '\markup' each time.  (see
> below).
>
> Even so I would like to understand the scheme code.  I have been
> searching through the scm directory trying to make sense of all of
> this.  In scm/translation-functions.scm I found references to
> numerator and denominator which are listed as properties in the
> manual.
>
> 1. Is that code actually referring to the same properties listed in
> the manual?

If you mean the manual page
http://lilypond.org/doc/v2.5/Documentation/user/out-www/lilypond-internals/Music-properties.html
then absolutely. Music expressions (that you manipulate when using
a music function) have properties, which can be accessed with
`ly:music-property'.

> 2. In that same file there is a reference to 'make-bold-markup' but I
> can't find it's definition anywhere.  I thought that might help me
> discover how to define 'one' so I can do R1*3/4^\one as you have
> suggested.

The `def-markup-command' macro does a couple of thing:
 - it "registers" the command, so that the parser can know what to do
 when \markup \MYCOMMAND ... is encountered
 - it defines a make-MYCOMMAND-markup function
 - some internal things, such as the actual markup function
 definition.

When the \bold markup command is defined with def-markup-command, a
`make-bold-markup' function is also defined, that you can use to
programmatically build a bold markup: (make-bold-markup "foo"). Note
that this is equivalent to writing: (markup #:bold "foo").
See scm/new-markups.scm.

> Can you comment on either of these two points so I can do more of this
> on my own?

Note that in the case of \one, something like
   one=\markup \number 1
will be enough!

nicolas





reply via email to

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