lilypond-user
[Top][All Lists]
Advanced

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

Defining an Ossia context


From: address@hidden
Subject: Defining an Ossia context
Date: Sat, 1 Mar 2008 16:52:58 +0100 (GMT+01:00)

Afternoon.

I have been tidying up my lilypond source files and decided to try to 
be clever and define an 'ossia' context in one of my layout template 
files. I started to regret the decision when I realised I had to list 
every single engraver I would need to use (I thought that \alias Staff 
would do that - but was wrong.)

What I have done seems to work except for two things. 1) I can't get 
the slurs to display. 2) The layout engine does not allocate any 
vertical space to the Ossia and allows beams from the staff above and 
below to collide. I included the Vertically_spaced_contexts_engraver 
and Vertical_align_engraver in a fit of guess-work, but it didn't solve 
the problem.

Is there a simple solution,other than manually tweaking the system 
positions?

Regards - Dave P.


 Example below:

\version "2.11.41"
\include "English.ly"

\layout {
        % Define a context for ossia sections
        \context {
                \name Ossia
                \alias Staff
                \consists Note_heads_engraver
                \consists Text_engraver
                \consists Stem_engraver
                \consists Accidental_engraver
                \consists Staff_symbol_engraver
                \consists Rest_engraver
                \consists Slur_engraver
                \consists Spacing_engraver
                \consists Bar_engraver
                \consists Script_engraver
                \consists Font_size_engraver
                \consists Auto_beam_engraver
                \consists Key_engraver
                \consists Vertical_align_engraver
                \consists Vertically_spaced_contexts_engraver
                \type "Engraver_group"
                fontSize = #-2
                \override StaffSymbol #'staff-space = #(magstep -2)
                \override KeySignature #'stencil = ##f
        }
        \context {
                \Score
                \accepts "Ossia"
        }
}

Notes = \relative c'' {
        % snip

        % Bar 13
        cs8. d16 e8 cs a4 e8 a | 
        d,8. e16 fs8 a d4 cs8 d | 
        e4 e, e'8. cs16 b8 cs |
        <<
                { a4 a8. b16 a4 s }
                \new Ossia \with { alignAboveContext = "Main" }
                \relative c'' {
                        \key a \major
                        a8^\markup \tiny \bold "Last Time" 
                                b16 ( cs ) d e fs gs ( a-. ) r r8 s4 \bar "|."
                }
        >>
}

\score {
        \new Staff = "Main" { \clef treble \key a \major \time 4/4 \Notes }
        \layout { }
}





__________________________________________________
Up to 33% off Norton Security from Tiscali - http://www.tiscali.co.uk/securepc/





reply via email to

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