-1.5.23.jcn1
-===========
-
-* Rewrote new conditional guile >= 1.5 compilation switches, to keep
- code clean from conditionals and have a concentrated sets of
- compatitility fixes for old guile versions.
-
-* Fixes for guile 1.4, including embedded ps.
-
1.5.23
======
+* Bugfix: be anal about slur dimensions.
+
+* Bugfix: insert extra margin around pixmaps.
+
+* lilypond-book: magnification option for EPS
1.5.22.jcn1
===========
- Hmm, then find that
+ Sketch accesses characters by name, ie, the
- name characters have in default text fonts. Luckily, textrace
+clefs name characters have in default text fonts. Luckily, textrace
mangles the feta names too. Sadly, textrace chooses different names
for characters > 128.
--- /dev/null
+2001-12-01 Han-Wen <hanwen@cs.uu.nl>
+
+ * lily/note-head.cc (head_extent): added to compute width without
+ ledger lines. By default, ledger lines take up width now.
+
+ * input/regression/fingering.ly: demonstrate auto fingering.
+ Horizontal placement is still buggy.
+
+ * lily/fingering-engraver.cc (class Fingering_engraver):
+ added. Provides support for horizontal fingering scripts
+
+ * lily/include/grob.hh: Naming: change parent_l() into get_parent()
+
+ * lily/side-position-interface.cc (add_staff_support): add staff
+ only for Y-axis side positions.
+
+ * lily/parser.yy (request_chord): Fix mem leak.
+
+ * lily/musical-request.cc (transpose): moved to Music::transpose()
+
+ * lily/include/grob-info.hh: Change music pointer to SCM, so we
+ can store grobs as grob-creation cause as well.
+
+ * lily/group-interface.cc (add_thing): efficiency tweak: reuse
+ handle when adding. Use precomputed symbols throughout lily.
+
+ * lily/rhythmic-column-engraver.cc: make NoteSpacing grobs to keep
+ track of spacing issues.
+
+ * lily/separating-line-group-engraver.cc: make StaffSpacing grobs
+ to keep track of staff spacing
+
+2001-11-30 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * Rewrote new conditional guile >= 1.5 compilation switches, to keep
+ code clean from conditionals and have a concentrated sets of
+ compatitility fixes for old guile versions.
+
+ * Fixes for guile 1.4, including embedded ps.
+
+2001-11-30 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/stanza-number-engraver.cc (process_music): allow pairs as
+ well for markup texts.
+
+ * lily/musical-request.cc (length_mom): kludge for null pointer.
+
+ * scm/sketch.scm (sketch-output-expression): guile 1.4 compatibility
+
+ * scm/lily.scm (sign): bugfix
+
+ * CHANGES: Change log instated.
+
+ * stepmake/add-html-footer.py: @BRANCH@ tag insertion.
+
@lilypondfile[printfilename]{glissando.ly}
+@lilypondfile[printfilename]{fingering.ly}
+
@section Dynamics
@lilypondfile[printfilename]{dynamics-line.ly}
@end example
-
+@c Why isn't this in BUGS (where it belongs?)
@section Problems
For help and questions use @email{lilypond-user@@gnu.org}. Please
Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
+
+
+@unnumberedsubsec Linux-2.4.0, Guile-1.4 --with-threads
+
+There's a bug in certain kernels around version 2.4.0, that is
+triggered when using Guile 1.4 compiled with pthreads. You'll see
+random segmentation fault crashes of LilyPond. Upgrade to a newer
+version of Linux. If you can't do that, you may try to recompiling
+Guile without threads (YMMV):
+
+@example
+ guile-1.4$ ./configure --without-threads; make all install
+@end example
+
+
@unnumberedsubsec NetBSD
@itemize @bullet
#
SCRIPTS = configure aclocal.m4
-README_FILES = CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
+README_FILES = ChangeLog CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
IN_FILES := $(wildcard *.in)
EXTRA_DIST_FILES = lilypond-font-lock.el lilypond-mode.el lilypond-init.el vimrc VERSION $(README_FILES) $(SCRIPTS) $(IN_FILES) emacsclient.patch lexer-gcc-3.0.patch
Debian GNU/Linux
Problems
FLex-2.5.4a and gcc-3.0
+ Linux-2.4.0, Guile-1.4 -with-threads
NetBSD
Solaris:
AIX
Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
+Linux-2.4.0, Guile-1.4 -with-threads
+------------------------------------
+
+ There's a bug in certain kernels around version 2.4.0, that is
+triggered when using Guile 1.4 compiled with pthreads. You'll see
+random segmentation fault crashes of LilyPond. Upgrade to a newer
+version of Linux. If you can't do that, you may try to recompiling
+Guile without threads (YMMV):
+
+ guile-1.4$ ./configure --without-threads; make all install
+
NetBSD
------
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=5
-PATCH_LEVEL=23
-MY_PATCH_LEVEL=jcn2
+PATCH_LEVEL=24
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
return to_str (char (a + 'x'));
}
+
+Axis
+other_axis (Axis a)
+{
+ return a == Y_AXIS ? X_AXIS : Y_AXIS;
+}
+
/*
TODO inline these.
*/
/**
the operator ++ for Axis.
*/
+Axis other_axis (Axis);
Axis post_incr (Axis &);
Axis incr (Axis &);
//Axis operator++ (Axis);
--- /dev/null
+\header {
+
+texidoc = "Beam quanting can be twiddled using grob
+properties. The following example shows how Y and DY can be
+unquantised and quantised to 0 and 4 respectively."
+
+}
+
+\version "1.5.23"
+
+%{
+Have some fun beam quanting
+%}
+
+% no y quantising
+#(define (beam-vertical-position-quants m dy x y) '())
+
+% rediculous dy quanting
+#(define (beam-height-quants x y) '(0 4))
+
+\score {
+ \notes\relative c'{
+ \property Voice.Beam \override #'height-quants = #beam-height-quants
+ \property Voice.Beam \override #'vertical-position-quant-function =
+ #beam-vertical-position-quants
+ c8 c c c
+ c8 e g a
+ c,8 f b e
+ }
+}
--- /dev/null
+\header {
+
+texidoc = "Automatic fingering tries to put fingering instructions
+next to noteheads. scriptHorizontal puts the center fingerings horizontally next to
+the note heads.
+
+For this to function, you have to @code{\apply} pitchify-scripts to
+the music you're dealing with, and you have to do so outside of a
+@code{\relative} block. "
+
+}
+
+\score {
+
+ \notes\relative c' {
+ c4-4
+ <c-1 f-4>
+ < c-1 e-2 g-3 b-4 >
+\apply #pitchify-scripts \relative c' { c4-4
+ <c-1 f-4>
+ < c-1 e-2 g-3 b-4 >
+ \property Voice.scriptHorizontal = ##t
+ <c-1 f-4>
+ <c-1 f-4 a-5>
+ < c-1 e-2 g-3 b-4 >
+ } } }
composer = "jcn"
enteredby = "jcn"
copyright = "PD"
+title = "Beam quantization"
TestedFeatures = "beam quant positions"
}
Grob*t = text_p_;
Side_position_interface::add_support (t, i.grob_l_);
if (Side_position_interface::get_axis (t) == X_AXIS
- && !t->parent_l (Y_AXIS))
+ && !t->get_parent (Y_AXIS))
t->set_parent (i.grob_l_, Y_AXIS);
}
if (Stem::has_interface (i.grob_l_))
if (prev == SCM_BOOL_F)
prev = scm_assoc (gh_int2scm (n), sig);
SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : ly_cdr (prev);
+
bool different = !gh_equal_p (prev_acc , gh_int2scm (a));
int p = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
void
Accidental_engraver::acknowledge_grob (Grob_info info)
{
- Note_req * note_l = dynamic_cast <Note_req *> (info.req_l_);
+ Note_req * note_l = dynamic_cast <Note_req *> (info.music_cause ());
if (note_l && Rhythmic_head::has_interface (info.grob_l_))
{
{
Grob * me = unsmob_grob (element_smob);
Axis ax = (Axis)gh_scm2int (axis);
- Grob * par = me->parent_l (ax);
+ Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_grob_property ("alignment-done")))
{
Align_interface::align_elements_to_extents (par, ax);
{
Grob * me = unsmob_grob (element_smob);
Axis ax = (Axis)gh_scm2int (axis);
- Grob * par = me->parent_l (ax);
+ Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_grob_property ("alignment-done")))
{
Align_interface::align_to_fixed_distance (par, ax);
for (int i = 0; i < stems_.size (); i++)
{
- Pointer_group_interface::add_element (arpeggio_, "stems", stems_[i]);
+ Pointer_group_interface::add_element (arpeggio_, ly_symbol2scm ("stems"), stems_[i]);
}
for (int i = 0; i < supports_.size (); i++)
{
{
Item* stem_l = dynamic_cast<Item *> (info.grob_l_);
- Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
+ Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
if (!rhythmic_req)
{
programming_error ("Stem must have rhythmic structure");
virtual Spanner* get_spanner_p () const;
virtual void add_element (Grob*) ;
public:
-TRANSLATOR_DECLARATIONS(
- Axis_group_engraver );
+TRANSLATOR_DECLARATIONS(Axis_group_engraver );
};
/* UGH UGH UGH */
for (int i=0; i < elts_.size (); i++)
{
- Grob *par = elts_[i]->parent_l (Y_AXIS);
+ Grob *par = elts_[i]->get_parent (Y_AXIS);
if ((!par || !Axis_group_interface::has_interface (par))
&& ! elts_[i]->empty_b (Y_AXIS))
{
Axis a = (Axis) gh_scm2int (ly_car (ax));
- if (!e->parent_l (a))
+ if (!e->get_parent (a))
e->set_parent (me, a);
}
- Pointer_group_interface::add_element (me, "elements", e);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), e);
me->add_dependency (e);
}
if (Stem::beam_l (stem_l))
return;
- Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.req_l_);
+ Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
if (!rhythmic_req)
{
String s = _ ("stem must have Rhythmic structure");
- if (info.req_l_)
- info.req_l_->origin ()->warning (s);
+ if (info.music_cause ())
+ info.music_cause ()->origin ()->warning (s);
else
::warning (s);
void
Beam::add_stem (Grob*me, Grob*s)
{
- Pointer_group_interface:: add_element (me, "stems", s);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("stems"), s);
s->add_dependency (me);
TRANSLATOR_DECLARATIONS(Break_align_engraver);
};
-
-
-
-
void
Break_align_engraver::add_column (SCM smob)
{
{
if (Item * item_l = dynamic_cast <Item *> (inf.grob_l_))
{
- if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
+ if (item_l->empty_b (X_AXIS) || item_l->get_parent (X_AXIS))
return;
SCM bp=item_l->get_grob_property ("breakable");
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
- Grob *par = me->parent_l (a);
+ Grob *par = me->get_parent (a);
if (par && !to_boolean (par->get_grob_property ("break-alignment-done")))\
{
par->set_grob_property ("break-alignment-done", SCM_BOOL_T);
void
Chord_name_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_req* n = dynamic_cast<Note_req*> (i.req_l_))
+ if (Note_req* n = dynamic_cast<Note_req*> (i.music_cause ()))
add_note (n);
}
}
s->set_grob_property ("direction", d);
- if (dynamic_cast <Rhythmic_req *> (info.req_l_))
+ if (dynamic_cast <Rhythmic_req *> (info.music_cause ()))
{
Beam::add_stem (beam_p_, s);
}
else
{
String s = _ ("stem must have Rhythmic structure");
- if (info.req_l_)
- info.req_l_->origin ()->warning (s);
+ if (info.music_cause ())
+ info.music_cause ()->origin ()->warning (s);
else
::warning (s);
}
if (Note_column::has_interface (i.grob_l_))
{
/*should check Y axis? */
- if (Note_column::rest_b (i.grob_l_) || i.grob_l_->parent_l (X_AXIS))
+ if (Note_column::rest_b (i.grob_l_) || i.grob_l_->get_parent (X_AXIS))
return ;
note_column_l_arr_.push (i.grob_l_);
Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
- me = me->parent_l (a);
+ me = me->get_parent (a);
/*
ugh. the way DONE is done is not clean
*/
don't look at the staff-position, since we can't be sure
whether Clef_engraver already applied a vertical shift.
*/
- Note_req * nr = dynamic_cast<Note_req*> (info.req_l_);
+ Note_req * nr = dynamic_cast<Note_req*> (info.music_cause ());
if (nr)
pitches_.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
}
Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- me = me->parent_l (X_AXIS);
+ me = me->get_parent (X_AXIS);
SCM l = me->get_grob_property ("dots");
do_shifts (l);
return gh_double2scm (0.0);
{
Side_position_interface::add_support (me,rh);
- Pointer_group_interface ::add_element (me, "dots",d);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("dots"), d);
d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
Axis_group_interface::add_element (me, d);
}
void
Engraver::announce_grob (Grob* e, Music *m)
{
+ /*
+ TODO: junk grob-info, and make a cause grob-property to store
+ `causes' generically.
+ */
+
if (m && store_locations_global_b
&& m->origin ()->location_str ().length_i ())
{
e->set_grob_property ("origin", m->get_mus_property ("origin"));
}
- Grob_info i (e, m);
+ Grob_info i (e, m ? m->self_scm () : SCM_UNDEFINED);
if (!i.origin_trans_l_)
i.origin_trans_l_ = this;
daddy_grav_l ()->announce_grob (i);
--- /dev/null
+/*
+ fingering-engraver.cc -- implement Fingering_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+
+#include "engraver.hh"
+#include "side-position-interface.hh"
+#include "item.hh"
+#include "musical-request.hh"
+#include "stem.hh"
+#include "rhythmic-head.hh"
+
+class Fingering_engraver : public Engraver
+{
+ Link_array<Music> reqs_;
+ Link_array<Item> fingerings_;
+
+ Link_array<Music> up_reqs_;
+ Link_array<Music> hor_reqs_;
+ Link_array<Music> down_reqs_;
+
+public:
+ TRANSLATOR_DECLARATIONS(Fingering_engraver);
+protected:
+ virtual bool try_music (Music* m);
+ virtual void stop_translation_timestep ();
+ virtual void start_translation_timestep ();
+ virtual void process_music ();
+ virtual void acknowledge_grob (Grob_info);
+
+ void make_script (Direction, Music*,Axis, int);
+};
+
+bool
+Fingering_engraver::try_music (Music *m)
+{
+ if (dynamic_cast<Text_script_req*> (m))
+ {
+ if (m->get_mus_property ("text-type") != ly_symbol2scm ("finger"))
+ return false;
+
+ reqs_.push (m);
+ return true;
+ }
+ return false;
+}
+
+void
+Fingering_engraver::acknowledge_grob (Grob_info inf)
+{
+
+ if (Stem::has_interface (inf.grob_l_))
+ {
+ for (int i=0; i < fingerings_.size (); i++)
+ {
+ Side_position_interface::add_support (fingerings_[i],inf.grob_l_);
+ }
+ }
+ else if (Rhythmic_head::has_interface (inf.grob_l_))
+ {
+ Music * mc =inf.music_cause ();
+ Pitch * mp = mc? unsmob_pitch (mc->get_mus_property ("pitch")) :0;
+ for (int i=0; i < fingerings_.size (); i++)
+ {
+ Grob*t = fingerings_[i];
+ Side_position_interface::add_support (t,inf.grob_l_);
+ Pitch *fp = unsmob_pitch (t->get_grob_property ("pitch"));
+ if (fp)
+ {
+ if (!mp)
+ continue;
+
+ if (*fp == *mp)
+ {
+ Axis other = other_axis (Side_position_interface::get_axis (t));
+ t->set_parent (inf.grob_l_, other);
+ }
+ }
+ else
+ {
+ if (!t->get_parent (X_AXIS))
+ t->set_parent (inf.grob_l_, X_AXIS);
+ }
+ }
+ }
+}
+
+static int
+req_compare (Music * const &a,Music * const &b)
+{
+ Pitch *pa = unsmob_pitch (a->get_mus_property ("pitch"));
+ Pitch *pb = unsmob_pitch (b->get_mus_property ("pitch"));
+
+ if (!pa && !pb)
+ return 0;
+ if (pa && !pb)
+ return 1;
+ if (!pa && pb)
+ return -1;
+
+ return Pitch::compare (*pa, *pb);
+}
+
+void
+Fingering_engraver::process_music ()
+{
+ if (!reqs_.size())
+ return ;
+
+ Link_array<Music> pitch_sorted_reqs = reqs_;
+ for (int i= pitch_sorted_reqs.size(); i--;)
+ {
+ SCM dir = pitch_sorted_reqs[i]->get_mus_property ("direction");
+ if (isdir_b (dir) && to_dir (dir)) {
+ if (to_dir (dir) == UP)
+ up_reqs_.push (pitch_sorted_reqs[i]);
+ else if (to_dir (dir) == DOWN)
+ down_reqs_ .push (pitch_sorted_reqs[i]);
+ pitch_sorted_reqs.del(i);
+
+ continue ;
+ }
+ else if (!unsmob_pitch (pitch_sorted_reqs[i]->get_mus_property ("pitch")))
+ {
+ /*
+ chuck out reqs that have no pitch. We put them over the note by default.
+ */
+ up_reqs_.push (pitch_sorted_reqs [i]);
+ pitch_sorted_reqs.del (i);
+ }
+ }
+ up_reqs_.reverse ();
+ down_reqs_.reverse ();
+
+ pitch_sorted_reqs.sort (&req_compare);
+
+ if (to_boolean (get_property ("scriptHorizontal")))
+ {
+#if 1 // -> 0 for testing horizontal fingerings.
+
+ down_reqs_.push ( pitch_sorted_reqs[0]);
+ pitch_sorted_reqs.del (0);
+
+ if (pitch_sorted_reqs.size())
+ {
+ up_reqs_.push (pitch_sorted_reqs.top ());
+ pitch_sorted_reqs.pop();
+ }
+#endif
+ hor_reqs_ = pitch_sorted_reqs;
+ }
+ else
+ {
+ int sz = pitch_sorted_reqs.size ();
+ down_reqs_.concat (pitch_sorted_reqs.slice(0, (sz + sz%2)/2 ));
+ up_reqs_.concat (pitch_sorted_reqs.slice((sz + sz%2)/2, sz));
+ hor_reqs_ .clear ();
+ }
+
+ for (int i = 0; i < down_reqs_.size();i++)
+ make_script (DOWN, down_reqs_[i], Y_AXIS, i);
+ for (int i = 0; i < up_reqs_.size();i++)
+ make_script (UP, up_reqs_[i], Y_AXIS, i);
+ for (int i = 0; i < hor_reqs_.size();i++)
+ make_script (CENTER, hor_reqs_[i],X_AXIS, i);
+}
+
+void
+Fingering_engraver::make_script (Direction d, Music *r,Axis a, int i)
+{
+ Item *fingering = new Item (get_property ("Fingering"));
+
+ Axis other = other_axis (a);
+
+ SCM pitch = r->get_mus_property ("pitch");
+ if (unsmob_pitch (pitch))
+ fingering->set_grob_property ("pitch", pitch);
+
+ Side_position_interface::set_axis (fingering, a);
+
+ fingering->add_offset_callback (Side_position_interface::aligned_on_self_proc, other);
+ fingering->add_offset_callback (Side_position_interface::centered_on_parent_proc, other);
+ fingering->set_grob_property ("script-priority",
+ gh_int2scm (100 + d* i));
+
+
+ if (!isdir_b (fingering->get_grob_property ("direction")))
+ {
+ if (d)
+ fingering->set_grob_property ("direction", gh_int2scm (d));
+ else
+ fingering->set_grob_property ("direction", gh_int2scm (RIGHT));
+ }
+
+ fingering->set_grob_property ("text", r->get_mus_property ("text"));
+
+ SCM nonempty = get_property ("textNonEmpty");
+ if (to_boolean (nonempty))
+ /*
+ empty fingering: signal that no rods should be applied.
+ */
+ fingering->set_grob_property ("no-spacing-rods" , SCM_BOOL_F);
+
+ announce_grob (fingering, r);
+ fingerings_.push (fingering);
+}
+
+void
+Fingering_engraver::stop_translation_timestep ()
+{
+ if (!fingerings_.size ())
+ return;
+
+ for (int i=0; i < fingerings_.size (); i++)
+ {
+ Item *ti = fingerings_[i];
+ Side_position_interface::add_staff_support (ti);
+ typeset_grob (ti);
+ }
+ fingerings_.clear ();
+}
+
+void
+Fingering_engraver::start_translation_timestep ()
+{
+ reqs_.clear ();
+ up_reqs_.clear ();
+ down_reqs_.clear ();
+ hor_reqs_.clear ();
+}
+
+Fingering_engraver::Fingering_engraver()
+{
+
+}
+
+ENTER_DESCRIPTION(Fingering_engraver,
+/* descr */ "Create fingering-scripts",
+/* creats*/ "Fingering",
+/* acks */ "rhythmic-head-interface stem-interface",
+/* reads */ "scriptHorizontal textNonEmpty",
+/* write */ "");
#include "translator.hh"
#include "translator-group.hh"
-Grob_info::Grob_info (Grob*s_l, Music *r_l)
+Grob_info::Grob_info (Grob*s_l, SCM c)
{
grob_l_ = s_l;
- req_l_ = r_l;
+ cause_ = c;
origin_trans_l_ = 0;
}
Grob_info::Grob_info ()
{
grob_l_ = 0;
- req_l_ = 0;
+ cause_ = SCM_EOL;
origin_trans_l_ = 0;
}
+Music*
+Grob_info::music_cause ()
+{
+ return unsmob_music (cause_);
+}
Link_array<Translator>
Grob_info::origin_trans_l_arr (Translator* end) const
{
if (e)
{
- Pointer_group_interface ::add_element (this, "dependencies",e);
-
+ Pointer_group_interface::add_element (this, ly_symbol2scm ("dependencies"),e);
}
else
programming_error ("Null dependency added");
for (int a = X_AXIS; a < NO_AXES; a ++)
{
Axis ax = (Axis)a;
- Grob * parent = me->parent_l (ax);
+ Grob * parent = me->get_parent (ax);
if (!parent)
continue;
{
scm_gc_mark (s->dim_cache_[a].offset_callbacks_);
scm_gc_mark (s->dim_cache_[a].dimension_);
- Grob *p = s->parent_l (Y_AXIS);
+ Grob *p = s->get_parent (Y_AXIS);
if (p)
scm_gc_mark (p->self_scm ());
}
#include "grob.hh"
+/*
+ This special add_thing routine is slightly more efficient than
+
+ set_prop (name,cons (thing, get_prop (name)))
+
+ since it can reuse the handle returned by scm_assq().
+*/
+
void
-Group_interface::add_thing (Grob*me, String name, SCM s)
+Group_interface::add_thing (Grob*me, SCM sym, SCM thing)
{
- me->set_grob_property (name.ch_C (),
- gh_cons (s, me->get_grob_property (name.ch_C ())));
+ SCM handle = scm_sloppy_assq (sym, me->mutable_property_alist_);
+ if (handle != SCM_BOOL_F)
+ {
+ gh_set_cdr_x (handle, gh_cons (thing, gh_cdr (handle)));
+
+ }
+ else
+ {
+ /*
+ There is no mutable prop yet, so create an entry, and put it in front of the
+ mutable prop list.
+ */
+ handle = scm_sloppy_assq (sym, me->immutable_property_alist_);
+ SCM tail = (handle != SCM_BOOL_F) ? gh_cdr(handle) : SCM_EOL;
+ me->mutable_property_alist_ = gh_cons (gh_cons (sym, gh_cons (thing, tail)),
+ me->mutable_property_alist_);
+ }
}
+void
+Group_interface::add_thing (Grob*me, String name, SCM thing)
+{
+ add_thing (me, ly_symbol2scm (name.ch_C()), thing);
+}
int
Group_interface::count (Grob *me, String name)
void
-Pointer_group_interface::add_element (Grob*me, String name, Grob*p)
+Pointer_group_interface::add_element (Grob*me, SCM name, Grob*p)
{
Group_interface::add_thing (me, name, p->self_scm ());
}
Grob *daughter = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
- force_hara_kiri_callback (daughter->parent_l (a)->self_scm (), axis);
+ force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
return gh_double2scm (0.0);
}
Hara_kiri_group_spanner::add_interesting_item (Grob* me,Grob* n)
{
me->add_dependency (n);
- Pointer_group_interface::add_element (me, "items-worth-living",n);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("items-worth-living"),n);
}
#ifndef STAFFELEMINFO_HH
#define STAFFELEMINFO_HH
+#include "lily-guile.hh"
#include "lily-proto.hh"
#include "parray.hh"
struct Grob_info {
Translator * origin_trans_l_;
friend class Engraver;
-public:
- Link_array<Translator> origin_trans_l_arr (Translator*) const;
Grob * grob_l_;
- Music *req_l_;
-
- Grob_info (Grob*, Music*);
+
+ /*
+ Notice that CAUSE is not GC protected ; this might be a cause for
+ GC errors if you don't use music or grobs as a cause.
+ */
+ SCM cause_;
+
+public:
+ Music * music_cause ();
+ Link_array<Translator> origin_trans_l_arr (Translator*) const;
+ Grob_info (Grob*, SCM);
Grob_info ();
};
*/
void set_parent (Grob* e, Axis);
- Grob *parent_l (Axis a) const { return dim_cache_[a].parent_l_; }
+ Grob *get_parent (Axis a) const { return dim_cache_[a].parent_l_; }
DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
};
{
public:
static int count (Grob* , String);
+ static void add_thing (Grob*, SCM, SCM);
static void add_thing (Grob*, String nm, SCM);
};
struct Pointer_group_interface : public Group_interface {
public:
- static void add_element (Grob*, String nm, Grob*e);
+ static void add_element (Grob*, SCM nm, Grob*e);
};
/**
Put all score elements of ELT's property called NAME into an array,
static int compare (Melodic_req const&,Melodic_req const&);
protected:
- /// transpose. #delta# is relative to central c.
- virtual void transpose (Pitch delta);
virtual bool do_equal_b (Request const*) const;
VIRTUAL_COPY_CONS (Music);
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
- static Molecule ledger_lines (Grob*,int,Direction,Interval);
+ static Interval head_extent (Grob*,Axis);
+ static Molecule ledger_lines (Grob*, bool, int,Direction,Interval);
static Molecule ledger_line (Interval, Grob*) ;
DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM ));
static bool has_interface (Grob*);
--- /dev/null
+/*
+note-spacing.hh -- declare Note_spacing
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef NOTE_SPACING_HH
+#define NOTE_SPACING_HH
+
+#include "lily-proto.hh"
+
+class Note_spacing
+{
+public:
+ static bool has_interface (Grob*);
+};
+
+#endif /* NOTE_SPACING_HH */
--- /dev/null
+/*
+staff-spacing.hh -- declare Staff_spacing
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef STAFF_SPACING_HH
+#define STAFF_SPACING_HH
+
+#include "lily-proto.hh"
+
+class Staff_spacing
+{
+public:
+ static bool has_interface (Grob*);
+};
+
+#endif /* STAFF_SPACING_HH */
if (!dynamic_cast<Item*> (me))
programming_error ("only items can be breakable.");
- Item * i =dynamic_cast<Item*> (me->parent_l (X_AXIS));
+ Item * i =dynamic_cast<Item*> (me->get_parent (X_AXIS));
return (i) ? Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
}
Paper_column *
Item::column_l () const
{
- Item *parent = dynamic_cast<Item*> (parent_l (X_AXIS));
+ Item *parent = dynamic_cast<Item*> (get_parent (X_AXIS));
return parent ? parent->column_l () : 0;
}
Line_of_score *
Item::line_l () const
{
- Grob *g = parent_l (X_AXIS);
+ Grob *g = get_parent (X_AXIS);
return g ? g->line_l () : 0;
}
void
Line_group_engraver_group::typeset_grob (Grob *elem)
{
- if (!elem->parent_l (Y_AXIS))
+ if (!elem->get_parent (Y_AXIS))
Axis_group_interface::add_element (staffline_p_, elem);
Engraver_group_engraver::typeset_grob (elem);
}
Line_of_score::typeset_grob (Grob * elem_p)
{
elem_p->pscore_l_ = pscore_l_;
- Pointer_group_interface::add_element (this, "all-elements",elem_p);
+ Pointer_group_interface::add_element (this, ly_symbol2scm ("all-elements"),elem_p);
scm_gc_unprotect_object (elem_p->self_scm ());
}
{
unsmob_grob (ly_car (s))->do_break_processing ();
}
+
/*
fixups must be done in broken line_of_scores, because new elements
are put over there. */
}
count += scm_ilength (all);
}
-
/*
needed for doing items.
right = loose;
- Real rx = right->relative_coordinate (right->parent_l (X_AXIS), X_AXIS);
- Real lx = left->relative_coordinate (left->parent_l (X_AXIS), X_AXIS);
+ Real rx = right->relative_coordinate (right->get_parent (X_AXIS), X_AXIS);
+ Real lx = left->relative_coordinate (left->get_parent (X_AXIS), X_AXIS);
int j = 1;
loose = col;
/*
generate all molecules to trigger all font loads.
- (ugh. This is not very memory efficient.) */
+ (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 ();
void
Multi_measure_rest::add_column (Grob*me,Item* c)
{
- Pointer_group_interface::add_element (me, "columns",c);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("columns"),c);
add_bound_item (dynamic_cast<Spanner*> (me),c);
}
void
-Music::transpose (Pitch)
+Music::transpose (Pitch delta)
{
+ Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
+ if (!p)
+ return ;
+
+ Pitch np = *p;
+ np.transpose (delta);
+
+ if (abs (np.alteration_i_) > 2)
+ {
+ warning (_f ("Transposition by %s makes accidental larger than two",
+ delta.str ()));
+ }
+
+ set_mus_property ("pitch", np.smobbed_copy ());
}
IMPLEMENT_TYPE_P (Music, "music?");
{
}
-void
-Melodic_req::transpose (Pitch delta)
-{
- Pitch p = *unsmob_pitch (get_mus_property ("pitch"));
-
- p.transpose (delta);
-
- if (abs (p.alteration_i_) > 2)
- {
- warning (_f ("Transposition by %s makes accidental larger than two",
- delta.str ()));
- }
-
- set_mus_property ("pitch", p.smobbed_copy ());
-}
-
bool
Melodic_req::do_equal_b (Request const* r) const
{
return rh; // ; && !compare (*this, *rh);
}
-
-
Moment
Rhythmic_req::length_mom () const
{
- Duration* d = unsmob_duration (get_mus_property ("duration"));
- return d ? d->length_mom () : Moment (0);
+ Duration *d = unsmob_duration (get_mus_property ("duration"));
+ if (!d){
+ Moment m ;
+ programming_error("Rhythmic_req has no duration");
+ return m;
+ }
+ return d->length_mom ();
}
void
*/
+
#include "paper-column.hh"
#include "dimensions.hh"
#include "paper-def.hh"
}
else if (Note_head::has_interface (h))
{
- Pointer_group_interface::add_element (me, "note-heads",h);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("note-heads"),h);
}
Axis_group_interface::add_element (me, h);
}
#include "musical-request.hh"
#include "rhythmic-head.hh"
+/*
+ Note_head contains the code for printing note heads and the ledger lines.
+
+ TODO: maybe it's worthwhile to split away the Ledger lines into a
+ separate grob. */
+
#include "staff-symbol-referencer.hh"
/*
Molecule
-Note_head::ledger_lines (Grob*me, int count, Direction dir, Interval idw)
+Note_head::ledger_lines (Grob*me,
+ bool take_space,
+ int count, Direction dir, Interval idw)
{
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
+
+ /*
+ idw ?
+
+ (who's that ? :-)
+
+
+ --hwn
+ */
Molecule ledger (ledger_line (idw, me));
- ledger.set_empty (true);
+ if (!take_space)
+ ledger.set_empty (true);
+
Real offs = (Staff_symbol_referencer::on_staffline (me))
? 0.0
: -dir * inter_f;
return legs;
}
-MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1);
-
-SCM
-Note_head::brew_molecule (SCM smob)
+Molecule
+internal_brew_molecule (Grob *me, bool ledger_take_space)
{
- Grob *me = unsmob_grob (smob);
-
int sz = Staff_symbol_referencer::line_count (me)-1;
int p = (int) rint (Staff_symbol_referencer::position_f (me));
int streepjes_i = abs (p) < sz
SCM style = me->get_grob_property ("style");
if (!gh_symbol_p (style))
{
- return SCM_EOL;
+ return Molecule();
}
/*
String name = "noteheads-" + ly_scm2string (scm_primitive_eval (exp));
Molecule out = Font_interface::get_default_font (me)->find_by_name (name);
-
if (streepjes_i)
{
Direction dir = (Direction)sign (p);
Interval hd = out.extent (X_AXIS);
Real hw = hd.length ()/4;
- out.add_molecule (ledger_lines (me, streepjes_i, dir,
+ out.add_molecule (Note_head::ledger_lines (me, ledger_take_space, streepjes_i, dir,
Interval (hd[LEFT] - hw,
hd[RIGHT] + hw)));
}
-
- return out.smobbed_copy ();
+ return out;
+}
+
+MAKE_SCHEME_CALLBACK (Note_head,brew_molecule,1);
+
+SCM
+Note_head::brew_molecule (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ return internal_brew_molecule (me, true).smobbed_copy ();
+}
+
+/*
+ Compute the width the head without ledgers.
+ */
+Interval
+Note_head::head_extent (Grob *me, Axis a)
+{
+ return internal_brew_molecule (me, false).extent (a);
}
bool
MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1);
+/*
+ TODO: ledger lines are causing a mess again, now with accidentals and
+ ez-note heads.
+ */
SCM
Note_head::brew_ez_molecule (SCM smob)
{
Direction dir = (Direction)sign (p);
Interval hd = m.extent (X_AXIS);
Real hw = hd.length ()/4;
- m.add_molecule (ledger_lines (me, streepjes_i, dir,
- Interval (hd[LEFT] - hw,
+ m.add_molecule (ledger_lines (me, false, streepjes_i, dir,
+ Interval (hd[LEFT] - hw,
hd[RIGHT] + hw)));
}
virtual void stop_translation_timestep ();
};
+
+Note_heads_engraver::Note_heads_engraver()
+{
+}
+
bool
Note_heads_engraver::try_music (Music *m)
{
return now_mom () < note_end_mom_;
}
return false;
-
}
Item *note_p = new Item (get_property ("NoteHead"));
Staff_symbol_referencer::set_interface (note_p);
-
-
Music * req = note_req_l_arr_[i];
note_p_arr_.push (note_p);
}
}
-
+
void
Note_heads_engraver::stop_translation_timestep ()
{
{
typeset_grob (note_p_arr_[i]);
}
+
note_p_arr_.clear ();
for (int i=0; i < dot_p_arr_.size (); i++)
{
void
Note_heads_engraver::start_translation_timestep ()
{
-
-
}
-Note_heads_engraver::Note_heads_engraver()
-{}
ENTER_DESCRIPTION(Note_heads_engraver,
/* descr */ "Generate one or more noteheads from Music of type Note_req.",
--- /dev/null
+/*
+note-spacing.cc -- implement
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "note-spacing.hh"
+#include "grob.hh"
+
+bool
+Note_spacing::has_interface (Grob* g)
+{
+ return g && g->has_interface (ly_symbol2scm ("note-spacing-interface"));
+}
THIS->push_spot ();
} /*cont */ simple_element post_requests {
Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
- if (l) {
- for (int i=0; i < $1->size (); i++)
- l->append_music ($1->elem (i));
- for (int i=0; i < $4->size (); i++)
- l->append_music ($4->elem (i));
- }
- else
- programming_error ("Need Sequence to add music to");
+
+ $1->concat (*$4);
+ for (int i=0; i < $1->size (); i++) {
+ Music * m = $1->elem (i);
+ l->append_music (m);
+ }
$$ = $3;
+
+ delete $1;
+ delete $4;
}
| command_element
;
}
| PENALTY SCM_T {
-
-
Break_req * b = new Break_req;
SCM s = $2;
if (!gh_number_p (s))
}
;
-
script_dir:
'_' { $$ = DOWN; }
| '^' { $$ = UP; }
Side_position_interface::add_support (p->item_p_, info.grob_l_);
if (Side_position_interface::get_axis (p->item_p_) == X_AXIS
- && !p->item_p_->parent_l (Y_AXIS))
+ && !p->item_p_->get_parent (Y_AXIS))
p->item_p_->set_parent (info.grob_l_, Y_AXIS);
}
if (Stem::has_interface (info.grob_l_))
{
if (Rhythmic_head::has_interface (info_l_.grob_l_))
{
- Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.req_l_);
+ Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.music_cause ());
if (!note_req_l_)
return;
right_heads_.push (Grob_pitch_tuple (info_l_.grob_l_, note_req_l_,
#include "translator-group.hh"
/*
- JUNKME: should use pushproperty everywhere.
-
+ This is deprecated, since revert/override should be used
*/
class Property_engraver : public Engraver
{
- /*
- UGH. Junk Dictionary
- */
Scheme_hash_table *prop_dict_; // junkme
void apply_properties (SCM, Grob*, Translator_group *origin);
void
Property_engraver::acknowledge_grob (Grob_info i)
{
- SCM ifs = i.grob_l_->get_grob_property ("interfaces");
+ SCM ifs = i.grob_l_->get_grob_property ("interfaces");
SCM props;
for (; gh_pair_p (ifs); ifs = ly_cdr (ifs))
{
Rest_collision::add_column (Grob*me,Grob *p)
{
me->add_dependency (p);
- Pointer_group_interface::add_element (me, "elements", p);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), p);
/*
only add callback for the rests, since we don't move anything else.
{
Link_array<Grob> rhead_l_arr_;
Grob * stem_l_;
- Grob *ncol_p_;
- Grob *dotcol_l_;
+ Grob * note_column_;
+ Grob * dotcol_l_;
+
+ Grob * last_spacing_;
+ Grob * spacing_;
TRANSLATOR_DECLARATIONS(Rhythmic_column_engraver);
protected:
virtual void create_grobs ();
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
-
};
Rhythmic_column_engraver::Rhythmic_column_engraver ()
{
+ spacing_ =0 ;
+ last_spacing_ = 0;
+
stem_l_ =0;
- ncol_p_=0;
+ note_column_=0;
dotcol_l_ =0;
}
{
if (rhead_l_arr_.size ())
{
- if (!ncol_p_)
+ if (!note_column_)
{
- ncol_p_ = new Item (get_property ("NoteColumn"));
- Note_column::set_interface (ncol_p_);
- announce_grob (ncol_p_, 0);
+ note_column_ = new Item (get_property ("NoteColumn"));
+ Note_column::set_interface (note_column_);
+ announce_grob (note_column_, 0);
+
+ spacing_ = new Item (get_property ("NoteSpacing"));
+ spacing_->set_grob_property ("left-item", note_column_->self_scm ());
+ announce_grob (spacing_, 0);
+
+ if (last_spacing_)
+ {
+ last_spacing_->set_grob_property ("right-item" , note_column_->self_scm ());
+ }
}
for (int i=0; i < rhead_l_arr_.size (); i++)
{
- if (!rhead_l_arr_[i]->parent_l (X_AXIS))
- Note_column::add_head (ncol_p_, rhead_l_arr_[i]);
+ if (!rhead_l_arr_[i]->get_parent (X_AXIS))
+ Note_column::add_head (note_column_, rhead_l_arr_[i]);
}
rhead_l_arr_.set_size (0);
}
- if (ncol_p_)
+ if (note_column_)
{
if (dotcol_l_
- && !dotcol_l_->parent_l (X_AXIS))
+ && !dotcol_l_->get_parent (X_AXIS))
{
- Note_column::set_dotcol (ncol_p_, dotcol_l_);
+ Note_column::set_dotcol (note_column_, dotcol_l_);
}
if (stem_l_
- && !stem_l_->parent_l (X_AXIS))
+ && !stem_l_->get_parent (X_AXIS))
{
- Note_column::set_stem (ncol_p_, stem_l_);
+ Note_column::set_stem (note_column_, stem_l_);
stem_l_ = 0;
}
void
Rhythmic_column_engraver::stop_translation_timestep ()
{
- if (ncol_p_)
+ if (note_column_)
{
- typeset_grob (ncol_p_);
- ncol_p_ =0;
+ typeset_grob (note_column_);
+ note_column_ =0;
}
}
command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
- Grob_info i1 (command_column_l_, 0), i2 (musical_column_l_,0);
-
+ Grob_info i1 (command_column_l_, SCM_EOL);
i1.origin_trans_l_ = this;
+
+ Grob_info i2 (musical_column_l_, SCM_EOL);
i2.origin_trans_l_ = this;
+
announce_grob (i1);
announce_grob (i2);
}
}
else
{
- if (!elem_p->parent_l (X_AXIS))
+ if (!elem_p->get_parent (X_AXIS))
{
bool br = to_boolean (elem_p->get_grob_property ("breakable"));
Axis_group_interface::add_element (br ? command_column_l_ : musical_column_l_, elem_p);
}
}
- if (!elem_p->parent_l (Y_AXIS))
+ if (!elem_p->get_parent (Y_AXIS))
Axis_group_interface::add_element (scoreline_l_, elem_p);
}
elem_p_arr_.clear ();
/*
- g-script-column-engraver.cc -- implement Script_column_engraver
+ script-column-engraver.cc -- implement Script_column_engraver
source file of the GNU LilyPond music typesetter
if (!scol_p_ && script_l_arr_.size () > 1)
{
scol_p_ = new Item (get_property ("ScriptColumn"));
-
-
announce_grob (scol_p_, 0);
}
Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
script_l_arr_.clear ();
}
+
}
ENTER_DESCRIPTION(Script_column_engraver,
if (!gh_number_p (p))
return;
- Pointer_group_interface::add_element (me, "scripts",i);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("scripts"),i);
me->add_dependency (i);
}
{
Grob *e = script_p_arr_[i];
- if (!e->parent_l (X_AXIS))
+ if (!e->get_parent (X_AXIS))
{
e->set_parent (inf.grob_l_, X_AXIS);
}
if (Side_position_interface::get_axis (e) == X_AXIS
- && !e->parent_l (Y_AXIS))
+ && !e->get_parent (Y_AXIS))
{
e->set_parent (inf.grob_l_, Y_AXIS);
e->add_dependency (inf.grob_l_); // ??
void
Separating_group_spanner::add_spacing_unit (Grob* me ,Item*i)
{
- Pointer_group_interface::add_element (me, "elements",i);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), i);
me->add_dependency (i);
}
#include "paper-def.hh"
#include "engraver.hh"
#include "axis-group-interface.hh"
+#include "note-spacing.hh"
class Separating_line_group_engraver : public Engraver
{
protected:
Item * break_malt_p_;
Item * musical_malt_p_;
+ Item * last_musical_malt_p_;
+ Grob * last_note_spacing_;
+ Grob * current_note_spacing_;
+ Grob * staff_spacing_;
+
Spanner * sep_span_p_;
virtual void acknowledge_grob (Grob_info);
Separating_line_group_engraver::Separating_line_group_engraver ()
{
+ last_note_spacing_ = 0;
+ current_note_spacing_ = 0;
+ staff_spacing_ =0;
+
sep_span_p_ = 0;
break_malt_p_ = 0;
musical_malt_p_ =0;
Item * it = dynamic_cast <Item *> (i.grob_l_);
if (!it)
return;
- if (it->parent_l (X_AXIS)
- && it->parent_l (X_AXIS)->has_extent_callback_b
- (Axis_group_interface::group_extent_callback_proc, X_AXIS))
+ if (it->get_parent (X_AXIS)
+ && it->get_parent (X_AXIS)
+ ->has_extent_callback_b(Axis_group_interface::group_extent_callback_proc, X_AXIS))
return;
+ if (Note_spacing::has_interface (it))
+ {
+ current_note_spacing_ = it;
+ return ;
+ }
bool ib =Item::breakable_b (it);
Item *&p_ref_ (ib ? break_malt_p_
if (!p_ref_)
{
- p_ref_ = new Item
- (get_property ("SeparationItem"));
-
+ p_ref_ = new Item (get_property ("SeparationItem"));
+
if (ib)
p_ref_->set_grob_property ("breakable", SCM_BOOL_T);
announce_grob (p_ref_, 0);
+
+ if (p_ref_ == break_malt_p_)
+ {
+ staff_spacing_ = new Item (get_property ("StaffSpacing"));
+ staff_spacing_->set_grob_property ("left-item", break_malt_p_->self_scm ());
+ announce_grob (staff_spacing_, 0);
+
+ if (last_note_spacing_)
+ last_note_spacing_->set_grob_property ("right-item",
+ break_malt_p_->self_scm ());
+ }
}
+
Separation_item::add_item (p_ref_,it);
}
if (break_malt_p_)
{
Separating_group_spanner::add_spacing_unit (sep_span_p_, break_malt_p_);
-
typeset_grob (break_malt_p_);
+
break_malt_p_ =0;
}
+ if (staff_spacing_)
+ {
+ if (musical_malt_p_)
+ staff_spacing_->set_grob_property ("right-item", musical_malt_p_->self_scm());
+
+ typeset_grob (staff_spacing_);
+ staff_spacing_ = 0;
+ }
+
if (musical_malt_p_)
{
Separating_group_spanner::add_spacing_unit (sep_span_p_, musical_malt_p_);
typeset_grob (musical_malt_p_);
}
+ last_note_spacing_ = current_note_spacing_ ;
+ current_note_spacing_ =0 ;
+
musical_malt_p_ =0;
}
Separation_item::add_item (Grob*s,Item* i)
{
assert (i);
- Pointer_group_interface::add_element (s,"elements",i);
+ Pointer_group_interface::add_element (s, ly_symbol2scm ("elements"),i);
s->add_dependency (i);
}
void
Side_position_interface::add_support (Grob*me, Grob*e)
{
- Pointer_group_interface::add_element (me, "side-support-elements",e);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("side-support-elements"), e);
}
SCM
Side_position_interface::general_side_position (Grob * me, Axis a, bool use_extents)
{
- Grob *common = me->parent_l (a);
+ Grob *common = me->get_parent (a);
/*
As this is only used as a callback, this is called only once. We
Direction dir = Side_position_interface::get_direction (me);
- Real off = me->parent_l (a)->relative_coordinate (common, a);
+ Real off = me->get_parent (a)->relative_coordinate (common, a);
SCM minimum = me->remove_grob_property ("minimum-space");
Real total_off = dim.linear_combination (dir) + off;
/**
callback that centers the element on itself
+
+ Requires that self-alignment-{X,Y} be set.
*/
MAKE_SCHEME_CALLBACK (Side_position_interface,aligned_on_self,2);
SCM
{
return gh_double2scm (- unsmob_grob (align)->relative_coordinate (me, a));
}
- return gh_double2scm (0.0);
+ return gh_double2scm (0.0);
}
{
Grob *me = unsmob_grob (element_smob);
Axis a = (Axis) gh_scm2int (axis);
- Grob *him = me->parent_l (a);
+ Grob *him = me->get_parent (a);
return gh_double2scm (him->extent (him,a).center ());
}
Side_position_interface::add_staff_support (Grob*me)
{
Grob* st = Staff_symbol_referencer::staff_symbol_l (me);
- if (st)
+ if (st && get_axis (me) == Y_AXIS)
{
add_support (me,st);
}
warning (_ ("Putting slur over rest. Ignoring."));
else
{
- Pointer_group_interface::add_element (me, "note-columns",n);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("note-columns"), n);
me->add_dependency (n);
}
#include "spacing-spanner.hh"
#include "engraver.hh"
#include "pqueue.hh"
+#include "note-spacing.hh"
+#include "staff-spacing.hh"
+#include "group-interface.hh"
struct Rhythmic_tuple
{
void
Spacing_engraver::acknowledge_grob (Grob_info i)
{
+ if (Note_spacing::has_interface (i.grob_l_) || Staff_spacing::has_interface (i.grob_l_))
+ {
+ Pointer_group_interface::add_element (spacing_p_, ly_symbol2scm ("wishes"), i.grob_l_);
+ }
+
if (to_boolean (i.grob_l_->get_grob_property ("non-rhythmic")))
return;
- if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.req_l_))
+ if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.music_cause ()))
{
Rhythmic_tuple t (i, now_mom () + r->length_mom ());
now_durations_.push (t);
shortest_playing.set_infinite (1);
for (int i=0; i < playing_durations_.size (); i++)
{
- Moment m = (playing_durations_[i].info_.req_l_)->length_mom ();
+ Moment m = (playing_durations_[i].info_.music_cause ())->length_mom ();
if (m.to_bool ())
{
shortest_playing = shortest_playing <? m;
starter=inf;
for (int i=0; i < now_durations_.size (); i++)
{
- Moment m = now_durations_[i].info_.req_l_->length_mom ();
+ Moment m = now_durations_[i].info_.music_cause ()->length_mom ();
if (m.to_bool ())
starter = starter <? m;
{
for (SCM s = arpeggios_[i]->get_grob_property ("stems");
gh_pair_p (s); s = ly_cdr (s))
- Group_interface::add_thing (span_arpeggio_, "stems", ly_car (s));
+ Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), ly_car (s));
for (SCM s = arpeggios_[i]->get_grob_property ("side-support-elements");
gh_pair_p (s); s = ly_cdr (s))
- Group_interface::add_thing (span_arpeggio_, "side-support-elements", ly_car (s));
+ Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), ly_car (s));
/*
we can't kill the children, since we don't want to the
void
Span_bar::add_bar (Grob*me, Grob*b)
{
- Pointer_group_interface::add_element (me,"elements", b);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("elements"), b);
me->add_dependency (b);
}
*/
for (int a = X_AXIS; a < NO_AXES; a ++)
{
- if (Spanner* parent = dynamic_cast<Spanner*> (parent_l ((Axis)a)))
+ if (Spanner* parent = dynamic_cast<Spanner*> (get_parent ((Axis)a)))
{
if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ()))
{
*/
if (dynamic_cast<Paper_column*> (i))
{
- Pointer_group_interface::add_element (i, "bounded-by-me",this);
+ Pointer_group_interface::add_element (i, ly_symbol2scm ("bounded-by-me"), this);
}
}
--- /dev/null
+/*
+staff-spacing.cc -- implement
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "staff-spacing.hh"
+#include "grob.hh"
+
+bool
+Staff_spacing::has_interface (Grob* g)
+{
+ return g && g->has_interface (ly_symbol2scm ("staff-spacing-interface"));
+}
// TODO
- if (gh_string_p (s))
+ if (gh_string_p (s) || gh_pair_p (s))
/*
if (i.grob_l_->has_interface (symbol ("lyric-syllable-interface")))
gh_int2scm (tremolo_flags));
}
}
- announce_grob (stem_p_, i.req_l_);
+ announce_grob (stem_p_, i.music_cause ());
}
if (Stem::flag_i (stem_p_) != duration_log)
{
- i.req_l_->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::flag_i (stem_p_)));
+ i.music_cause ()->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::flag_i (stem_p_)));
}
Stem::add_head (stem_p_,h);
TODO: This is way too hairy
*/
+
#include <math.h> // m_pi
#include "lookup.hh"
if (Note_head::has_interface (n))
{
- Pointer_group_interface::add_element (me, "heads",n);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("heads"), n);
}
else
{
which should be a dot-column.
*/
if (dir * (st + flagy - dp) < 0.5)
- Side_position_interface::add_support (dots->parent_l (X_AXIS), me);
+ Side_position_interface::add_support (dots->get_parent (X_AXIS), me);
/*
previous approach was to lengthen the stem. This is not
Grob *hed = support_head (me);
- Real w = hed->extent (hed, X_AXIS)[dir];
+ Real w = Note_head::head_extent (hed,X_AXIS)[dir];
for (int i=0; i < heads.size (); i++)
{
- heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir], X_AXIS);
+ heads[i]->translate_axis (w - Note_head::head_extent (heads[i],X_AXIS)[dir],
+ X_AXIS);
}
bool parity= true; // todo: make me settable.
Real r=0;
if (Grob * f = first_head (me))
{
- Interval head_wid = f->extent (f,X_AXIS);
+ Interval head_wid = Note_head::head_extent(f, X_AXIS);
Real attach =
Note_head::stem_attachment_coordinate(f, X_AXIS);
don't add as Axis_group_interface::add_element (delim_,),
because that would set the parent as well */
- Pointer_group_interface::add_element (delim_, "elements", inf.grob_l_);
+ Pointer_group_interface::add_element (delim_, ly_symbol2scm ("elements"), inf.grob_l_);
}
else if (System_start_delimiter::has_interface (inf.grob_l_))
{
ugh.
*/
if (Side_position_interface::get_axis (t) == X_AXIS
- && !t->parent_l (Y_AXIS))
+ && !t->get_parent (Y_AXIS))
t->set_parent (inf.grob_l_, Y_AXIS);
else if (Side_position_interface::get_axis (t) == Y_AXIS
- && !t->parent_l (X_AXIS))
+ && !t->get_parent (X_AXIS))
t->set_parent (inf.grob_l_, X_AXIS);
}
}
#define GET_CHAR_DIMEN(d) \
if (d##_index != 0) \
{ \
- input_.seek_ch_C (header_.##d##_pos + d##_index*4); \
+ input_.seek_ch_C (header_. d##_pos + d##_index*4); \
tfm_char.d##_fix_ = input_.get_U32 (); \
tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
* info_.design_size; \
--- /dev/null
+/*
+ spacing-spanner.cc -- implement Spacing_spanner
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+class Third_spacing_spanner
+{
+public:
+ void find_loose_columns () {}
+
+};
dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (s,RIGHT));
}
- Pointer_group_interface::add_element (me, "ties",s);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("ties"), s);
s->add_dependency (me);
}
{
if (Rhythmic_head::has_interface (i.grob_l_))
{
- Note_req * m = dynamic_cast<Note_req* > (i.req_l_);
+ Note_req * m = dynamic_cast<Note_req* > (i.music_cause ());
if (!m)
return;
now_heads_.push (Grob_pitch_tuple (i.grob_l_, m, now_mom () + m->length_mom ()));
{
if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_l_))
{
- Note_req * m = dynamic_cast<Note_req* > (i.req_l_);
+ Note_req * m = dynamic_cast<Note_req *> (i.req_l_);
if (!m)
return;
now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ()));
void
Tuplet_bracket::add_column (Grob*me, Item*n)
{
- Pointer_group_interface::add_element (me, "columns",n);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("columns"), n);
me->add_dependency (n);
add_bound_item (dynamic_cast<Spanner*> (me), n);
int sz = i.origin_trans_l_arr ((Translator*)this).size () ;
return sz > 1 && Axis_group_interface::has_interface (i.grob_l_)
- && !i.grob_l_->parent_l (Y_AXIS) && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS);
+ && !i.grob_l_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS);
}
void
void
Volta_spanner::add_bar (Grob *me, Item* b)
{
- Pointer_group_interface::add_element (me, "bars",b);
+ Pointer_group_interface::add_element (me, ly_symbol2scm ("bars"), b);
Side_position_interface::add_support (me,b);
add_bound_item (dynamic_cast<Spanner*> (me), b);
}
%}
\consists "Dynamic_engraver"
- \consists "Text_engraver"
+ \consists "Fingering_engraver"
+% \consists "Text_engraver"
\consists "Script_engraver"
\consists "Script_column_engraver"
Begin3
Title: LilyPond
-Version: 1.5.23
-Entered-date: 29NOV01
+Version: 1.5.24
+Entered-date: 01DEC01
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.23.tar.gz
+ 1000k lilypond-1.5.24.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.5.23.tar.gz
+ 1000k lilypond-1.5.24.tar.gz
Copying-policy: GPL
End
%define name lilypond
-%define version 1.5.23
+%define version 1.5.24
%define release 1mdk
Name: %{name}
%define info yes
Name: lilypond
-Version: 1.5.23
+Version: 1.5.24
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.23.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.24.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.23
+Version: 1.5.24
Release: 2
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.23.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.24.tar.gz
# music notation software for.. ?
Summary: A program for printing sheet music.
URL: http://www.lilypond.org/
'((":|:" . (":|" . "|:"))
("||:" . ("||" . "|:"))
("|" . ("|" . ""))
+ ("||:" . ("||" . "|:"))
("|s" . (nil . "|"))
("|:" . ("|" . "|:"))
("|." . ("|." . nil))
(define (beam-dir-majority count total)
(dir-compare (car count) (cdr count)))
+(beam-dir-majority '(0 . 0) '(0 . 0))
+
(define (beam-dir-mean count total)
(dir-compare (car total) (cdr total)))
(molecule-callback . ,Text_item::brew_molecule)
(X-offset-callbacks . (,Side_position_interface::centered_on_parent ,Side_position_interface::aligned_on_self))
(padding . 0.6)
- (direction . -1)
+; (direction . -1)
(self-alignment-X . 0)
+ (self-alignment-Y . 0)
(font-family . number)
(font-relative-size . -3)
(font-shape . upright)
(break-align-symbol . Clef_item)
(visibility-lambda . ,begin-of-line-visible)
(font-family . roman)
- (meta . ,(grob-description break-aligned-interface text-interface font-interface))
+ (meta . ,(grob-description break-aligned-interface text-interface font-interface))
+ ))
+
+ (StaffSpacing . (
+ (breakable . #t)
+ (X-extent-callback . #f)
+ (Y-extent-callback . #f)
+
+ (meta . ,(grob-description staff-spacing-interface))
+ ))
+ (NoteSpacing . (
+ (X-extent-callback . #f)
+ (Y-extent-callback . #f)
+
+ (meta . ,(grob-description note-spacing-interface))
))
(StaffSymbol . (
)
)
+(lily-interface
+ 'staff-spacing-interface
+ ""
+ '(
+ ))
+
+(lily-interface
+ 'note-spacing-interface
+ ""
+ '(
+ ))
(lily-interface
'clef-interface
(define (sign x)
(if (= x 0)
- 1
+ 0
(if (< x 0) -1 1)))
(define (write-me n x)
(define (unfold-repeats music)
"
-[Rune Zedeler]
-
-Han-Wen Nienhuys wrote:
-
-> It shouldn't be hard to write a Scheme function to replace all repeats
-> with unfold repeats.
-[...]
-> Left to the reader as an exercise.
-
-With thanks to Han-Wen:
-
-
-"
+This function replaces all repeats with unfold repeats. It was
+written by Rune Zedeler. "
(let* ((es (ly-get-mus-property music 'elements))
(e (ly-get-mus-property music 'element))
(body (ly-get-mus-property music 'body))
music))
+(define (pitchify-scripts music)
+ "Copy the pitch fields of the Note_requests into Text_script_requests, to aid
+Fingering_engraver."
+ (define (find-note musics)
+ (filter-list (lambda (m) (equal? (ly-music-name m) "Note_req")) musics)
+ )
+ (define (find-scripts musics)
+ (filter-list (lambda (m) (equal? (ly-music-name m) "Text_script_req")) musics))
+
+ (let* (
+ (e (ly-get-mus-property music 'element))
+ (es (ly-get-mus-property music 'elements))
+ (notes (find-note es))
+ (pitch (if (pair? notes) (ly-get-mus-property (car notes) 'pitch) #f))
+ )
+
+ (if pitch
+ (map (lambda (x) (ly-set-mus-property x 'pitch pitch)) (find-scripts es))
+ )
+
+ (if (pair? es)
+ (ly-set-mus-property
+ music 'elements
+ (map pitchify-scripts es)))
+
+ (if (music? e)
+ (ly-set-mus-property
+ music 'element
+ (pitchify-scripts e)))
+
+ music))
;; elif symbol == 'char':
;; out.write ('moveto( %f %f); char(%d)' % (x,y,rest))
-
;; (define (dispatch x y expr)
;; (let ((keyword (car expr)))
;; (cond
;; ))
-;; guile < 1.4 compatibility for eval
-(if (or (equal? (minor-version) "4")
- (equal? (minor-version) "3.4"))
- (define (ly-eval e m)
- (eval-in-module e m))
- (define (ly-eval e m)
- (eval e m)))
-(define-module (scm sketch))
-(debug-enable 'backtrace)
+(define-module (scm sketch) )
+; :export (sketch-output-expression)
+; :no-backtrace
(define this-module (current-module))
(display (dispatch expr) port))
(use-modules
- (guile))
+ (guile)
+ (guile-user))
(use-modules (ice-9 format))
built = r"""<hr>
<p><font size="-1">
-This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ by<br>
+This page was built from @PACKAGE_NAME@-@PACKAGE_VERSION@ (@BRANCH@) by<br>
</font>
<address><font size="-1">@GCOS@ <<a href="mailto:@MAILADDRESS@">@MAILADDRESS@</a>>,
@LOCALTIME@.</font></address>"""
else:
s = s + footer
+
#URUGRGOUSNGUOUNRIU
index = index_url
top = top_url
# index = "./index.html"
# top = "./"
+
+ versiontup = string.split(package_version, '.')
+ branch_str = 'stable-branch'
+ if string.atoi ( versiontup[1]) % 2:
+ branch_str = 'development-branch'
+
s = re.sub ('@INDEX@', index, s)
s = re.sub ('@TOP@', top, s)
s = re.sub ('@PACKAGE_NAME@', package_name, s)
s = re.sub ('@GCOS@', gcos, s)
s = re.sub ('@LOCALTIME@', localtime, s)
s = re.sub ('@MAILADDRESS@', mail_address, s)
-
+ s = re.sub ('@BRANCH@', branch_str, s)
+
m = re.match ('.*?<!-- (@[a-zA-Z0-9_-]*@)=(.*?) -->', s, re.DOTALL)
while m:
at_var = m.group (1)