[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enlarge vertical distance in time signature
From: |
David Kastrup |
Subject: |
Re: enlarge vertical distance in time signature |
Date: |
Tue, 30 Oct 2012 06:50:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) |
pabuhr <address@hidden> writes:
> I consider it much nicer to make "strg" of type fraction?, and then num
> can be (car strg) and denom can be (cdr strg).
> and
> can just be \spreadTimeSignature #8 2/4 ... which is nicer on the eyes.
>
> I was intrigued and tried to modify the code as you suggested as a
> learning exercise. But I ran into a problem I do not understand. I
> assumed that fraction is a pair of two numbers, so num and denom are
> of type number. "column" needs strings so the numbers have to be
> converted. However, I get the following error:
> test12.ly:18:25: error: syntax error, unexpected NUMBER_IDENTIFIER
> (number->string
> $num)
> /usr/local/lilypond/usr/share/lilypond/current/ly/init.ly:61:0: error: error
> in #{ ... #}
>
> I think I'm close but missing some subtle issue about the types.
>
> ============================================================================================
>
> \version "2.16.0"
> \language english
> #(set-global-staff-size 30)
>
> spreadTimeSignature =
> #(define-music-function (parser location baselineSkip strg music)(number?
> fraction? ly:music?)
> (let* ((num (car strg))
> (denom (cdr strg)))
> #{
> \override Staff.TimeSignature #'stencil =
> #(lambda (grob)
> (grob-interpret-markup grob
> #{
> \markup %\fontsize #5
> \vcenter
> \override #`(baseline-skip . ,baselineSkip)
> \column {
> (number->string $num)
This needs to be $(number->string num) instead, as the expression you
want to splice in here "as if it were written in LilyPond" includes the
Scheme call.
Other than that (same with denom), the code looks fine to me.
--
David Kastrup
- Re: enlarge vertical distance in time signature, (continued)
- Re: enlarge vertical distance in time signature, Thomas Morley, 2012/10/28
- Re: enlarge vertical distance in time signature, Stefan Thomas, 2012/10/28
- Re: enlarge vertical distance in time signature, Thomas Morley, 2012/10/28
- Re: enlarge vertical distance in time signature, Thomas Morley, 2012/10/28
- Re: enlarge vertical distance in time signature, Stefan Thomas, 2012/10/28
- Re: enlarge vertical distance in time signature, Thomas Morley, 2012/10/29
- Re: enlarge vertical distance in time signature, Stefan Thomas, 2012/10/30
Re: enlarge vertical distance in time signature, David Kastrup, 2012/10/29