[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheme problem in lilypond
From: |
Mats Bengtsson |
Subject: |
Re: scheme problem in lilypond |
Date: |
Fri, 19 Jan 2001 13:18:02 +0100 |
> Hi,
>
> I was wondering why this fails in a lilypond file:
>
> (define speed 60)
>
> ...
>
> \midi {
> \tempo 4 = #speed
> }
>
>
> I get this:
>
> foo.ly:95:0: error: parse error, expecting `DIGIT' or `NUMBER_IDENTIFIER' or
> `UNSIGNED' or `REAL':
>
>
> I can define and substitute strings with no problem, so why not numbers?
> Is there a workaround?
In the current Lilypond grammar (as defined by lily/parser.yy),
the argument to the \tempo command bust be an unsigned integer
and cannot be specified by a Scheme value. The same holds for,
for example, note durations. I agree that this may seem inconsistent
with the use of strings in the grammar. Why do you want to
specify it in Scheme? If you wish, you could define a Lilypond
identifier and use as the argument, though:
speed = 60;
\midi {
\tempo 4 = \speed
}
/Mats