lilypond-user
[Top][All Lists]
Advanced

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

Passing a variable into a scheme function? (need syntax of)


From: Rick Hansen (aka RickH)
Subject: Passing a variable into a scheme function? (need syntax of)
Date: Tue, 1 Aug 2006 09:31:49 -0700 (PDT)

How can I pass a variable into the "magstep" function?

The following fails on a parser error, the log ends with "parsing...".  I
would like to be able to pass a scaling factor into my template along with
all the notes variables.  When I hard-code -3 into the template it works
fine, but when I try to use the variable called "varMyScaleFactor" it fails. 
I'm not a scheme programmer, so this should be a simple syntax question (I
hope).


% Song file follows...
\include "english.ly"

varMyScaleFactor = #-3
varMyNotes = \relative c {
c4 c c c |
c4 c c c |
c4 c c c |
c4 c c c |
}
varMyTitle = "My Fish Freddy"



% Template file follows...

#(set-global-staff-size 20)

\header {
        title = \varMyTitle
}

<<
     \new Staff
     \with
     {
         fontSize = \varMyScaleFactor
         \override StaffSymbol #'staff-space = #(magstep \varMyScaleFactor)
     }
     {
         \clef treble
         \varMyNotes
     }
 >>


Thanks
Rick



-- 
View this message in context: 
http://www.nabble.com/Passing-a-variable-into-a-scheme-function--%28need-syntax-of%29-tf2034704.html#a5598146
Sent from the Gnu - Lilypond - User forum at Nabble.com.





reply via email to

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