lilypond-user
[Top][All Lists]
Advanced

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

variables for numbers


From: Flaming Hakama by Elaine
Subject: variables for numbers
Date: Thu, 10 May 2018 13:51:33 -0700


On Tue, May 1, 2018 at 11:03 AM, <address@hidden> wrote:
Send lilypond-user mailing list submissions to
        address@hidden


I'm having difficulty understanding how to use a variable that stores a number, for use with a \raise command.


I have numerous markup definitions similar to this one:

sottoVoce = <>^\markup \raise #1.3 { \italic "sotto voce" }
mezzoVoce = <>^\markup \raise #1.3 { \italic "mezzo voce" }
{ \sottoVoce a'1 \mezzoVoce c''1 } 

And I'd like to use a variable for the raise value, instead of repeating #1.3 for each definnition.



Here are three MWE's of failed approaches.

%  The common sense approach
raiseDistance = #1.3
sottoVoce = <>^\markup \raise \raiseDistance { \italic "sotto voce" }
{ \sottoVoce a'1 } 


%{
myWidth = 60      % a number to pass to a \paper variable (the unit is millimeter)
Depending on its contents, the variable can be used in different places. The following example \paper {
       line-width = \myWidth
}
{
        c1
}
%}
raiseDistance = 1.3
sottoVoce = <>^\markup \raise \raiseDistance { \italic "sotto voce" }
{ \sottoVoce a'1 } 



%{
    twelve = 12
    twentyFour = #(* 2 twelve)
%}
raiseDistance = 1.3
sottoVoce = <>^\markup \raise #(raiseDistance) { \italic "sotto voce" }
{ \sottoVoce a'1 } 



Does anyone have either a suggestion for how to do this, or the appropriate place to RTFM?

all are of functions that consume a value.  There are no examples of using a variable that is a number.



Thanks, 

David Elaine Alt
415 . 341 .4954                                           "Confusion is highly underrated"
address@hidden
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

reply via email to

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