[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining an Ossia context
From: |
Mats Bengtsson |
Subject: |
Re: Defining an Ossia context |
Date: |
Sun, 02 Mar 2008 22:40:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20061113 Debian/1.7.8-1sarge8 |
If you try to explain what you want the new context to
do, it will be much easier to provide accurate help.
In general, I strongly recommend you to take a look at
the file ly/engraver-init.ly, where all the default contexts
are defined. For example, if you look at the definition of
the PianoStaff context, you will see how to base a new
context definition on an already existing one.
/Mats
address@hidden wrote:
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/
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user
--
=============================================
Mats Bengtsson
Signal Processing
Signals, Sensors and Systems
Royal Institute of Technology
SE-100 44 STOCKHOLM
Sweden
Phone: (+46) 8 790 8463
Fax: (+46) 8 790 7260
Email: address@hidden
WWW: http://www.s3.kth.se/~mabe
=============================================