lilypond-user
[Top][All Lists]
Advanced

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

Re: Cannot use \layout in a variable


From: Peter Toye
Subject: Re: Cannot use \layout in a variable
Date: Thu, 12 Jan 2017 09:52:22 +0000

David,

Thanks for posting this. I was out most of yesterday and didn't have time to do it. I'd intended to do it this morning (UK time) but found you'd got there first.

Best regards,

Peter
mailto:address@hidden
www.ptoye.com

-------------------------
Thursday, January 12, 2017, 4:07:18 AM, you wrote:

> | I've added the missing text with a sidebar:

> On Wed 11 Jan 2017 at 05:03:21 (-0700), ptoye wrote:
>> Thanks all for putting me right. I have to say that the documentation is very
>> confusing as to the syntax. From the Learning manual:

> | A variable is assigned as follows:
> | namedMusic = { ... }

> So "..." is typically a sequence of notes or a sequence of music expressions.
> The {} indicate a seqeunce rather than simultaneous expressions << >>.

>> which implies that the brackets are needed, but it's followed by:

> | violin = \new Staff {
> |   \relative {
> |     a'4 b c b
> |   }
> | }

> Here { a'4 b c b } is a music _expression_, \relative is a command that
> controls how LP interprets the notes' octavation, and \new is a
> command that wraps one _expression_ in the Staff context.

> You could write

> violin = \new Staff
> \relative {
>   a'4 b c b
> }

> just as you could write

> cello = \new Staff d'

> because d' is one _expression_.

>> and later by:

> | width = 4.5\cm

> Here you should read up the Notation Reference §3.1.5.
> width is not a music _expression_, so you couldn't write, say,

> { \namedMusic \width }

> So \width needs to be interpreted in something like \paper { \width
> and other things }. What you set a variable to (ie the right hand side)
> determines where you can later use it.

>> which don't have the brackets.

>> How does the parser know when the variable definition has finished if it can
>> be on multiple lines?

> If there are no braces (or equivalent), then it'll be a single item,
> but that item could be a command with its own argument following it.

> compiler = \markup Rutter

> I hope some of that makes sense.

> Cheers,
> David.
reply via email to

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