lilypond-user
[Top][All Lists]
Advanced

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

Re: problems with learning lilypond


From: Simon Mackenzie
Subject: Re: problems with learning lilypond
Date: Sat, 08 Aug 2009 20:54:06 +0700




Simon


On 08/08/2009, at 05:41, Trevor Daniels wrote:


Simon Mackenzie wrote Friday, August 07, 2009 3:55 PM

Eg. What does it mean on page 34 of the Learning Tutorial when it
says...

"Variables must be defined before the main music expression."

Does this mean the \score { } or does it mean the expression in which
the declared variable is referenced?

The former, as shown quite clearly in the
template you mention below.


Implied but I feel not so clearly stated. If you declare a \book scope which contains \bookpart(s) with \score(s) where are variables to be declared? If I understand this all correctly variables must be declared outside this/these scope(s)? Correct? (as you have mentioned below variables must be declared outside (adding ALL would be helpful here) braces.

Because I dutifully declare my variables before the \score { } in my
script file using the example template from "A.1.4 Notes, lyrics and
chords" on page 143, again of the learning manual.
End result...
This error when I compile my script

"Unexpected string"  errors for every variable I've declared and no
idea as to why the template example fails to perform as claimed in the
documentation.

harmonies = \chordmode {...
melody = \lyricmode {... etc. generate "Unexpected string" errors

The template in the manual certainly does compile
without errors, as the image just below it is the
direct result of a compilation.  I suggest you
look at the template on the website at
http://lilypond.org/doc/v2.12/Documentation/user/lilypond-learning/Single-staff#Single-staff
From this page you can either copy&paste the code
directly, or click on the image of the music to
open the file directly (in the latter case you
will need to delete the first three lines).  These
files will then compile correctly (I've just tried
it).


Agreed, have tested same with complete success which is why I mentioned "scoping" in my last post.

From the error message it looks as if you are
inserting braces round the whole.  Variable
definitions come before any braces.

I'll add a bit to the manual to make that clear.


Will definitely help would-be travelers such as myself, thank you.

Here is my scenario

If I create a variable at the top scope how do I reassign its value in a subsequent scope eg.

aVariable = \markup { \bold bananas }

\book {
        \bookpart {
                \aVariable % "bananas"
                \score {
aVariable = \markup { \bold now \italic { equals this string } % want to be to reassign aVariable a new value so that...
                        \aVariable % "now equals this string"
                }
        }
}

Trevor


Thank you for your comments
Simon




reply via email to

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