lilypond-user
[Top][All Lists]

## Re: Chord from a variable

 From: Neil Puttock Subject: Re: Chord from a variable Date: Sun, 7 Aug 2011 17:46:21 +0100

On 7 August 2011 17:28, Volker Paul <address@hidden> wrote:
> Hello,
>
> there is something I don't understand. In the following example:
>
> \version "2.12.3"
> v = { c }
> \chordmode { c }
> \chordmode { \v }
>
> I expected to see two times the same result, but
> only the first expression yields a chord.
> The second yields only one C note, and it is
> surprisingly one octave deeper.
>
> Questions:
> How can I get a chord from a variable?

v = \chordmode { c }

> Why doesn't it work this way?

Probably because

v = { c }

is the same as

v = \notemode { c }

\notemode is the default state for parsing objects inside braces.

> Why is this result one octave deeper?

That's the correct pitch for such a note unless it's in a \relative
block with a different octave for the start pitch.

\chordmode { \v }

is the same as

{ c }

unless you force a mode change when defining the variable.

Cheers,
Neil