lilypond-user
[Top][All Lists]
Advanced

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

Re: constructing variables


From: David Kastrup
Subject: Re: constructing variables
Date: Thu, 19 Jun 2014 14:03:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

"Dr. med. Kai Lautenschläger" <address@hidden> writes:

> \version "2.19.7"
>
> Hi everyone!
>
> is it possible to construct variables from others? I want to construct 
>
> \tempo "Text" 4=80
>
> from the variables
>
> tempoText = "Text" and
> tempoNumber = "4=80"
>
> that are defined at two different places in a complicated file structure 
> (\include)
>
> I tried:
>
> \version "2.19.7"
> tempoText = "Text" and
> tempoNumber = "4=80"
> {
>       \tempo \tempoText \tempoNumber
>       a4 
> }
>
> with an without quotation marks, but nothing worked. I suppose I just
> can’t see the obvious and just looked for the wrong keywords in the
> documentation. Can anyone point me in the right direction.

tempoText is fine, but 4=80 is not a string.  In 2.19.7, you could do

tempoText = "Text"
tempoUnit = ##{ 4 #}
tempoNumber = 80
{
  \tempo \tempoText \tempoUnit = \tempoNumber
  a4
}
But this begs the question why you don't just assign the whole tempo
specification to a single variable.  Note that ##{ 4 #} is a somewhat
cumbersome shorthand in order to get at a single duration.

-- 
David Kastrup

reply via email to

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