Hi,

On Sun, Jun 29, 2014 at 8:35 AM, David Kastrup <d...@gnu.org> wrote:

> Pierre Perol-Schneider <pierre.schneider.pa...@gmail.com> writes:
>
> > 2014-06-29 13:42 GMT+02:00 Richard Shann <rich...@rshann.plus.com>:
> >
> > 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to