lilypond-user
[Top][All Lists]
Advanced

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

Re: alignAboveContext - don't know what I don't understand


From: James Bailey
Subject: Re: alignAboveContext - don't know what I don't understand
Date: Mon, 31 May 2010 23:10:54 +0200

I don't know which you used as your source, but the easiest to understand how this works is the section on nesting music expressions in the Learning Manual:
\new Staff = "main" {
  \relative g' {
    r4 g8 g c4 c8 d |
    e4 r8
    <<
      { f8 c c }
      \new Staff \with {
        alignAboveContext = #"main"
      } { f8 f c }
    >>
    r4 |
  }
}
"This example uses \with, which will be explained more fully later. It is a means of modifying the default behavior of a single Staff. Here it says that the new staff should be placed above the staff called “main” instead of the default position which is below."

The definitions here are really important:
A new staff named "main"
a new staff aligned above the staff named "main"

In order to use this, you have to know which contexts things are aligned to. For example:
%\version "2.12.3"
%% works:

<<
   \new Staff = "firstStaff" \new Voice = "firstVoice" { a4 g a g }
   \new Staff = "secondStaff" \with { alignAboveContext = "firstStaff" } \new Voice = "secondVoice" { f4 g f g }
   \new Lyrics \with { alignAboveContext = "firstStaff" } \lyricsto "firstVoice" \lyricmode { A G A G }
   \new Lyrics \with { alignAboveContext = "firstLyrics" } \lyricsto "secondVoice" \lyricmode { F G F G }
>>

%% doesn't work:

<<
   \new Staff = "firstStaff" \new Voice = "firstVoice" { a4 g a g }
   \new Staff = "secondStaff" \with { alignAboveContext = "firstVoice" } \new Voice = "secondVoice" { f4 g f g }
   \new Lyrics = "firstLyrics" \with { alignAboveContext = "firstVoice" } \lyricsto "firstVoice" \lyricmode { A G A G }
   \new Lyrics = "secondLyrics" \with { alignBelowContext = "firstVoice" } \lyricsto "secondVoice" \lyricmode { F G F G }
>>


Hope this helps,

James 
On 31.05.2010, at 19:01, Jay Hamilton wrote:

Thank you that worked it's not exactly that way in the example of the docs-
Should that be changed?

Jay

On Mon, May 31, 2010 at 9:10 AM, James Bailey <address@hidden> wrote:

On 30.05.2010, at 22:55, Jay Hamilton wrote:

Hello all what am I doing wrong here?
The 'ossia is below the staff and I would expect it to be above, 
Thanks Jay

\version "2.12.2"
\header {
title = "different 3/4s"
composer = "Jay Hamilton"
copyright = \markup { \tiny \override #'(baseline-skip . 0.5)
\center-column
{ "CC lic 2.5 some rights reserved Jay Hamilton 2010"
"see http://creativecommons.org/licenses/by-nd/2.5/"
} }
}
melody = \relative c'
{
\clef treble
\key c \major
\time 3/4
#(set-global-staff-size 28)
\override Staff.TimeSignature #' style = #' ()
d4 f a b, d f d f a b, d f
c e g b g b c a f e g e
d f a b, d f d f a b g e
d f a b, d f e c a g b d g2.
c,4 b a g b d c b a g b d \break
<< {
c8 f4 e b8 c8 g'4 f c8 d a'4 g d8 e b'4 c4.}
\new Staff \with {
\remove "Time_signature_engraver"
alignAboveContext = #"melody"
fontSize = #-5
\override StaffSymbol #'staff-space = #(magstep -5)
\override StaffSymbol #'thickness = #(magstep -5)
firstClef = ##f
}
{c,8 [f] ~ f [e] ~ e [b] c [g'] ~ g [f] ~ f [c]
d8 [a'] ~ a [g] ~ g [d] e [b'] ~ b [c] ~ c4 }
>> \break
e4 d8 c f,4 c' b8 a e4 b'8 a g d f4
a8 g f d e4 e'8 f e a, d4 b8 c d b g4
e8 f g e a4 b8 c f,4 e d2. b4 d f
d f a g, b d b d f c e g b g e
f4 a c e d c b d g, b d f, b d e,
a c d, g b c, f a c,
e g c, b d b c2.

\bar "|."
}
\score {
\new Staff \melody
\layout { }

}

I think it should work if you have \new Staff = "melody"



--
Jay Hamilton Sound and Silence www.soundand.com 206-328-7694


reply via email to

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