property): fix references.
* lily/staff-symbol.cc (print): only add extent if non empty.
This fixes staff-container.ly.
* lily/timing-engraver.cc (initialize): init whichBar, so a score
starting with a mmrest also works.
2004-03-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * Documentation/user/changing-defaults.itely (Determining the grob
+ property): fix references.
+
+ * lily/staff-symbol.cc (print): only add extent if non empty.
+ This fixes staff-container.ly.
+
+ * lily/timing-engraver.cc (initialize): init whichBar, so a score
+ starting with a mmrest also works.
+
* scripts/lilypond-book.py (Lilypond_snippet.is_outdated): require
PNG for texinfo too.
@result{} #13
@end lisp
-These calculations are examples of evaluations: an expression (like
+These calculations are examples of evaluations: an expression like
@code{(* 3 4)} is replaced by its value @code{12}. A similar thing
happens with variables. After defining a variable
We have been using lists all along. A calculation, like @code{(+ 1
2)} is also a list (containing the symbol @code{+} and the numbers 1
-and 2). For entering lists, use a quote @code{'} and for
-calculations, do not use a quote.
+and 2). Normally lists are interpreted as calculations, and the Scheme
+interpreter substitutes the outcome of the calculation. To enter a
+list, we stop evaluation. This is done by quoting the list with a
+quote @code{'} symbol. For calculations, do not use a quote.
Inside a quoted list or pair, there is no need to quote anymore. The
following is a pair of symbols, a list of symbols and a list of lists
Translation @arrow{} Context.
@end ifnothtml
-[TODO: describe propagation]
+@c [TODO: describe propagation]
@menu
@end lilypond
In the second stave there are no time signature or clef symbols. This
-is a rather crude method of making objects disappear, it will affect the
-entire staff. The spacing will be adversely influenced too. More
-sophisticated methods of blanking objects are shown in (TODO).
+is a rather crude method of making objects disappear, it will affect
+the entire staff. The spacing will be adversely influenced too. A more
+sophisticated methods of blanking objects is shown in @ref{Common
+tweaks}.
The next example shows a practical application. Bar lines and time
signatures are normally synchronized across the score. This is done
Here @var{name} is the name of a graphical object, like @code{Stem} or
@code{NoteHead}. @var{property} is an internal variable of the
formatting system (`grob property' or `layout property'). It is a
-symbol, so it must be quoted. The subsection refTODO explains what to
-fill in for @var{name}, @var{property} and @var{value}. Here we only
-discuss functionality of this command.
+symbol, so it must be quoted. The subsection @ref{Constructing a
+tweak} explains what to fill in for @var{name}, @var{property} and
+@var{value}. Here we only discuss functionality of this command.
The command
and they are exactly matched to LilyPond version installed.
-
-@c [TODO: revise for new site.]
-
@node Navigating the program reference
@subsection Navigating the program reference
ictus, circulus, semicirculus, accentus, episem.
+"}
+
+%{
+
TODO: augmentum. Syntax: either as bracket (\augmentumInitium,
\augmentumFinis), or as head prefix with subsequently collecting all
dots and putting them behind the ligature in a vertical row.
FIXME: episem stops one notehead too early.
-"}
+%}
\include "gregorian-init.ly"
\header { texidoc = "@cindex Script Priority
Relative placements of different script types can be controlled
-by overriding @code{script-priority}. "
+by overriding @code{script-priority}.
+
+In this example, accidentals are put either below or above other
+script symbols.
+
+"
}
\context Staff \notes \relative g''{
\override Score.TextScript #'script-priority = #-100
- a4^\prall^\markup \fontsize #-2 \semisharp
+ a4^\prall^\markup { \sharp }
\override Score.Script #'script-priority = #-100
\revert Score.TextScript #'script-priority
- a4^\prall^\markup \fontsize #-2 \semisharp
+ a4^\prall^\markup { \sharp }
}
\paper { raggedright = ##t}
}
"
}
\score{
- \notes{
+ \notes\relative c'{
c( d e c) |
\slurDotted
c( d e c) |
c( d e c) |
}
\paper{ raggedright=##t }
-% indent = 0.0\pt
- %for broken!
- % linewidth= 30.\mm
-% }
}
}
-%% This slur does not look good. Looks like there have not been a line
-%% break at some point, it is then added, but the slur does not break
-%% in the case of a line break. -HJJ
+\score {
+ \notes \new PianoStaff
+ <<
+ \context Staff = up {
+ \clef bass
+ s1 * 4
+ }
+ \context Staff = down \relative c <<
+ s1*4
+ {
+ \clef bass
+ r4 r8
+ \once\override Slur #'extra-offset = #'(0 . -8)
+ \once\override Slur #'control-points =
+ #'((0 . -4) (2 . 0) (60 . 0) (63 . 4))
+ c8( as' f c' as
+
+ % line breaks will mess up this example
+ \noBreak
+ f c as' f
+ \change Staff = up
+ \clef treble
+ c' as f' c
+ \noBreak
+ as' f c' as
+ f' c as' f c'4)
+ }>>
+ >>
+ \paper { raggedright = ##t }
+}
-\score {\notes \new PianoStaff <<
- \context Staff = up { \clef bass s1 * 6 }
- \context Staff = down \relative c {
- \clef bass
- r4 r8
- \once\override Slur #'extra-offset = #'(0 . -8)
- \once\override Slur #'control-points =
- #'((0 . -4) (2 . 0) (60 . 0) (63 . 4))
- c8( as' f c' as f c as' f
- \change Staff = up
- \clef treble
- c' as f' c as' f c' as
- f' c as' f c'4)
- }>>
-\paper { raggedright = ##t }
- }
\score {
- \notes \relative c'' <<
+ \notes \relative c'' <<
\new StaffContainer {
%% need << >>, otherwise we descend to the voice inside SA
<< \context Staff { e d f \bar ":|" } >>
\skip 4
}
- >>
+ >>
-\paper {
+ \paper {
\context {
- \ScoreContext
- \accepts StaffContainer
- \denies Staff
+ \ScoreContext
+ \accepts StaffContainer
+ \denies Staff
}
\context {
- \type Engraver_group_engraver
- \consists Clef_engraver
- \consists Time_signature_engraver
- \consists Separating_line_group_engraver
- \consistsend "Axis_group_engraver"
- \accepts "Staff"
-
- \name StaffContainer
+ \type Engraver_group_engraver
+ \consists Clef_engraver
+ \consists Time_signature_engraver
+ \consists Separating_line_group_engraver
+ \consistsend "Axis_group_engraver"
+ \accepts "Staff"
+
+ \name StaffContainer
}
\context {
- \StaffContext
- \remove Axis_group_engraver
- \remove Separating_line_group_engraver
- \remove Clef_engraver
- \remove Time_signature_engraver
+ \StaffContext
+ \remove Axis_group_engraver
+ \remove Separating_line_group_engraver
+ \remove Clef_engraver
+ \remove Time_signature_engraver
}
raggedright=##t
-}
+ }
}
{
Item * x = sp->get_bound (d);
- if (x->break_status_dir ())
- span_points[d] = x->relative_coordinate (common , X_AXIS);
- else
- span_points[d] = x->extent (common, X_AXIS)[d];
+ span_points[d] = x->relative_coordinate (common , X_AXIS);
+ if (!x->break_status_dir ()
+ && !x->extent (x, X_AXIS).is_empty ())
+ span_points[d] += x->extent (x, X_AXIS)[d];
}
}
while (flip (&d) !=LEFT);
Moment last_moment_;
virtual void start_translation_timestep ();
+ virtual void initialize ();
virtual void stop_translation_timestep ();
public:
}
+void
+Timing_engraver::initialize ()
+{
+ Timing_translator::initialize ();
+
+ SCM which = get_property ("whichBar");
+ Moment now = now_mom ();
+
+ /* Set the first bar of the score? */
+ if (!gh_string_p (which))
+ which = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
+ ? SCM_EOL : scm_makfrom0str ("|");
+
+ daddy_context_->set_property ("whichBar", which);
+}
+
void
Timing_engraver::start_translation_timestep ()
/* Set the first bar of the score? */
if (!gh_string_p (which))
- which
- = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
- ? SCM_EOL : scm_makfrom0str ("|");
+ which = SCM_EOL;
Moment mp = measure_position ();
bool start_of_measure = (last_moment_.main_part_ != now.main_part_