lilypond-user
[Top][All Lists]
Advanced

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

Re: With \markup { \score { can I separately control the score size?


From: David Nalesnik
Subject: Re: With \markup { \score { can I separately control the score size?
Date: Sun, 29 Jun 2014 08:40:57 -0500

Hi,

On Sun, Jun 29, 2014 at 8:35 AM, David Kastrup <address@hidden> wrote:
Pierre Perol-Schneider <address@hidden> writes:

> 2014-06-29 13:42 GMT+02:00 Richard Shann <address@hidden>:
>
> That works great, thank you. The only further tweak I needed was to put
>> \large before the text so that text comes out at a normal size with the
>> music reduced.
>>
>
> I'm trying to make an easy function for (without success) :
>
> %%%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.19.8"
>
> mySize =
> #(define-music-function (parser location arg) (number?)
>     (markup (make-scale-markup (cons arg arg))))
>
> \mySize #.5 {
>   \score {
>     c''1
>   }
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%
>
> LilyPond says :"Expect: 2, found 1: ((0.5 . 0.5))"

No, it doesn't.  It says:

fatal error: make-scale-markup: Wrong number of arguments.  Expect: 2, found 1: ((0.5 . 0.5))

> Anyone ?

\scale needs two arguments.  You call it with one.

Then mySize is declared as a music function, but if it ever got to the
point of returning, it would fail because of returning a markup instead.

You want to use define-markup-command instead.  You want to make sure
you get the quite different definition/call as compared to
define-music-function right.  I would refrain from using the markup
macro when you don't have the syntax under control: when using #{
\markup ... #} instead, you are at least likely to get somewhat better
error messages.  Which is sort of the reverse of what #{...#} did with
error reporting in 2.14 or so, but why not make use of improvements?

And of course, the invocation needs to be inside of a \markup command.

This is what I got:

 \version "2.19.8"

#(define-markup-command (mySize layout props arg t) (number? markup?)

  (interpret-markup layout props

    (make-scale-markup (cons arg arg) t)))


foo =

\markup {

  \score {

    \new Staff {

      c1 c c c

    }

    \layout {}

  }

}


\markup { \mySize #2 \foo }


%%%%%%%%%


HTH,

David


reply via email to

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