* August S.Sigov <august@infran.ru> Russian translation
* Rune Zedeler <rune@zedeler.dk> Drum notation, beaming and
- accidental fixes
+ auto-accidental changes. Font updates. Misc fixes.
+2002-03-21 Han-Wen <hanwen@cs.uu.nl>
+
+ * VERSION: 1.5.45 released
+
+ * input/regression/system-extents.ly: new regression test. Test
+ System extents.
+
+ * lily/system.cc: rename LineOfScore into System
+
+ * lily/molecule.cc (ly_add_molecule): new Scheme ly-add-molecule.
+
+ * lily/grob.cc (ly_get_parent): new Scheme function ly-get-parent.
+ (ly_get_extent): new Scheme function ly-get-extent
+
+ * ps/lilyponddefs.ps: use output-scale for line-x
+ definition.
+
+ * scm/ps.scm (font-load-command):
+ use output-scale
+
+2002-03-20 Rune Zedeler <rune@zedeler.dk>
+
+ * lily/beaming-info.cc: Stupid typo fixed
+
+ * lily/accidental-engraver.cc: rewrote accidental-routines to get
+ support for cross-context auto-accidentals.
+ Now the engraver can stay in Staff-context and see other contexts
+ from there.
+ Changed properties: autoAccidentals, autoCautionaries
+
+ * lily/translator-group.cc (set_children_property):
+ Function added recursively setting the same property (deep_copied)
+ for all children of a Translator_group.
+
+ * ly/property-init.ly: added commands
+ \pianoAccidentals \voiceAccidentals
+ \modernVoiceAccidentals \modernVoiceCautionaries
+
+ * ly/engraver-init.ly: Correct initialization of new accidentals.
+
+ * scm/translator-property-description.scm: Updated
+
+ * input/regression/accidental-voice.ly: Added
+
+ * Documentation/regression-test.tely: Added new test
+
2002-03-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* VERSION: 1.5.44 released
@lilypondfile[printfilename]{accidental-octave.ly}
+@lilypondfile[printfilename]{accidental-voice.ly}
+
@section Stems
@lilypondfile[printfilename]{font-magnification.ly}
+@lilypondfile[printfilename]{system-extents.ly}
+
@lilypondfile[printfilename,nofragment]{size11.ly}
@lilypondfile[printfilename,nofragment]{size13.ly}
@item @email{august@@infran.ru, August S.Sigov}
Russian translation
@item @email{rune@@zedeler.dk, Rune Zedeler}
- Drum notation, beaming and accidental fixes
+ Drum notation, beaming and auto-accidental changes. Font updates. Misc fixes.
@end itemize
@bye
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=5
-PATCH_LEVEL=44
+PATCH_LEVEL=45
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
editor = "August Wenzinger"
source= "B\\\"arenreiter Urtext"
- texidoc = "The B\\\"arenreiter edition of the Cello Suites is the most
-beautifully typeset piece of music in our collection of music (we both
-own one. It is also lovely on French Horn). This piece follows the
-same beaming as the printed edition. This is done in order to
-benchmarkk the quality of the LilyPond output. As of lilypond 1.5.38,
-the spacing is almost identical. With a line-break forced before
-measure 25, we get back the linebreaking of Baerenreiter.
-
-
-
-This file used to show spacing weaknesses. Now it shows weaknesses in
-slur handling.
-
-Note that the Barenreiter edition contains an engraving mistake. The
-second line begins with measure 6 (but prints 5).
-
-"
-
+ texidoc = "The B\\\"arenreiter edition of the Cello Suites is the
+most beautifully typeset piece of music in our collection of music (we
+both own one. It is also lovely on French Horn). This piece does not
+include articulation, but it does follows the same beaming and
+linebreaking as the printed edition. This is done in order to
+benchmark the quality of the LilyPond output.
+
+As of lilypond 1.5.42, the spacing and beam quanting is almost
+identical.
+
+There are two tweaks in this file: a line-break was forced before
+measure 25, we get back the linebreaking of Baerenreiter. The stem
+direction is forced in measure 24. The last beam of that measure is up
+in Baerenreiter because of context. We don't detect that yet.
+
+Note that the Barenreiter edition contains a few engraving
+mistakes. The second line begins with measure 6 (but prints 5). The |:
+half way in measure 13 has been forgotten.
+ "
}
g8 bes16()a c()bes a()g d'8 f, |
< e4.-\trill
- \\ <a,,4 e'> >
+ \\ <c,4 g'> >
[d8 c bes]
%%8
< { f'8 g16()a a4. g16()f |
fis8.-\trill es16 d8 c |
[bes g']
- \stemUp
[a, fis']
- \stemBoth
[es' d] |
%%16
< bes4.-\trill d, g, > [a8 g f!] |
-\version "1.5.24.rz2"
+\version "1.5.43.rz1"
\header {
texidoc="
This shows how accidentals in different octaves are handled.
+Fixme: Shorten and docu
"
}
mus = \notes {
\mel
\property Score.oneMeasureLazy = ##t
- \property Score.autoAccidentals = #'((measure-same-octave . 0))
- < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 0))" \mel >
- \property Score.autoAccidentals = #'((measure-same-octave . 1))
- < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 1))" \mel >
- \property Score.autoAccidentals = #'((measure-any-octave . 0))
- < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 0))" \mel >
- \property Score.autoAccidentals = #'((measure-any-octave . 1))
- < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 1))" \mel >
+ \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+ < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 0))" \mel >
+ \property Score.autoAccidentals = #'(Staff (same-octave . 1))
+ < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 1))" \mel >
+ \property Score.autoAccidentals = #'(Staff (any-octave . 0))
+ < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 0))" \mel >
+ \property Score.autoAccidentals = #'(Staff (any-octave . 1))
+ < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 1))" \mel >
\modernAccidentals
< s1^""^""^"$\\backslash$modernAccidentals" \mel >
\modernCautionaries
--- /dev/null
+\version "1.5.43.rz1"
+
+\header{
+texidoc="
+This shows how modern cross voice auto cautionary accidentals are handled.
+The first two fisses get accidentals because they belong to different voices.
+The first f gets cautionary natural because of previous measure.
+The last f gets cautionary natural because fis was only in the other voice.
+"
+}
+
+#(define (lo-octave p)
+ (let* ((a (pitch-alteration p))
+ (n (pitch-notename p)))
+ (make-pitch -1 n a)))
+
+#(define (no-octaves music)
+ (let* ((es (ly-get-mus-property music 'elements))
+ (e (ly-get-mus-property music 'element))
+ (p (ly-get-mus-property music 'pitch)))
+
+ (if (pair? es)
+ (ly-set-mus-property
+ music 'elements
+ (map no-octaves es)))
+
+ (if (music? e)
+ (ly-set-mus-property
+ music 'element
+ (no-octaves e)))
+
+ (if (pitch? p)
+ (begin
+ (set! p (lo-octave p))
+ (ly-set-mus-property music 'pitch p)))
+
+
+ music))
+
+voicea = \notes \transpose c'' {
+ \stemUp
+ fis2 a2 f4 fis a2
+}
+voiceb = \notes \transpose c'' {
+ \stemDown
+ c2 fis2 f4 c f2
+}
+
+\score {
+ <
+ \notes
+ \context NoteNames=namesa \apply #no-octaves \voicea
+ \context Staff <
+ \modernVoiceCautionaries
+ \context Voice = voicea \voicea
+ \context Voice = voiceb \voiceb
+ >
+ \context NoteNames=namesb \apply #no-octaves \voiceb
+ >
+}
-\version "1.5.24.rz2"
+\version "1.5.43.rz1"
\header{
texidoc="
\context Staff \transpose c''' {
\mel
\property Score.oneMeasureLazy = ##t
- \property Score.autoAccidentals = #'((measure-same-octave . 0))
- < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 0))" \mel >
- \property Score.autoAccidentals = #'((measure-same-octave . 1))
- < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 1))" \mel >
- \property Score.autoAccidentals = #'((measure-any-octave . 0))
- < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 0))" \mel >
- \property Score.autoAccidentals = #'((measure-any-octave . 1))
- < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 1))" \mel >
+ \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+ < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 0))" \mel >
+ \property Score.autoAccidentals = #'(Staff (same-octave . 1))
+ < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 1))" \mel >
+ \property Score.autoAccidentals = #'(Staff (any-octave . 0))
+ < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 0))" \mel >
+ \property Score.autoAccidentals = #'(Staff (any-octave . 1))
+ < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 1))" \mel >
\modernAccidentals
< s1^"$\\backslash$modernAccidentals" \mel >
\modernCautionaries
--- /dev/null
+\header {
+
+ texidoc = "LilyPond correctly determines the size of every
+ system. This includes postscript constructs such as slurs."
+
+ }
+
+\score { \notes
+\context Voice
+{\slurDown c4 ( g4 ) c''4
+
+}
+
+ \paper {
+ \translator {
+ \ScoreContext
+ System \override #'molecule-callback = #box-grob-molecule
+ }
+ }
+}
"
}
-#(define (box-molecule xext yext)
- (ly-make-molecule
- (list 'filledbox (- (car xext)) (cdr xext)
- (- (car yext)) (cdr yext))
- xext yext)
-)
-
-#(define (widen-interval iv amount)
- (cons (- (car iv) amount)
- (+ (cdr iv) amount))
-)
-
#(define (make-molecule-boxer callback)
(define (molecule-boxer grob)
(let*
accidental-engraver.cc -- implement accidental_engraver
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Modified 2001 by Rune Zedeler <rz@daimi.au.dk>
+ Modified 2001-2002 by Rune Zedeler <rz@daimi.au.dk>
*/
#include "musical-request.hh"
#include "arpeggio.hh"
#include "warn.hh"
+#include "translator-group.hh"
+
/**
virtual void finalize ();
public:
- // todo -> property
+ // todo -> property (why? -rz)
SCM last_keysig_;
/*
Link_array<Grob> head_l_arr_;
Link_array<Item> forced_l_arr_;
Link_array<Grob> tie_l_arr_;
+ Link_array<Translator_group> origin_l_arr_;
};
Accidental_engraver::initialize ()
{
last_keysig_ = get_property ("keySignature");
- daddy_trans_l_->set_property ("localKeySignature", last_keysig_);
+
+ Translator_group * trans_ = daddy_trans_l_;
+ while (trans_) {
+ trans_ -> set_property ("localKeySignature", ly_deep_copy(last_keysig_));
+ trans_ = trans_->daddy_trans_l_;
+ }
+ daddy_trans_l_->set_children_property("localKeySignature",last_keysig_);
+
}
/** calculates the number of accidentals on basis of the current local key sig
- * (passed as argument).
+ * (passed as argument)
* Returns number of accidentals (0, 1 or 2).
* Negative (-1 or -2) if accidental has changed.
**/
+// FIXME: Use references for SCM-values
static int
number_accidentals (SCM sig, Note_req * note_l, SCM curbarnum, SCM lazyness,
bool ignore_octave_b)
return a==p ? num : -num;
}
-static int
-number_accidentals (SCM localsig, Note_req * note_l, SCM accidentals_l,
- SCM curbarnum) {
+int
+number_accidentals (Note_req * note_l, Translator_group * origin_l,
+ SCM accidentals_sl, SCM curbarnum_s) {
int number=0;
int diff=0;
- while(gh_pair_p(accidentals_l)) {
- if(gh_pair_p(ly_car(accidentals_l))) {
- SCM type = gh_caar(accidentals_l);
- SCM lazyness = gh_cdar(accidentals_l);
- bool measure_same_octave_b =
- gh_eq_p(ly_symbol2scm("measure-same-octave"),type);
- bool measure_any_octave_b =
- gh_eq_p(ly_symbol2scm("measure-any-octave"),type);
- if(measure_same_octave_b || measure_any_octave_b) {
+ if(gh_pair_p(accidentals_sl) && !gh_symbol_p(ly_car(accidentals_sl)))
+ warning(_f("Accidental typesetting list must begin with context-name: %s",
+ ly_scm2string(ly_car(accidentals_sl)).ch_C()));
+ while(gh_pair_p(accidentals_sl) && origin_l) {
+ // If pair then it is a new accidentals typesetting rule to be checked
+ if(gh_pair_p(ly_car(accidentals_sl))) {
+ SCM type = gh_caar(accidentals_sl);
+ SCM lazyness = gh_cdar(accidentals_sl);
+ SCM localsig = origin_l->get_property ("localKeySignature");
+ bool same_octave_b =
+ gh_eq_p(ly_symbol2scm("same-octave"),type);
+ bool any_octave_b =
+ gh_eq_p(ly_symbol2scm("any-octave"),type);
+ if(same_octave_b || any_octave_b) {
int n = number_accidentals
- (localsig,note_l,curbarnum,lazyness,measure_any_octave_b);
+ (localsig,note_l,curbarnum_s,lazyness,any_octave_b);
diff |= n<0;
number = max(number,abs(n));
}
- else warning(_f("unknown accidental typesetting: %s",
+ else warning(_f("unknown accidental typesetting: %s. Ignored",
ly_symbol2string(type).ch_C()));
}
- else warning(_f("Accidental typesetting must be pair: %s",
- ly_scm2string(ly_car(accidentals_l)).ch_C()));
- accidentals_l = ly_cdr(accidentals_l);
+ // if symbol then it is a context name. Scan parent contexts to find it.
+ else if (gh_symbol_p(ly_car(accidentals_sl))) {
+ String context = ly_symbol2string(ly_car(accidentals_sl));
+ while (origin_l && !origin_l->is_alias_b(context)) {
+ origin_l = origin_l->daddy_trans_l_;
+ }
+ if (!origin_l)
+ warning(_f("Symbol is not a parent context: %s. Ignored",
+ context.ch_C()));
+ }
+ else warning(_f("Accidental typesetting must be pair or context-name: %s",
+ ly_scm2string(ly_car(accidentals_sl)).ch_C()));
+ accidentals_sl = ly_cdr(accidentals_sl);
}
return diff ? -number : number;
}
{
if (!key_item_p_ && mel_l_arr_.size ())
{
- SCM localsig = get_property ("localKeySignature");
- SCM accidentals_l = get_property ("autoAccidentals");
- SCM cautionaries_l = get_property ("autoCautionaries");
+ //SCM localsig = get_property ("localKeySignature");
+ SCM accidentals_sl = get_property ("autoAccidentals");
+ SCM cautionaries_sl = get_property ("autoCautionaries");
SCM barnum = get_property ("currentBarNumber");
bool extra_natural_b = get_property ("extraNatural")==SCM_BOOL_T;
{
Grob * support_l = head_l_arr_[i];
Note_req * note_l = mel_l_arr_[i];
+ Translator_group * origin_l = origin_l_arr_[i];
- int num = number_accidentals(localsig,note_l,accidentals_l,barnum);
- int num_caut = number_accidentals(localsig,note_l,cautionaries_l,barnum);
+ int num = number_accidentals(note_l,origin_l,accidentals_sl,barnum);
+ int num_caut = number_accidentals(note_l,origin_l,cautionaries_sl,barnum);
bool cautionary = to_boolean (note_l->get_mus_property ("cautionary"));
if (abs(num_caut)>abs(num))
{
Grob *tie_break_reminder = 0;
bool tie_changes = false;
- for (int i=0; i < tie_l_arr_.size (); i++)
- if (support_l == Tie::head (tie_l_arr_[i], RIGHT))
+ for (int j=0; j < tie_l_arr_.size (); j++)
+ if (support_l == Tie::head (tie_l_arr_[j], RIGHT))
{
tie_changes = different;
/* Enable accidentals for broken tie
Maybe check property noTieBreakForceAccidental? */
if (different)
- tie_break_reminder = tie_l_arr_[i];
+ tie_break_reminder = tie_l_arr_[j];
break;
}
int n = pitch->notename_i_;
int o = pitch->octave_i_;
int a = pitch->alteration_i_;
- SCM on = gh_cons (gh_int2scm (o), gh_int2scm (n));
- if (tie_changes)
- {
- /*
- Remember an alteration that is different both from
- that of the tied note and of the key signature.
- */
- localsig = ly_assoc_front_x
- (localsig, on, gh_cons(SCM_BOOL_T,barnum));
- }
- else
- {
- /*
- not really really correct if there are more than one
- noteheads with the same notename.
- */
- localsig = ly_assoc_front_x
- (localsig, on, gh_cons(gh_int2scm (a),barnum));
- }
- }
-
- daddy_trans_l_->set_property ("localKeySignature", localsig);
+ SCM on_s = gh_cons (gh_int2scm (o), gh_int2scm (n));
+
+ /*
+ TODO: Speed this up!
+ Perhaps only check translators mentioned in the auto-accidentals?
+ -rz
+ */
+ Translator_group * trans_ = origin_l_arr_[i];
+ while (trans_) {
+ SCM localsig = trans_->get_property ("localKeySignature");
+ if (tie_changes)
+ {
+ /*
+ Remember an alteration that is different both from
+ that of the tied note and of the key signature.
+ */
+ localsig = ly_assoc_front_x
+ (localsig, on_s, gh_cons(SCM_BOOL_T,barnum));
+ }
+ else
+ {
+ /*
+ not really really correct if there are more than one
+ noteheads with the same notename.
+ */
+ localsig = ly_assoc_front_x
+ (localsig, on_s, gh_cons(gh_int2scm (a),barnum));
+ }
+ trans_->set_property ("localKeySignature", localsig);
+ trans_ = trans_->daddy_trans_l_;
+ }
+ }
}
-
+
if (key_item_p_)
{
arpeggios_.clear ();
tie_l_arr_.clear ();
head_l_arr_.clear ();
- forced_l_arr_.clear ();
+ forced_l_arr_.clear ();
+ origin_l_arr_.clear ();
}
void
{
mel_l_arr_.push (note_l);
head_l_arr_.push (info.grob_l_);
+ origin_l_arr_.push (info.origin_trans_l_->daddy_trans_l_);
}
else if (Tie::has_interface (info.grob_l_))
{
SCM sig = get_property ("keySignature");
- /* Detect key sig changes. */
- if (last_keysig_ != sig)
- {
- daddy_trans_l_->set_property ("localKeySignature", ly_deep_copy (sig));
- last_keysig_ = sig;
+ /* Detect key sig changes.
+ Update all parents and children
+ */
+ if (last_keysig_ != sig) {
+ Translator_group * trans_ = daddy_trans_l_;
+ while (trans_) {
+ trans_ -> set_property ("localKeySignature", ly_deep_copy(sig));
+ trans_ = trans_->daddy_trans_l_;
}
+ daddy_trans_l_->set_children_property("localKeySignature",sig);
+
+ last_keysig_ = sig;
+ }
}
ENTER_DESCRIPTION(Accidental_engraver,
+/* The FIXME below is deprecated and should be removed. -rz */
/* descr */ "Make accidentals. Catches note heads, ties and notices key-change
events. Due to interaction with ties (which don't come together
with note heads), this needs to be in a context higher than Tie_engraver. FIXME",
beat_pos = infos_[i].start_mom_ / beat_length;
int den = beat_pos.den ();
if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && !subdivide)
- den *= 4;
+ den *= 2;
if (den < minden)
{
minidx = i;
/*
Puts the k, v in the immutable_property_alist_, which is convenient for
storing variables that are needed during the breaking process. (eg.
- Line_of_score::rank : int)
+ System::rank : int)
*/
void
Grob::set_immutable_grob_property (const char*k, SCM v)
-Line_of_score *
+System *
Grob::line_l () const
{
return 0;
}
else
{
- Line_of_score * line
- = dynamic_cast<Line_of_score*> (unsmob_grob (criterion));
+ System * line
+ = dynamic_cast<System*> (unsmob_grob (criterion));
if (sc->line_l () != line)
{
sc = sc->find_broken_piece (line);
for (int i = 0; i< s->broken_into_l_arr_ .size (); i++)
{
Grob * sc = s->broken_into_l_arr_[i];
- Line_of_score * l = sc->line_l ();
+ System * l = sc->line_l ();
sc->mutable_property_alist_ =
handle_broken_grobs (mutable_property_alist_,
l ? l->self_scm () : SCM_UNDEFINED);
}
- Line_of_score *line = line_l ();
+ System *line = line_l ();
if (line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS))
{
= handle_broken_grobs (mutable_property_alist_,
line ? line->self_scm () : SCM_UNDEFINED);
}
- else if (dynamic_cast <Line_of_score*> (this))
+ else if (dynamic_cast <System*> (this))
{
mutable_property_alist_ = handle_broken_grobs (mutable_property_alist_,
SCM_UNDEFINED);
This element is `invalid'; it has been removed from all
dependencies, so let's junk the element itself.
- do not do this for Line_of_score, since that would remove
+ do not do this for System, since that would remove
references to the originals of score-elts, which get then GC'd
(a bad thing.)
*/
}
Grob*
-Grob::find_broken_piece (Line_of_score*) const
+Grob::find_broken_piece (System*) const
{
return 0;
}
+SCM
+ly_get_extent (SCM grob, SCM refp, SCM axis)
+{
+ Grob * sc = unsmob_grob (grob);
+ Grob * ref = unsmob_grob (refp);
+ SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
+ SCM_ASSERT_TYPE(ref, refp, SCM_ARG2, __FUNCTION__, "grob");
+
+ SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+
+ return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
+}
+
+SCM
+ly_get_parent (SCM grob, SCM axis)
+{
+ Grob * sc = unsmob_grob (grob);
+ SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
+ SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+
+ return sc->get_parent (Axis (gh_scm2int (axis)))->self_scm();
+}
+
+
static void
init_functions ()
{
(Scheme_function_unknown)ly_set_grob_property);
scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0,
(Scheme_function_unknown) spanner_get_bound);
- scm_c_define_gsubr ("ly-get-paper-variable", 2 , 0, 0,
- (Scheme_function_unknown) ly_get_paper_var);
+ scm_c_define_gsubr ("ly-get-extent", 3, 0, 0,
+ (Scheme_function_unknown) ly_get_extent);
+ scm_c_define_gsubr ("ly-get-parent", 2, 0, 0,
+ (Scheme_function_unknown) ly_get_parent);
}
bool
add a dependency. It may be the 0 pointer, in which case, it is ignored.
*/
void add_dependency (Grob*);
- virtual Line_of_score * line_l () const;
+ virtual System * line_l () const;
bool linked_b () const;
static SCM handle_broken_grobs(SCM, SCM criterion);
virtual void do_break_processing ();
- virtual Grob *find_broken_piece (Line_of_score*) const;
+ virtual Grob *find_broken_piece (System*) const;
virtual void discretionary_processing ();
virtual SCM do_derived_mark ();
Direction break_status_dir () const;
Item * find_prebroken_piece (Direction) const;
- Grob * find_broken_piece (Line_of_score*) const;
+ Grob * find_broken_piece (System*) const;
- virtual Line_of_score * line_l () const;
+ virtual System * line_l () const;
virtual Paper_column * column_l () const;
virtual void handle_prebroken_dependencies ();
protected:
class Keyword_ent;
class Keyword_table;
class Line_group_engraver_group;
-class Line_of_score;
+class System;
class Local_key_item;
class Lookup;
class Lyric_combine_music;
#include "column-x-positions.hh"
#include "spanner.hh"
-class Line_of_score : public Spanner
+class System : public Spanner
{
public:
int rank_i_;
void post_processing (bool);
- Line_of_score (SCM);
+ System (SCM);
/// is #c# contained in #*this#?
bool contains_b (Paper_column const *c) const;
int element_count () const;
int rank_i_;
virtual void do_break_processing ();
virtual Paper_column *column_l () const;
- virtual Line_of_score *line_l () const;
+ virtual System *line_l () const;
/// if lines are broken then this column is in #line#
- Line_of_score *line_l_;
+ System *line_l_;
static int rank_i (Grob*);
Paper_def *paper_l_;
Paper_outputter *outputter_l_;
- Line_of_score * line_l_;
+ System * line_l_;
Paper_score ();
int find_col_idx (Paper_column const *) const;
Link_array<Item> broken_col_range (Item const*,Item const*) const;
- void typeset_line (Line_of_score*);
+ void typeset_line (System*);
protected:
/* MAIN ROUTINES */
class Score_engraver :
public Engraver_group_engraver, public Global_translator
{
- Line_of_score * scoreline_l_;
+ System * scoreline_l_;
int breaks_i_;
Link_array<Grob> elem_p_arr_;
Real spanner_length () const;
static int compare (Spanner * const &,Spanner * const &);
- virtual Grob* find_broken_piece (Line_of_score*) const;
+ virtual Grob* find_broken_piece (System*) const;
virtual SCM do_derived_mark ();
protected:
void set_my_columns ();
VIRTUAL_COPY_CONS (Grob);
virtual void do_break_processing ();
- virtual Line_of_score*line_l () const;
+ virtual System*line_l () const;
};
// egcs
typedef void (Translator::*Method_pointer) (void);
#define set_property(x,y) internal_set_property(ly_symbol2scm(x),y)
+#define set_children_property(x,y) internal_set_children_property(ly_symbol2scm(x),y)
class Scheme_hash_table;
void unset_property (SCM var_sym);
void internal_set_property (SCM var_sym, SCM value);
+ void internal_set_children_property (SCM var_sym, SCM value);
Translator_group *where_defined (SCM name_sym) const;
String id_str_;
return parent ? parent->column_l () : 0;
}
-Line_of_score *
+System *
Item::line_l () const
{
Grob *g = get_parent (X_AXIS);
}
Grob*
-Item::find_broken_piece (Line_of_score*l) const
+Item::find_broken_piece (System*l) const
{
if (line_l () == l)
return (Item*) (this);
+++ /dev/null
-/*
- scoreline.cc -- implement Line_of_score
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "input-smob.hh"
-#include "axis-group-interface.hh"
-#include "debug.hh"
-#include "line-of-score.hh"
-#include "main.hh"
-#include "paper-column.hh"
-#include "paper-def.hh"
-#include "paper-outputter.hh"
-#include "paper-score.hh"
-#include "string.hh"
-#include "warn.hh"
-#include "dimensions.hh"
-#include "molecule.hh"
-#include "all-font-metrics.hh"
-
-// todo: use map.
-void
-fixup_refpoints (SCM s)
-{
- for (; gh_pair_p (s); s = ly_cdr (s))
- {
- Grob::fixup_refpoint (ly_car (s));
- }
-}
-
-
-Line_of_score::Line_of_score (SCM s)
- : Spanner (s)
-{
- rank_i_ = 0;
-
- Axis_group_interface::set_interface (this);
- Axis_group_interface::set_axes (this, Y_AXIS,X_AXIS);
-}
-
-int
-Line_of_score::element_count () const
-{
- return scm_ilength (get_grob_property ("all-elements"));
-}
-
-void
-Line_of_score::typeset_grob (Grob * elem_p)
-{
- elem_p->pscore_l_ = pscore_l_;
- Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"),elem_p);
- scm_gc_unprotect_object (elem_p->self_scm ());
-}
-
-void
-Line_of_score::output_lines ()
-{
- for (SCM s = get_grob_property ("all-elements");
- gh_pair_p (s); s = ly_cdr (s))
- {
- unsmob_grob (ly_car (s))->do_break_processing ();
- }
-
- /*
- fixups must be done in broken line_of_scores, because new elements
- are put over there. */
- int count = 0;
- for (int i=0; i < broken_into_l_arr_.size (); i++)
- {
- Grob *se = broken_into_l_arr_[i];
- SCM all = se->get_grob_property ("all-elements");
- for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
- {
- fixup_refpoint (ly_car (s));
- }
- count += scm_ilength (all);
- }
-
- /*
- needed for doing items.
- */
- fixup_refpoints (get_grob_property ("all-elements"));
-
-
- for (SCM s = get_grob_property ("all-elements");
- gh_pair_p (s); s = ly_cdr (s))
- {
- unsmob_grob (ly_car (s))->handle_broken_dependencies ();
- }
- handle_broken_dependencies ();
-
- if (verbose_global_b)
- progress_indication (_f ("Element count %d.", count + element_count ()));
-
-
- for (int i=0; i < broken_into_l_arr_.size (); i++)
- {
- Line_of_score *line_l = dynamic_cast<Line_of_score*> (broken_into_l_arr_[i]);
-
- if (verbose_global_b)
- progress_indication ("[");
- line_l->post_processing (i+1 == broken_into_l_arr_.size ());
-
- if (verbose_global_b)
- {
- progress_indication (to_str (i));
- progress_indication ("]");
- }
-
- if (i < broken_into_l_arr_.size () - 1)
- {
- SCM lastcol = ly_car (line_l->get_grob_property ("columns"));
- Grob* e = unsmob_grob (lastcol);
-
- SCM between = ly_symbol2scm ("between-system-string");
- SCM inter = e->internal_get_grob_property (between);
- if (gh_string_p (inter))
- {
- pscore_l_->outputter_l_
- ->output_scheme (scm_list_n (between,
- inter, SCM_UNDEFINED));
- }
- }
- }
-}
-
-
-
-
-/*
- Find the loose columns in POSNS, and drape them around the columns
- specified in BETWEEN-COLS. */
-void
-set_loose_columns (Line_of_score* which, Column_x_positions const *posns)
-{
- for (int i = 0; i < posns->loose_cols_.size (); i++)
- {
- int divide_over = 1;
- Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
- Paper_column* col = dynamic_cast<Paper_column*> (loose);
-
- if (col->line_l_)
- continue;
-
-
- Item * left = 0;
- Item * right = 0;
- do
- {
- SCM between = loose->get_grob_property ("between-cols");
- if (!gh_pair_p (between))
- break;
-
-
- Item * l=dynamic_cast<Item*> (unsmob_grob (ly_car (between)));
- Item * r=dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
-
- if (!(l && r))
- break ;
-
- if (!left && l)
- {
- left = l->column_l ();
- }
-
- divide_over ++;
-
- loose = right = r->column_l ();
- }
- while (1);
-
-
-#if 0
- Real rx = right->relative_coordinate (right->get_parent (X_AXIS), X_AXIS);
- Real lx = left->relative_coordinate (left->get_parent (X_AXIS), X_AXIS);
-
- /*
- divide space equally over loose columns.
- */
- int j = 1;
- loose = col;
- while (1)
- {
- SCM between = loose->get_grob_property ("between-cols");
- if (!gh_pair_p (between))
- break;
-
- Paper_column *thiscol = dynamic_cast<Paper_column*> (loose);
-
- thiscol->line_l_ = which;
- thiscol->translate_axis (lx + j*(rx - lx)/divide_over, X_AXIS);
-
- j ++;
- loose = dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
- }
-#else
- /*
- We divide the remaining space of the column over the left and
- right side. At the moment, we
-
- */
- Grob * common = right->common_refpoint (left, X_AXIS);
-
- Real rx = right->extent(common, X_AXIS)[LEFT];
- Real lx = left->extent(common, X_AXIS)[RIGHT];
- Real total_dx = rx - lx;
- Interval cval =col->extent (col, X_AXIS);
-
- /*
-
- We put it in the middle. This is not an ideal solution -- the
- break alignment code inserts a fixed space before the clef
- (about 1 SS), while the space following the clef is
- flexible. In tight situations, the clef will almost be on top
- of the following note.
-
- */
- Real dx = rx-lx - cval.length ();
- if (total_dx < 2* cval.length ())
- {
- /*
- todo: this is discontinuous. I'm too tired to
- invent a sliding mechanism. Duh.
-
- TODO.
- */
- dx *= 0.25;
- }
- else
- dx *= 0.5;
-
- col->line_l_ = which;
- col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
-#endif
- }
-}
-
-// const?
-void
-Line_of_score::break_into_pieces (Array<Column_x_positions> const &breaking)
-{
- for (int i=0; i < breaking.size (); i++)
- {
- Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone ());
- line_l->rank_i_ = i;
- // line_l->set_immutable_grob_property ("rank", gh_int2scm (i));
- Link_array<Grob> c (breaking[i].cols_);
- pscore_l_->typeset_line (line_l);
-
- line_l->set_bound (LEFT,c[0]);
- line_l->set_bound (RIGHT,c.top ());
- for (int j=0; j < c.size (); j++)
- {
- c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
- dynamic_cast<Paper_column*> (c[j])->line_l_ = line_l;
- }
- set_loose_columns (line_l, &breaking[i]);
- broken_into_l_arr_.push (line_l);
- }
-}
-
-
-#define GLOBAL_SYMBOL(cname, name) \
-SCM cname ; \
-void \
-cname ## _init_func () \
-{ \
- cname = ly_symbol2scm (name); \
- scm_permanent_object (cname); \
-} \
-ADD_SCM_INIT_FUNC (cname,cname ## _init_func);\
-
-
-GLOBAL_SYMBOL (offset_sym , "translate-molecule");
-GLOBAL_SYMBOL (placebox_sym , "placebox");
-GLOBAL_SYMBOL (combine_sym , "combine-molecule");
-
-
-
-void
-Line_of_score::output_molecule (SCM expr, Offset o)
-{
-
- while (1)
- {
- if (!gh_pair_p (expr))
- return;
-
- SCM head =ly_car (expr);
- if (unsmob_input (head))
- {
- Input * ip = unsmob_input (head);
-
-
- pscore_l_->outputter_l_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
- ly_str02scm (ip->file_str ().ch_C ()),
- gh_int2scm (ip->line_number ()),
- gh_int2scm (ip->column_number ()),
- SCM_UNDEFINED));
- expr = ly_cadr (expr);
- }
- else if (head == ly_symbol2scm ("no-origin"))
- {
- pscore_l_->outputter_l_->output_scheme (scm_list_n (head, SCM_UNDEFINED));
- expr = ly_cadr (expr);
- }
- else if (head == ly_symbol2scm ("translate-molecule"))
- {
- o += ly_scm2offset (ly_cadr (expr));
- expr = ly_caddr (expr);
- }
- else if (head == ly_symbol2scm ("combine-molecule"))
- {
- output_molecule (ly_cadr (expr), o);
- expr = ly_caddr (expr);
- }
- else
- {
- pscore_l_->outputter_l_->
- output_scheme (scm_list_n (placebox_sym,
- gh_double2scm (o[X_AXIS]),
- gh_double2scm (o[Y_AXIS]),
- expr,
- SCM_UNDEFINED));
-
- return;
- }
- }
-}
-
-void
-Line_of_score::output_scheme (SCM s)
-{
- pscore_l_->outputter_l_->output_scheme (s);
-}
-
-void
-Line_of_score::add_column (Paper_column*p)
-{
- Grob *me = this;
- SCM cs = me->get_grob_property ("columns");
- Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
-
- p->rank_i_ = prev ? Paper_column::rank_i (prev) + 1 : 0;
-
- me->set_grob_property ("columns", gh_cons (p->self_scm (), cs));
-
- Axis_group_interface::add_element (me, p);
-}
-
-
-
-/*
- TODO: use scm_map iso. for loops.
- */
-void
-Line_of_score::pre_processing ()
-{
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
- unsmob_grob (ly_car (s))->discretionary_processing ();
-
- if (verbose_global_b)
- progress_indication (_f ("Element count %d ", element_count ()));
-
-
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
- unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
-
- fixup_refpoints (get_grob_property ("all-elements"));
-
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
- {
- Grob* sc = unsmob_grob (ly_car (s));
- sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
- }
-
- progress_indication ("\n" + _ ("Calculating column positions...") + " ");
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
- {
- Grob * e = unsmob_grob (ly_car (s));
- SCM proc = e->get_grob_property ("spacing-procedure");
- if (gh_procedure_p (proc))
- gh_call1 (proc, e->self_scm ());
- }
-}
-
-void
-Line_of_score::post_processing (bool last_line)
-{
- for (SCM s = get_grob_property ("all-elements");
- gh_pair_p (s); s = ly_cdr (s))
- {
- Grob* sc = unsmob_grob (ly_car (s));
- sc->calculate_dependencies (POSTCALCED, POSTCALCING,
- ly_symbol2scm ("after-line-breaking-callback"));
- }
-
- Interval i (extent (this, Y_AXIS));
- if (i.empty_b ())
- programming_error ("Huh? Empty Line_of_score?");
- else
- translate_axis (- i[MAX], Y_AXIS);
-
- Real height = i.length ();
- if (height > 50 CM)
- {
- programming_error ("Improbable system height");
- height = 50 CM;
- }
-
- /*
- generate all molecules to trigger all font loads.
-
- (ugh. This is not very memory efficient.) */
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
- {
- unsmob_grob (ly_car (s))->get_molecule ();
- }
- /*
- font defs;
- */
- SCM font_names = ly_quote_scm (paper_l ()->font_descriptions ());
- output_scheme (scm_list_n (ly_symbol2scm ("define-fonts"),
- font_names,
- SCM_UNDEFINED));
-
- /*
- line preamble.
- */
- output_scheme (scm_list_n (ly_symbol2scm ("start-line"),
- gh_double2scm (height),
- SCM_UNDEFINED));
-
- /* Output elements in three layers, 0, 1, 2.
- The default layer is 1. */
- for (int i = 0; i < 3; i++)
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s);
- s = ly_cdr (s))
- {
- Grob *sc = unsmob_grob (ly_car (s));
- Molecule *m = sc->get_molecule ();
- if (!m)
- continue;
-
- SCM s = sc->get_grob_property ("layer");
- int layer = gh_number_p (s) ? gh_scm2int (s) : 1;
- if (layer != i)
- continue;
-
- Offset o (sc->relative_coordinate (this, X_AXIS),
- sc->relative_coordinate (this, Y_AXIS));
-
- SCM e = sc->get_grob_property ("extra-offset");
- if (gh_pair_p (e))
- {
- o[X_AXIS] += gh_scm2double (ly_car (e));
- o[Y_AXIS] += gh_scm2double (ly_cdr (e));
- }
-
- output_molecule (m->get_expr (), o);
- }
-
- if (last_line)
- {
- output_scheme (scm_list_n (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED));
- }
- else
- {
- output_scheme (scm_list_n (ly_symbol2scm ("stop-line"), SCM_UNDEFINED));
- }
-}
-
-
-Link_array<Item>
-Line_of_score::broken_col_range (Item const*l, Item const*r) const
-{
- Link_array<Item> ret;
-
- l = l->column_l ();
- r = r->column_l ();
- SCM s = get_grob_property ("columns");
-
- while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
- s = ly_cdr (s);
-
- if (gh_pair_p (s))
- s = ly_cdr (s);
-
- while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
- {
- Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
- if (Item::breakable_b (c) && !c->line_l_)
- ret.push (c);
-
- s = ly_cdr (s);
- }
-
- ret.reverse ();
- return ret;
-}
-
-/**
- Return all columns, but filter out any unused columns , since they might
- disrupt the spacing problem.
- */
-Link_array<Grob>
-Line_of_score::column_l_arr ()const
-{
- Link_array<Grob> acs
- = Pointer_group_interface__extract_grobs (this, (Grob*) 0, "columns");
- bool bfound = false;
- for (int i= acs.size (); i -- ;)
- {
- bool brb = Item::breakable_b (acs[i]);
- bfound = bfound || brb;
-
- /*
- the last column should be breakable. Weed out any columns that
- seem empty. We need to retain breakable columns, in case
- someone forced a breakpoint.
- */
- if (!bfound || !Paper_column::used_b (acs[i]))
- acs.del (i);
- }
- return acs;
-}
-
return result.smobbed_copy ();
}
+SCM
+ly_add_molecule (SCM first, SCM second)
+{
+ Molecule * m1 = unsmob_molecule (first);
+ Molecule * m2 = unsmob_molecule (second);
+ Molecule result;
+
+
+ if (m1)
+ result = *m1;
+ if (m2)
+ result.add_molecule (*m2);
+
+ return result.smobbed_copy ();
+}
+
SCM
make_molecule (SCM expr, SCM xext, SCM yext)
{
scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule);
scm_c_define_gsubr ("ly-fontify-atom", 2, 0, 0, (Scheme_function_unknown) ly_fontify_atom);
- scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x);
+ scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x);
+ scm_c_define_gsubr ("ly-add-molecule", 2, 0,0,(Scheme_function_unknown) ly_add_molecule);
scm_c_define_gsubr ("ly-combine-molecule-at-edge", 5 , 0, 0, (Scheme_function_unknown) Molecule::ly_molecule_combined_at_edge);
scm_c_define_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x);
scm_c_define_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent);
/*
Paper_columns form the top-most item parent. (The Paper_columns X
- parent is Line_of_score, which is a spanner.)
+ parent is System, which is a spanner.)
Paper_columns form the units for the spacing engine. They are
numbered, the first (leftmost) is column 0. Numbering happens before
return dynamic_cast<Paper_column*> (me)->rank_i_;
}
-Line_of_score*
+System*
Paper_column::line_l () const
{
return line_l_;
}
void
-Paper_score::typeset_line (Line_of_score *l)
+Paper_score::typeset_line (System *l)
{
if (!line_l_)
{
pscore_p_ = new Paper_score;
pscore_p_->paper_l_ = dynamic_cast<Paper_def*> (output_def_l_);
- SCM props = get_property ("LineOfScore");
+ SCM props = get_property ("System");
- pscore_p_->typeset_line (new Line_of_score (props));
+ pscore_p_->typeset_line (new System (props));
make_columns ();
scoreline_l_ = pscore_p_->line_l_;
ENTER_DESCRIPTION(Score_engraver,
-/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. LineOfScore)
+/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. System)
This engraver decides whether a column is breakable. The default is
",
-/* creats*/ "LineOfScore PaperColumn NonMusicalPaperColumn",
+/* creats*/ "System PaperColumn NonMusicalPaperColumn",
/* acks */ "note-spacing-interface staff-spacing-interface",
/* reads */ "currentMusicalColumn currentCommandColumn",
/* write */ "");
spanned_drul_[d] =i;
/**
- We check for Line_of_score to prevent the column -> line_of_score
+ We check for System to prevent the column -> line_of_score
-> column -> line_of_score -> etc situation */
- if (d== LEFT && !dynamic_cast<Line_of_score*> (this))
+ if (d== LEFT && !dynamic_cast<System*> (this))
{
set_parent (i, X_AXIS);
}
return r-l;
}
-Line_of_score *
+System *
Spanner::line_l () const
{
if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT])
Grob*
-Spanner::find_broken_piece (Line_of_score*l) const
+Spanner::find_broken_piece (System*l) const
{
int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare);
--- /dev/null
+/*
+ system.cc -- implement System
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "input-smob.hh"
+#include "axis-group-interface.hh"
+#include "debug.hh"
+#include "line-of-score.hh"
+#include "main.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "paper-outputter.hh"
+#include "paper-score.hh"
+#include "string.hh"
+#include "warn.hh"
+#include "dimensions.hh"
+#include "molecule.hh"
+#include "all-font-metrics.hh"
+
+// todo: use map.
+void
+fixup_refpoints (SCM s)
+{
+ for (; gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob::fixup_refpoint (ly_car (s));
+ }
+}
+
+
+System::System (SCM s)
+ : Spanner (s)
+{
+ rank_i_ = 0;
+
+ Axis_group_interface::set_interface (this);
+ Axis_group_interface::set_axes (this, Y_AXIS,X_AXIS);
+}
+
+int
+System::element_count () const
+{
+ return scm_ilength (get_grob_property ("all-elements"));
+}
+
+void
+System::typeset_grob (Grob * elem_p)
+{
+ elem_p->pscore_l_ = pscore_l_;
+ Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"),elem_p);
+ scm_gc_unprotect_object (elem_p->self_scm ());
+}
+
+void
+System::output_lines ()
+{
+ for (SCM s = get_grob_property ("all-elements");
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ unsmob_grob (ly_car (s))->do_break_processing ();
+ }
+
+ /*
+ fixups must be done in broken line_of_scores, because new elements
+ are put over there. */
+ int count = 0;
+ for (int i=0; i < broken_into_l_arr_.size (); i++)
+ {
+ Grob *se = broken_into_l_arr_[i];
+ SCM all = se->get_grob_property ("all-elements");
+ for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
+ {
+ fixup_refpoint (ly_car (s));
+ }
+ count += scm_ilength (all);
+ }
+
+ /*
+ needed for doing items.
+ */
+ fixup_refpoints (get_grob_property ("all-elements"));
+
+
+ for (SCM s = get_grob_property ("all-elements");
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ unsmob_grob (ly_car (s))->handle_broken_dependencies ();
+ }
+ handle_broken_dependencies ();
+
+ if (verbose_global_b)
+ progress_indication (_f ("Element count %d.", count + element_count ()));
+
+
+ for (int i=0; i < broken_into_l_arr_.size (); i++)
+ {
+ System *line_l = dynamic_cast<System*> (broken_into_l_arr_[i]);
+
+ if (verbose_global_b)
+ progress_indication ("[");
+ line_l->post_processing (i+1 == broken_into_l_arr_.size ());
+
+ if (verbose_global_b)
+ {
+ progress_indication (to_str (i));
+ progress_indication ("]");
+ }
+
+ if (i < broken_into_l_arr_.size () - 1)
+ {
+ SCM lastcol = ly_car (line_l->get_grob_property ("columns"));
+ Grob* e = unsmob_grob (lastcol);
+
+ SCM between = ly_symbol2scm ("between-system-string");
+ SCM inter = e->internal_get_grob_property (between);
+ if (gh_string_p (inter))
+ {
+ pscore_l_->outputter_l_
+ ->output_scheme (scm_list_n (between,
+ inter, SCM_UNDEFINED));
+ }
+ }
+ }
+}
+
+
+
+
+/*
+ Find the loose columns in POSNS, and drape them around the columns
+ specified in BETWEEN-COLS. */
+void
+set_loose_columns (System* which, Column_x_positions const *posns)
+{
+ for (int i = 0; i < posns->loose_cols_.size (); i++)
+ {
+ int divide_over = 1;
+ Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
+ Paper_column* col = dynamic_cast<Paper_column*> (loose);
+
+ if (col->line_l_)
+ continue;
+
+
+ Item * left = 0;
+ Item * right = 0;
+ do
+ {
+ SCM between = loose->get_grob_property ("between-cols");
+ if (!gh_pair_p (between))
+ break;
+
+
+ Item * l=dynamic_cast<Item*> (unsmob_grob (ly_car (between)));
+ Item * r=dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
+
+ if (!(l && r))
+ break ;
+
+ if (!left && l)
+ {
+ left = l->column_l ();
+ }
+
+ divide_over ++;
+
+ loose = right = r->column_l ();
+ }
+ while (1);
+
+
+#if 0
+ Real rx = right->relative_coordinate (right->get_parent (X_AXIS), X_AXIS);
+ Real lx = left->relative_coordinate (left->get_parent (X_AXIS), X_AXIS);
+
+ /*
+ divide space equally over loose columns.
+ */
+ int j = 1;
+ loose = col;
+ while (1)
+ {
+ SCM between = loose->get_grob_property ("between-cols");
+ if (!gh_pair_p (between))
+ break;
+
+ Paper_column *thiscol = dynamic_cast<Paper_column*> (loose);
+
+ thiscol->line_l_ = which;
+ thiscol->translate_axis (lx + j*(rx - lx)/divide_over, X_AXIS);
+
+ j ++;
+ loose = dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
+ }
+#else
+ /*
+ We divide the remaining space of the column over the left and
+ right side. At the moment, we
+
+ */
+ Grob * common = right->common_refpoint (left, X_AXIS);
+
+ Real rx = right->extent(common, X_AXIS)[LEFT];
+ Real lx = left->extent(common, X_AXIS)[RIGHT];
+ Real total_dx = rx - lx;
+ Interval cval =col->extent (col, X_AXIS);
+
+ /*
+
+ We put it in the middle. This is not an ideal solution -- the
+ break alignment code inserts a fixed space before the clef
+ (about 1 SS), while the space following the clef is
+ flexible. In tight situations, the clef will almost be on top
+ of the following note.
+
+ */
+ Real dx = rx-lx - cval.length ();
+ if (total_dx < 2* cval.length ())
+ {
+ /*
+ todo: this is discontinuous. I'm too tired to
+ invent a sliding mechanism. Duh.
+
+ TODO.
+ */
+ dx *= 0.25;
+ }
+ else
+ dx *= 0.5;
+
+ col->line_l_ = which;
+ col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
+#endif
+ }
+}
+
+// const?
+void
+System::break_into_pieces (Array<Column_x_positions> const &breaking)
+{
+ for (int i=0; i < breaking.size (); i++)
+ {
+ System *line_l = dynamic_cast <System*> (clone ());
+ line_l->rank_i_ = i;
+ // line_l->set_immutable_grob_property ("rank", gh_int2scm (i));
+ Link_array<Grob> c (breaking[i].cols_);
+ pscore_l_->typeset_line (line_l);
+
+ line_l->set_bound (LEFT,c[0]);
+ line_l->set_bound (RIGHT,c.top ());
+ for (int j=0; j < c.size (); j++)
+ {
+ c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
+ dynamic_cast<Paper_column*> (c[j])->line_l_ = line_l;
+ }
+ set_loose_columns (line_l, &breaking[i]);
+ broken_into_l_arr_.push (line_l);
+ }
+}
+
+
+#define GLOBAL_SYMBOL(cname, name) \
+SCM cname ; \
+void \
+cname ## _init_func () \
+{ \
+ cname = ly_symbol2scm (name); \
+ scm_permanent_object (cname); \
+} \
+ADD_SCM_INIT_FUNC (cname,cname ## _init_func);\
+
+
+GLOBAL_SYMBOL (offset_sym , "translate-molecule");
+GLOBAL_SYMBOL (placebox_sym , "placebox");
+GLOBAL_SYMBOL (combine_sym , "combine-molecule");
+
+
+
+void
+System::output_molecule (SCM expr, Offset o)
+{
+
+ while (1)
+ {
+ if (!gh_pair_p (expr))
+ return;
+
+ SCM head =ly_car (expr);
+ if (unsmob_input (head))
+ {
+ Input * ip = unsmob_input (head);
+
+
+ pscore_l_->outputter_l_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
+ ly_str02scm (ip->file_str ().ch_C ()),
+ gh_int2scm (ip->line_number ()),
+ gh_int2scm (ip->column_number ()),
+ SCM_UNDEFINED));
+ expr = ly_cadr (expr);
+ }
+ else if (head == ly_symbol2scm ("no-origin"))
+ {
+ pscore_l_->outputter_l_->output_scheme (scm_list_n (head, SCM_UNDEFINED));
+ expr = ly_cadr (expr);
+ }
+ else if (head == ly_symbol2scm ("translate-molecule"))
+ {
+ o += ly_scm2offset (ly_cadr (expr));
+ expr = ly_caddr (expr);
+ }
+ else if (head == ly_symbol2scm ("combine-molecule"))
+ {
+ output_molecule (ly_cadr (expr), o);
+ expr = ly_caddr (expr);
+ }
+ else
+ {
+ pscore_l_->outputter_l_->
+ output_scheme (scm_list_n (placebox_sym,
+ gh_double2scm (o[X_AXIS]),
+ gh_double2scm (o[Y_AXIS]),
+ expr,
+ SCM_UNDEFINED));
+
+ return;
+ }
+ }
+}
+
+void
+System::output_scheme (SCM s)
+{
+ pscore_l_->outputter_l_->output_scheme (s);
+}
+
+void
+System::add_column (Paper_column*p)
+{
+ Grob *me = this;
+ SCM cs = me->get_grob_property ("columns");
+ Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
+
+ p->rank_i_ = prev ? Paper_column::rank_i (prev) + 1 : 0;
+
+ me->set_grob_property ("columns", gh_cons (p->self_scm (), cs));
+
+ Axis_group_interface::add_element (me, p);
+}
+
+
+
+/*
+ TODO: use scm_map iso. for loops.
+ */
+void
+System::pre_processing ()
+{
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ unsmob_grob (ly_car (s))->discretionary_processing ();
+
+ if (verbose_global_b)
+ progress_indication (_f ("Element count %d ", element_count ()));
+
+
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
+
+ fixup_refpoints (get_grob_property ("all-elements"));
+
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob* sc = unsmob_grob (ly_car (s));
+ sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
+ }
+
+ progress_indication ("\n" + _ ("Calculating column positions...") + " ");
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob * e = unsmob_grob (ly_car (s));
+ SCM proc = e->get_grob_property ("spacing-procedure");
+ if (gh_procedure_p (proc))
+ gh_call1 (proc, e->self_scm ());
+ }
+}
+
+void
+System::post_processing (bool last_line)
+{
+ for (SCM s = get_grob_property ("all-elements");
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob* sc = unsmob_grob (ly_car (s));
+ sc->calculate_dependencies (POSTCALCED, POSTCALCING,
+ ly_symbol2scm ("after-line-breaking-callback"));
+ }
+
+ Interval i (extent (this, Y_AXIS));
+ if (i.empty_b ())
+ programming_error ("Huh? Empty System?");
+ else
+ translate_axis (- i[MAX], Y_AXIS);
+
+ Real height = i.length ();
+ if (height > 50 CM)
+ {
+ programming_error ("Improbable system height");
+ height = 50 CM;
+ }
+
+ /*
+ generate all molecules to trigger all font loads.
+
+ (ugh. This is not very memory efficient.) */
+ this->get_molecule();
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ {
+ unsmob_grob (ly_car (s))->get_molecule ();
+ }
+ /*
+ font defs;
+ */
+ SCM font_names = ly_quote_scm (paper_l ()->font_descriptions ());
+ output_scheme (scm_list_n (ly_symbol2scm ("define-fonts"),
+ font_names,
+ SCM_UNDEFINED));
+
+ /*
+ line preamble.
+ */
+ output_scheme (scm_list_n (ly_symbol2scm ("start-line"),
+ gh_double2scm (height),
+ SCM_UNDEFINED));
+
+ /* Output elements in three layers, 0, 1, 2.
+ The default layer is 1. */
+
+ {
+ Molecule *m = this->get_molecule();
+ if (m)
+ output_molecule (m->get_expr (), Offset(0,0));
+ }
+
+ for (int i = 0; i < 3; i++)
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s);
+ s = ly_cdr (s))
+ {
+ Grob *sc = unsmob_grob (ly_car (s));
+ Molecule *m = sc->get_molecule ();
+ if (!m)
+ continue;
+
+ SCM s = sc->get_grob_property ("layer");
+ int layer = gh_number_p (s) ? gh_scm2int (s) : 1;
+ if (layer != i)
+ continue;
+
+ Offset o (sc->relative_coordinate (this, X_AXIS),
+ sc->relative_coordinate (this, Y_AXIS));
+
+ SCM e = sc->get_grob_property ("extra-offset");
+ if (gh_pair_p (e))
+ {
+ o[X_AXIS] += gh_scm2double (ly_car (e));
+ o[Y_AXIS] += gh_scm2double (ly_cdr (e));
+ }
+
+ output_molecule (m->get_expr (), o);
+ }
+
+
+
+ if (last_line)
+ {
+ output_scheme (scm_list_n (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED));
+ }
+ else
+ {
+ output_scheme (scm_list_n (ly_symbol2scm ("stop-line"), SCM_UNDEFINED));
+ }
+}
+
+
+Link_array<Item>
+System::broken_col_range (Item const*l, Item const*r) const
+{
+ Link_array<Item> ret;
+
+ l = l->column_l ();
+ r = r->column_l ();
+ SCM s = get_grob_property ("columns");
+
+ while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
+ s = ly_cdr (s);
+
+ if (gh_pair_p (s))
+ s = ly_cdr (s);
+
+ while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
+ {
+ Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
+ if (Item::breakable_b (c) && !c->line_l_)
+ ret.push (c);
+
+ s = ly_cdr (s);
+ }
+
+ ret.reverse ();
+ return ret;
+}
+
+/**
+ Return all columns, but filter out any unused columns , since they might
+ disrupt the spacing problem.
+ */
+Link_array<Grob>
+System::column_l_arr ()const
+{
+ Link_array<Grob> acs
+ = Pointer_group_interface__extract_grobs (this, (Grob*) 0, "columns");
+ bool bfound = false;
+ for (int i= acs.size (); i -- ;)
+ {
+ bool brb = Item::breakable_b (acs[i]);
+ bfound = bfound || brb;
+
+ /*
+ the last column should be breakable. Weed out any columns that
+ seem empty. We need to retain breakable columns, in case
+ someone forced a breakpoint.
+ */
+ if (!bfound || !Paper_column::used_b (acs[i]))
+ acs.del (i);
+ }
+ return acs;
+}
+
properties_dict ()->set (sym, val);
}
+void
+Translator_group::internal_set_children_property (SCM sym, SCM val)
+{
+ internal_set_property (sym, val);
+ for (SCM p = trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
+ Translator_group *trg = dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
+ trg->internal_set_children_property(sym,ly_deep_copy(val));
+ }
+}
+
/*
TODO: look up to check whether we have inherited var?
*/
MinimumVerticalExtent = #'(-4 . 4)
ExtraVerticalExtent = ##f
VerticalExtent = ##f
+ localKeySignature = #'()
% explicitly set instrument, so we don't get
% weird effects when doing instrument names for
MinimumVerticalExtent = ##f
ExtraVerticalExtent = ##f
VerticalExtent = ##f
-
+ localKeySignature = #'()
+
\accepts Staff
\name StaffContainer
}
alignmentReference = #0
\consists "System_start_delimiter_engraver"
systemStartDelimiter = #'SystemStartBracket
+ localKeySignature = #'()
\accepts "Staff"
\accepts "RhythmicStaff"
MinimumVerticalExtent = ##f
ExtraVerticalExtent = ##f
VerticalExtent = ##f
+ localKeySignature = #'()
\consists "Pitch_squash_engraver"
\consists "Separating_line_group_engraver"
\name Voice
Generic_property_list = #generic-voice-properties
+ localKeySignature = #'()
\consists "Font_size_engraver"
% must come before all
ThreadContext = \translator{
\type Engraver_group_engraver
\name Thread
+ localKeySignature = #'()
\consists "Font_size_engraver"
\consists "Thread_devnull_engraver"
GrandStaffContext=\translator{
\type "Engraver_group_engraver"
\name GrandStaff
+ localKeySignature = #'()
\consists "Span_bar_engraver"
\consists "Span_arpeggio_engraver"
\consists "System_start_delimiter_engraver"
PianoStaffContext = \translator{
\GrandStaffContext
\name "PianoStaff"
+ \alias "GrandStaff"
\consists "Vertical_align_engraver"
\consists "Instrument_name_engraver"
InnerStaffGroupContext= \translator {
\type "Engraver_group_engraver"
\name InnerStaffGroup
+ localKeySignature = #'()
\consists "Span_bar_engraver"
\consists "Span_arpeggio_engraver"
ScoreContext = \translator {
\type Score_engraver
\name Score
+ localKeySignature = #'()
\consists "Repeat_acknowledge_engraver"
\consists "Staff_collecting_engraver"
subdivideBeams = ##f
extraNatural = ##t
- autoAccidentals = #'((measure-same-octave . 0))
+ autoAccidentals = #'(Staff (same-octave . 0))
autoCautionaries = #'()
stafflinethickness = \staffspace / 10.0
outputscale = \staffheight / 4.0
-blotdiameter = 0.4 \pt
+% blotdiameter = 0.4 \pt
+blotdiameter = 0.04 \pt
\translator { \NoteNamesContext }
% accidentals as they were common in the 18th century.
defaultAccidentals = {
\property Score.extraNatural = ##t
- \property Score.autoAccidentals = #'((measure-same-octave . 0))
- \property Score.autoCautionaries = #'()
+ \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+ \property Score.autoCautionaries = #'()
+}
+
+% accidentals in voices instead of staves.
+% Notice that accidentals from one voice do NOT get cancelled in other voices
+voiceAccidentals = {
+ \property Score.extraNatural = ##t
+ \property Score.autoAccidentals = #'(Voice (same-octave . 0))
+ \property Score.autoCautionaries = #'()
+
}
% accidentals as suggested by Kurt Stone, Music Notation in the 20th century.
% in other octaves and in the next measure.
modernAccidentals = {
\property Score.extraNatural = ##f
- \property Score.autoAccidentals = #'((measure-same-octave . 0) (measure-any-octave . 0) (measure-any-octave . 1))
+ \property Score.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (any-octave . 1))
\property Score.autoCautionaries = #'()
}
% the accidentals that Stone adds to the old standard as cautionaries
modernCautionaries = {
\property Score.extraNatural = ##f
- \property Score.autoAccidentals = #'((measure-same-octave . 0))
- \property Score.autoCautionaries = #'((measure-any-octave . 0) (measure-any-octave . 1))
+ \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+ \property Score.autoCautionaries = #'(Staff (any-octave . 0) (any-octave . 1))
+}
+
+% Multivoice accidentals to be read both by musicians playing one voice
+% and musicians playing all voices.
+% Accidentals are typeset for each voice, but they ARE cancelled across voices.
+modernVoiceAccidentals = {
+ \property Staff.extraNatural = ##f
+ \property Staff.autoAccidentals = #'(
+ Voice (same-octave . 0) (any-octave . 0) (any-octave . 1)
+ Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+ )
+ \property Staff.autoCautionaries = #'()
+}
+
+% same as modernVoiceAccidental eccept that all special accidentals are typeset
+% as cautionaries
+modernVoiceCautionaries = {
+ \property Staff.extraNatural = ##f
+ \property Staff.autoAccidentals = #'(
+ Voice (same-octave . 0)
+ )
+ \property Staff.autoCautionaries = #'(
+ Voice (any-octave . 0) (any-octave . 1)
+ Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+ )
+}
+
+% stone's suggestions for accidentals on grand staff.
+% Accidentals are cancelled across the staves in the same grand staff as well
+pianoAccidentals = {
+ \property GrandStaff.autoAccidentals = #'(
+ Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+ GrandStaff (any-octave . 1)
+ )
+ \property GrandStaff.autoCautionaries = #'()
}
% Do not reset the key at the start of a measure. Accidentals will be
% printed only once and are in effect until overridden, possibly many
% measures later.
noResetKey = {
- \property Score.autoAccidentals = #'((measure-same-octave . #t))
+ \property Score.autoAccidentals = #'(Staff (same-octave . #t))
\property Score.autoCautionaries = #'()
}
% remembered for the duration of a measure.
% accidentals not being remembered, causing accidentals always to be typeset relative to the time signature
forgetAccidentals = {
- \property Score.autoAccidentals = #'((measure-same-octave . -1))
+ \property Score.autoAccidentals = #'(Staff (same-octave . -1))
\property Score.autoCautionaries = #'()
}
Begin3
Title: LilyPond
-Version: 1.5.44
-Entered-date: 20MRT02
+Version: 1.5.45
+Entered-date: 21MRT02
Description: @BLURB@
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.5.44.tar.gz
+ 1000k lilypond-1.5.45.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.5.44.tar.gz
+ 1000k lilypond-1.5.45.tar.gz
Copying-policy: GPL
End
%define name lilypond
-%define version 1.5.44
+%define version 1.5.45
%define release 1mdk
Name: %{name}
%define info yes
Name: lilypond
-Version: 1.5.44
+Version: 1.5.45
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.44.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz
Summary: Create and print music notation
URL: http://www.lilypond.org/
BuildRoot: /tmp/lilypond-install
Distribution: SuSE Linux 7.0 (i386)
Name: lilypond
-Version: 1.5.44
+Version: 1.5.45
Release: 2
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.44.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz
# music notation software for.. ?
Summary: A program for printing sheet music.
URL: http://www.lilypond.org/
% initialise paper dimensions
staff-height init-paper
-/line-x left-margin def
+/line-x left-margin output-scale div def
/line-y vsize top-margin sub def
make-lilypond-title
(meta . ,(grob-description lyric-hyphen-interface ))
))
- (LineOfScore
- . (
- (axes . (0 1))
- (meta . ,(grob-description line-of-score-interface axis-group-interface))
- ))
-
(LyricExtender
. (
(molecule-callback . ,Lyric_extender::brew_molecule)
(meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface))
))
+ (System
+ . (
+ (axes . (0 1))
+ (meta . ,(grob-description line-of-score-interface axis-group-interface))
+ ))
+
(SystemStartBrace
. (
(glyph . "brace")
(set! mol (ly-combine-molecule-at-edge mol (other-axis axis) -1 rb padding))
mol
))
+
+
+
+(define (box-molecule xext yext)
+ "Make a filled box."
+
+ (ly-make-molecule
+ (list 'filledbox (- (car xext)) (cdr xext)
+ (- (car yext)) (cdr yext))
+ xext yext)
+)
+
+(define (widen-interval iv amount)
+ (cons (- (car iv) amount)
+ (+ (cdr iv) amount))
+)
+
+
+(define (box-grob-molecule grob)
+ "Make a box of exactly the extents of the grob."
+ (let* ((xext (ly-get-extent grob grob 0))
+ (yext (ly-get-extent grob grob 1))
+ (mol (ly-make-molecule '() '(10000 . -10000) '(10000 . -10000)))
+ (thick 0.1)
+ )
+ (display "hoi")
+ (set! mol (ly-add-molecule mol (box-molecule xext (cons (car yext) (+ (car yext) thick)))))
+ (set! mol (ly-add-molecule mol (box-molecule xext (cons (- (cdr yext) thick) (cdr yext)))))
+ (set! mol (ly-add-molecule mol (box-molecule (cons (car xext) (+ (car xext) thick)) yext)))
+ (set! mol (ly-add-molecule mol (box-molecule (cons (- (cdr xext) thick) (cdr xext)) yext)))
+ mol
+ ))
(car name-mag)
" findfont "
"20 " (ly-number->string (cdr name-mag)) " mul "
- "lilypondpaperoutputscale div scalefont setfont } bind def "
+ "output-scale div scalefont setfont } bind def "
"\n"))
(define (beam width slope thick)
(translator-property-description 'autoAccidentals list? "List of
different ways to typeset an accidental. All algorithms in the list
are tried, and the one returning the most accidentals is used.
-Each algorithm-description is a name-value pair.
+Each entry is either a symbol containg a context name or a name-value
+pair containing an algorithm-description.
+The list must begin with a symbol (context name).
+The symbols denote in which context THE FOLLOWING algorithms (until next symbol)
+will be interpreted. All notes in the interpretation context will share accidentals.
+The contexts must be stated in order, innermost first.
The algorithms are:
@table @samp
-@item measure-same-octave:
+@item same-octave:
This is the default algorithm. Accidentals are typeset if the note changes
the accidental of that note in that octave. Accidentals lasts to the end of the measure
and then as many measures as specified in the value. I.e. 1 means to the end
-of next measure, -1 means to the end of previous measure (that is: no duration at all), etc.
-@item measure-any-octave:
+of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever.
+@item any-octave:
Accidentals are typeset if the note is different from
the previous note on the same pitch in any octave. The value has same meaning as in
-measure-same-octave.
+same-octave.
@end table
")
\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
% The feta characters
-\input feta20.tex
+%\input feta20.tex
-\font\fetasixteen=feta16
-\def\fetafont{\fetasixteen}
-\def\fetachar#1{\hbox{\fetasixteen#1}}
+%\font\fetasixteen=feta16
+%\def\fetafont{\fetasixteen}
+%\def\fetachar#1{\hbox{\fetasixteen#1}}
% If we must make titles, do so, before we're Skipped.
\ifx\mustmakelilypondtitle\undefined\else\makelilypondtitle\fi