lilypond-user
[Top][All Lists]
Advanced

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

Re: music patterns and octave


From: David Kastrup
Subject: Re: music patterns and octave
Date: Wed, 09 Mar 2016 18:00:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> Thank you David for your help. I think the behaviour of "\relative" and
> "\resetRelativeOctave" are clear. If the latter is not deprecated IMHO
> there are cases where it can be very useful. That one you mention
> (preventing up
> and down octave when changing code) it is just one. For instance, suppose I
> start to write a score and I write this musical phrase:

[...]

> As I written in the remark, the octave at the end depends on the last
> previous note. You could need to change c4 for example in c'4 to obtain the
> same behavior as the first phrase. Suppose you do change it, so that you
> obtain:
>
> c4 d8 e8 f4
> %some notes here
> %some notes here
> *c'4* d8 e8 f4  % the octave here depends on the last previous note
>
> now the the phrase at the beginning and at then end stops to match and
> became differents. This prevent you from easily create a variable and write
> the code in the following (nice) way:
>
> fragment = {c4 d8 e8 f4}

Then write it as

fragment = \relative c' {c4 d8 e8 f4}

and it becomes absolute.  If you want to quote it in a different octave,
you can write

\transpose c c' \fragment

but either way it will just keep its own pitches without interacting
with surrounding phrases.

> In this latter case if you decide to create a variable to reuse your code
> you can do three different things:
>
> 1) fragment = {c4 d8 e8 f4}
>
> 2) fragment = {\resetRelativeOctave  c' c4 d8 e8 f4}
>
> 3) fragment = \relative c' {c4 d8 e8 f4}
>
>
> The first is useful when you need to be able to do not fix the octave. The
> following is an example:
>
> fragment = {c4 d8 e8 f4}
>
> {
> \resetRelativeOctave c' \fragment
> %some notes here
> %some notes here
> \resetRelativeOctave c, \fragment
> }

More cumbersome than

fragment = \relative {c'4 d8 e8 f4}

{
\fragment
%some notes here
%some notes here
\transpose c' c, \fragment
}

And additionally, that way \fragment does not tamper with the relative
octaves of its surroundings.

-- 
David Kastrup



reply via email to

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