lilypond-user
[Top][All Lists]
Advanced

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

Re: lay out


From: Mats Bengtsson
Subject: Re: lay out
Date: Thu, 02 Jun 2005 17:26:08 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511



Aaron Mehl wrote:
Ok here is where I am confused. There is a structure
for files which makes a file valid.
Then there is a grammar which must also be followed
for the lanuguage of lilypond.
I get the feeling after reading the docs that the
structure of lilypond is loose.

What I mean is that it appear (if I am not wrong) that
there are elements that can appear a number of places
in a document and others that can appear only in
certain places.

I want to be able to generalize and also limit the
structure of a basic lilypond file:

lets say a file with a melody only.

If I ask the question what elements must a lilypond
file have or it won't be valid structuraly will I get
an answer?

If I ask for a valid parent child relationship of
elements will I find such a thing?

This issue is compounded for me by most lilypond
examples which use includes or variables x = y
so that it is often hard to see what the structure is.

For me it's the opposite. I find it much harder to see
the structure if you only have a long \score{...} where
I have to scroll several pages from beginning to end.

One thing that may confuse you is that some of the structural
elements are optional. For example,
\book{
  \score{
    {c d e f}
  }
}
can be abbreviated into
{c d e f}

Probably, you wouldn't have that much problems with the basic structure
if you had a background in programming languages like Pascal or C or
Scheme than with the very strictly specified grammar of XML.
To cite Han-Wen, the strict formal definition of the input grammar
can be found in the source code file parser.yy. However, I
agree completely with you that we should have a basic description
not only of the syntax but also of the semantics of the
basic building blocks. Even though I've been using LilyPond
since version 0.0.xx, I'm still confused by some aspects,
especially when it comes to \book{...} and what happens if you
have several \layout{...} blocks at the top level.

The basic ideas, though, are not that hard. At the top level
of the file, you can have "macro definitions" xxxx = ...,
you can have \header{...} blocks, \paper{...} blocks,
\layout{...} blocks and, of course, \score{...} blocks (I've
probably forgot some others as well).
The \header and \layout can also be moved inside the \score{...}
if you wish and in that case the only apply to the current score,
otherwise they apply to all scores.

   /Mats


I am not complaining rather I am trying to understand.

I realize part of my problem comes from my experience
with xml/html where there are strict rules for nesting
and validity and wellformedbness...


A documentation page titled file structure should lay
down some rules for file structure instead of listing
a few of the top level elements.

I for my part find it confusing when an element is not
nested. Although I realize that with lilypond there is
less worry about missing brackets that way.

I will read some more and experiment some more and see
what I come up with.

Aaron
--- Mats Bengtsson <address@hidden> wrote:


(Graham, or someone else, we should really try to
make sure that
all commands and reserved words available in
LilyPond are listed
in the Index. \layout is one of those missing. Doing
such an exercise
would also help identifying what information is
missing from the manual
today.)

Part of an answer to your question can be found in
the
sections "Changing context default settings" and
"Defining new contexts" in the manual. There's also
some
information in "Line length", but there doesn't seem
to be
any introduction to the concept anywhere. For
example, I couldn't
find any information on that you can put a
\layout{...} block
on the top level of the file to make it apply to all
scores in the
file (or at least within the \book) whereas it will
only apply to
the current score if you put the declaration inside
\score{...}.

   /Mats


Aaron Mehl wrote:

Hi   all,

In a previous email I asked if layout replaced

paper.

I was told to look at outputs, which I did. The

paper

output section details \paper{}

but I see no mention of \layout {}

where in the docs is \layout discussed?

Thanks
Aaron

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam

protection around
http://mail.yahoo.com

_______________________________________________
lilypond-user mailing list
address@hidden


http://lists.gnu.org/mailman/listinfo/lilypond-user

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





                
__________________________________ Discover Yahoo! Find restaurants, movies, travel and more fun for the weekend. Check it out! http://discover.yahoo.com/weekend.html

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================




reply via email to

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