* Added friendly message for the clueless dvips user.
-1.3.95.jcn4
-===========
-
* Clef-engraver: changed c0-position, clef-position and glyph into properties,
enabling ottava spanners: input/test/ottava.ly.
-1.3.95.jcn3
-===========
-
* Added option for edge lines to Text spanner.
* Bugfix for early initialisation of invalid (grace->voice) slur.
-1.3.95.jcn2
-===========
-
* Dropped text support and padding of crescendo symbol. Horizontal
alignment of dynamics is handled by side-support, Text crescendos
use the generic Text spanner.
-1.3.95.jcn1
+* Added a generic Text spanner.
+
+1.3.95.hwn1
===========
-* Added a generic Text spanner.
+* Bugfix: octavate eight.
-1.3.94.uu1
-==========
+* Rewrote arpeggio.
+
+* mudela-book fixes (Tom Cato)
+
+* Cleaned up Group_interface and Pointer_group_interface
+
+* Add accidentals to arpeggio support.
+
+* Stemup + barline combination gets extra space.
+
+* Score_element::extent () now takes a reference point argument.
+
+1.3.95
+======
* Use music property for setting type. This prevents accidental
forgotten copies.
@mudelafile{dyn-line.ly}
+
+Arpeggios are supported, both cross-staff and one-staff.
+
+@mudelafile{arpeggio.ly}
+
+
+
@section Chord names
Chord names are generated from a list pitches, and are customisable
Ignores almost all La@TeX{} commands that changes margins and linewidths.
+La@TeX{} comments can confuse @command{mudela-book}:
+@example
+% this music will be displayed: \mudela@{c d e@}
+@end example
+
@section Authors
@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=95
-MY_PATCH_LEVEL=tca2
+PATCH_LEVEL=96
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
\version "1.3.93";
-rh=\property Thread.noteHeadStyle=##f
-lh=\property Thread.noteHeadStyle = #'diamond
-n=\property Thread.fontSize=#0
-sm=\property Thread.fontSize=#-1
+rh=\property Thread.NoteHead \push #'style = #'default
+lh=\property Thread.NoteHead \push #'style = #'diamond
+
+n = \property Thread.NoteHead \pop #'font-size % = #'diamond %\property Thread.fontSize=#0
+sm=\property Thread.NoteHead \push #'font-size = #-1
+
% su=\property Voice.verticalDirection=#1
% sd=\property Voice.verticalDirection=#-1
su=\property Voice.Stem \push #'direction = #1
sd=\property Voice.Stem \push #'direction = #-1
-zs=\property Voice.forceHorizontalShift=#0.0
+
+%{
ls=\property Voice.forceHorizontalShift=#-0.6
sls=\property Voice.forceHorizontalShift=#-0.22
rs=\property Voice.forceHorizontalShift=#0.6
srs=\property Voice.forceHorizontalShift=#0.22
+%}
+zs = \property Voice.NoteColumn \pop #'force-hshift % #0.0
+ls = \property Voice.NoteColumn \push #'force-hshift = #-0.6
+sls= \property Voice.NoteColumn \push #'force-hshift = #-0.22
+rs = \property Voice.NoteColumn \push #'force-hshift = #0.6
+srs= \property Voice.NoteColumn \push #'force-hshift = #0.22
+
+
+
ab=\property Voice.noAutoBeaming=##f
xb=\property Voice.noAutoBeaming=##t
\score{
\context PianoStaff <
\context Staff=one \notes\relative c''{
- fis,\arpeggio
+ \context Voice < fis,-\arpeggio d a >
%%\property PianoStaff.SpanArpeggio \push #'connect = ##t
\property PianoStaff.connectArpeggios = ##t
<fis,\arpeggio a c>
}
\context Staff=two \notes\relative c{
\clef bass;
- g
+ \context Voice < g b d-\arpeggio >
<g\arpeggio b d>
}
>
= Pointer_group_interface__extract_elements ( me, (Score_element*) 0, "elements");
for (int i=0; i < all_elts.size(); i++)
{
- Interval y = all_elts[i]->extent(a) + all_elts[i]->relative_coordinate (me, a);
+ Interval y = all_elts[i]->extent(me, a);
if (!y.empty_b())
{
Score_element *e =dynamic_cast<Score_element*>(all_elts[i]);
{
stems_.push (info.elem_l_);
}
- else if (Rhythmic_head::has_interface (info.elem_l_)
+
+ else
+
+ /*
+ We can't catch local key items from Voice context, but let's leave
+ it here in case someone moves this stuff around. */
+ if (Rhythmic_head::has_interface (info.elem_l_)
|| Local_key_item::has_interface (info.elem_l_))
{
supports_.push (info.elem_l_);
{
arpeggio_ = new Item (get_property ("Arpeggio"));
arpeggio_->set_parent (stems_[0], Y_AXIS);
- Side_position::set_axis (arpeggio_, X_AXIS);
- Side_position::set_direction (arpeggio_, LEFT);
- Staff_symbol_referencer::set_interface (arpeggio_);
- Pointer_group_interface pgi (arpeggio_, "stems");
+
+ // Staff_symbol_referencer::set_interface (arpeggio_);
+
for (int i = 0; i < stems_.size (); i++)
{
- pgi.add_element (stems_[i]);
+ Pointer_group_interface::add_element (arpeggio_, "stems", stems_[i]);
//Side_position::add_support (arpeggio_, stems_[i]);
}
for (int i = 0; i < supports_.size (); i++)
#include "score-element.hh"
#include "stem.hh"
#include "staff-symbol-referencer.hh"
+#include "staff-symbol.hh"
+#include "warn.hh"
bool
Arpeggio::has_interface (Score_element* me)
{
Score_element *me = unsmob_element (smob);
- Interval iv;
+ Score_element * common = me;
for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
{
- Score_element *stem = unsmob_element (gh_car (s));
- iv.unite (Stem::head_positions (stem));
+ Score_element * stem = unsmob_element (gh_car (s));
+ common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
+ Y_AXIS);
}
+ /*
+ TODO:
+
+ Using stems here is not very convenient; should store noteheads
+ instead, and also put them into the support. Now we will mess up
+ in vicinity of a collision.
+
+ */
+ Interval heads;
+ Real my_y = me->relative_coordinate (common, Y_AXIS);
+
+ for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+ {
+ Score_element * stem = unsmob_element (gh_car (s));
+ Score_element * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+ Interval iv =Stem::head_positions (stem);
+ iv *= Staff_symbol::staff_space (ss)/2.0;
+
+ heads.unite (iv + ss->relative_coordinate (common, Y_AXIS)
+ - my_y);
+ }
+
+ if (heads.empty_b ())
+ {
+ programming_error ("Huh? Dumb blonde encountered?");
+ /*
+ Nee Valerie, jij bent _niet_ dom.
+ */
+ return SCM_EOL;
+ }
+
Molecule mol;
Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- for (int i = (int)iv[MIN]/ 2; i < (int)(iv[MAX] - 1)/ 2; i++)
+
+ Real y = heads[LEFT];
+ while (y < heads[RIGHT])
{
- Molecule a (arpeggio);
- a.translate_axis (i * staff_space, Y_AXIS);
- mol.add_molecule (a);
+ mol.add_at_edge (Y_AXIS, UP,arpeggio, 0.0);
+ y+= arpeggio. extent (Y_AXIS).length ();
}
- // mol.translate (Offset (-2 * staff_space, 0));
+ mol.translate_axis (heads[LEFT], Y_AXIS);
return mol.create_scheme ();
}
+/*
+ We have to do a callback, because brew_molecule () triggers a
+ vertical alignment if it is cross-staff.
+*/
+MAKE_SCHEME_CALLBACK(Arpeggio, width_callback,2);
+SCM
+Arpeggio::width_callback (SCM smob, SCM axis)
+{
+ Score_element * me = unsmob_element (smob);
+ Axis a = (Axis)gh_scm2int (axis);
+ assert (a == X_AXIS);
+ Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
+ return ly_interval2scm (arpeggio.extent (X_AXIS));
+}
e->set_parent (me, a);
}
- Pointer_group_interface (me).add_element (e);
+ Pointer_group_interface::add_element (me, "elements", e);
me->add_dependency (e);
}
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
Score_element * se = unsmob_element (gh_car (s));
- Interval dims = se->extent (a);
+ Interval dims = se->extent (common, a);
if (!dims.empty_b ())
- r.unite (dims + se->relative_coordinate (common, a));
+ r.unite (dims);
}
return r;
}
*/
#include <math.h>
+#include "paper-column.hh"
#include "main.hh"
#include "dimensions.hh"
#include "score-element.hh"
if (! gh_equal_p (g, orig))
me->set_elt_property ("glyph", g);
+
+ /*
+ set a (pseudo) stem-direction, so we extra space is inserted
+ between stemup and barline.
+
+ TODO: should check if the barline is the leftmost object of the
+ break alignment.
+ */
+ if (gh_string_p (g))
+ {
+ Score_element * col = item->column_l ();
+ SCM dirlist = col->get_elt_property ("dir-list");
+ SCM scmdir = gh_int2scm (-1);
+ if (scm_memq (scmdir, dirlist) == SCM_BOOL_F)
+ {
+ dirlist = gh_cons (scmdir, dirlist);
+ col->set_elt_property ("dir-list", dirlist);
+ }
+ }
+
return SCM_UNSPECIFIED;
}
void
Bar::set_interface (Score_element*me)
{
- me->set_elt_property ("interfaces",
- gh_cons (ly_symbol2scm ("bar-interface"), me->get_elt_property ("interfaces")));
+ me->set_interface (ly_symbol2scm ("bar-interface"));
}
bool
void
Beam::add_stem (Score_element*me, Score_element*s)
{
- Pointer_group_interface gi (me, "stems");
- gi.add_element (s);
+ Pointer_group_interface:: add_element(me, "stems", s);
s->add_dependency (me);
Real beamy = (stem->relative_coordinate (0, X_AXIS) - x0) * dydx + beam_y;
Real staff_space = Staff_symbol_referencer::staff_space (rest);
- Real rest_dim = rest->extent (Y_AXIS)[d]*2.0 / staff_space ;
+
+
+ Real rest_dim = rest->extent (rest, Y_AXIS)[d]*2.0 / staff_space ; // refp??
Real minimum_dist
= gh_scm2double (rest->get_elt_property ("minimum-beam-collision-distance"));
for (int i=0; i < all_elems.size(); i++)
{
- Interval y = all_elems[i]->extent(X_AXIS);
+ Interval y = all_elems[i]->extent(all_elems[i], X_AXIS);
if (!y.empty_b())
elems.push (dynamic_cast<Score_element*> (all_elems[i]));
}
Real pre_space = elems[0]->relative_coordinate (column, X_AXIS);
- Real xl = elems[0]->extent (X_AXIS)[LEFT];
+ Real xl = elems[0]->extent (elems[0],X_AXIS)[LEFT];
if (!isinf (xl))
pre_space += xl;
else
programming_error ("Infinity reached. ");
- Real xr = elems.top ()->extent (X_AXIS)[RIGHT];
+ Real xr = elems.top ()->extent (elems.top (), X_AXIS)[RIGHT];
Real spring_len = elems.top ()->relative_coordinate (column, X_AXIS);
if (!isinf (xr))
spring_len += xr;
{
Side_position::add_support (me,rh);
- Pointer_group_interface gi (me, "dots");
- gi.add_element (d);
-
+ Pointer_group_interface ::add_element (me, "dots",d);
d->add_offset_callback (Dot_column::force_shift_callback_proc , Y_AXIS);
Axis_group_interface::add_element (me, d);
}
#include "group-interface.hh"
#include "score-element.hh"
-/*
- ugh: clean me, junk elt_l_ field
- */
-Group_interface::Group_interface (Score_element * e)
-{
- elt_l_ = (Score_element*)e;
- name_ = "elements";
-}
-
-
-Group_interface::Group_interface (Score_element *e, String s)
-{
- elt_l_ =(Score_element*)e;
- name_ = s;
-}
-bool
-Group_interface::has_interface ()
-{
- SCM el = elt_l_->get_elt_property (name_.ch_C());
-
- return el == SCM_EOL || gh_pair_p (el);
-}
-
-
void
-Group_interface::add_thing (SCM s)
+Group_interface::add_thing (Score_element*me, String name, SCM s)
{
- elt_l_->set_elt_property (name_.ch_C (),
- gh_cons (s, elt_l_->get_elt_property (name_.ch_C())));
+ me->set_elt_property (name.ch_C (),
+ gh_cons (s, me->get_elt_property (name.ch_C())));
}
int
-Group_interface::count ()
+Group_interface::count (Score_element *me, String name)
{
- return scm_ilength (elt_l_->get_elt_property (name_.ch_C()));
+ return scm_ilength (me->get_elt_property (name.ch_C()));
}
-
+void
+Pointer_group_interface::add_element (Score_element*me, String name, Score_element*p)
+{
+ Group_interface::add_thing (me, name, p->self_scm());
+}
Hara_kiri_group_spanner::add_interesting_item (Score_element* me,Score_element* n)
{
me->add_dependency (n);
- Pointer_group_interface (me, "items-worth-living").add_element (n);
+ Pointer_group_interface::add_element (me, "items-worth-living",n);
}
do
{
- Real x = sp->get_bound (d)->relative_coordinate (common, X_AXIS);
- Interval ext = sp->get_bound (d)->extent (X_AXIS);
- bounds[d] = (x + ext[-d]);
+ bounds[d] = sp->get_bound (d)->extent (common, X_AXIS)[-d];
}
while (flip (&d) != LEFT);
#include "lily-guile.hh"
#include "lily-proto.hh"
+/*
+ properties:
+ stems -- list of stem objects, corresponding to the notes that the
+ arp has to be before. */
class Arpeggio
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+ DECLARE_SCHEME_CALLBACK(width_callback, (SCM,SCM));
static bool has_interface (Score_element*);
};
struct Group_interface
{
- Score_element * elt_l_;
- String name_;
public:
- Group_interface (Score_element *);
- Group_interface (Score_element *, String);
- int count ();
- void add_thing (SCM);
- bool has_interface ();
-
+ static int count (Score_element* , String);
+ static void add_thing (Score_element*, String nm, SCM);
};
-struct Pointer_group_interface {
- Score_element * elt_l_;
- String name_;
+struct Pointer_group_interface : public Group_interface {
public:
- Pointer_group_interface (Score_element*);
- Pointer_group_interface (Score_element*, String);
- int count ();
-
- static bool has_interface (Score_element*);
- bool has_interface ();
- void add_element (Score_element*);
+ static void add_element (Score_element*, String nm, Score_element*e);
};
/**
Put all score elements of ELT's property called NAME into an array,
for administration of what was done already
*/
enum Score_element_status {
- ORPHAN=0, // not yet added to pstaff
- VIRGIN, // added to pstaff
+ ORPHAN=0, // not yet added to Paper_score
+ VIRGIN,
PRECALCING,
PRECALCED, // calcs before spacing done
POSTCALCING, // busy calculating. This is used to trap cyclic deps.
public:
bool empty_b (Axis a) const;
- Interval extent (Axis) const;
+
+ Interval extent (Score_element * refpoint, Axis) const;
/**
translate in one direction
#include "lily-guile.hh"
#include "lily-proto.hh"
+
/*
properties :
dir-list -- list of stem directions.
*/
-
struct Spaceable_element
{
/// set a minimum distance
-/*
- span-arpegio.hh -- declare Span_arpeggio
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef SPAN_ARPEGGIO_HH
-#define SPAN_ARPEGGIO_HH
-
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-#include "interval.hh"
-
-class Span_arpeggio
-{
-public:
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static bool has_interface (Score_element*);
-};
-
-#endif /* SPAN_ARPEGGIO_HH */
-
static int
print_smob (SCM s, SCM port, scm_print_state *)
{
- String str = "#<location" + unsmob_input (s)->location_str () + ">";
+ String str = "#<location " + unsmob_input (s)->location_str () + ">";
scm_puts (str.ch_C(), port);
return 1;
}
Line_of_score::typeset_element (Score_element * elem_p)
{
elem_p->pscore_l_ = pscore_l_;
- Pointer_group_interface (this, "all-elements").add_element (elem_p);
+ Pointer_group_interface::add_element (this, "all-elements",elem_p);
scm_unprotect_object (elem_p->self_scm ());
}
ly_symbol2scm ("after-line-breaking-callback"));
}
- Interval i(extent(Y_AXIS));
+ Interval i(extent(this, Y_AXIS));
if (i.empty_b())
programming_error ("Huh? Empty Line_of_score?");
else
#include "staff-symbol-referencer.hh"
#include "side-position-interface.hh"
#include "engraver.hh"
-
+#include "arpeggio.hh"
/**
Make accidentals. Catches note heads, ties and notices key-change
// todo -> property
SCM last_keysig_;
+
+ /*
+ Urgh. Since the accidentals depend on lots of variables, we have to
+ store all information before we can really create the accidentals.
+ */
+ Link_array<Score_element> arpeggios_;
Link_array<Note_req> mel_l_arr_;
Link_array<Score_element> support_l_arr_;
{
key_item_p_ = new Item(get_property ("Accidentals"));
Local_key_item::set_interface (key_item_p_);
- Side_position::set_axis (key_item_p_, X_AXIS);
- Side_position::set_direction (key_item_p_, LEFT);
+
+
Staff_symbol_referencer::set_interface (key_item_p_);
announce_element (key_item_p_, 0);
Side_position::add_support (grace_align_l_,key_item_p_);
grace_align_l_ =0;
}
-
+
+ if (key_item_p_)
+ {
+ /*
+ Hmm. Which one has to be on the left?
+ */
+ for (int i=0; i < arpeggios_.size (); i++)
+ Side_position::add_support (arpeggios_[i], key_item_p_);
+
+ arpeggios_.clear ();
+ }
}
void
grace_align_l_ = 0;
mel_l_arr_.clear();
+ arpeggios_.clear ();
tied_l_arr_.clear();
support_l_arr_.clear();
forced_l_arr_.clear();
{
tied_l_arr_.push (Tie::head (info.elem_l_, RIGHT));
}
+ else if (Arpeggio::has_interface (info.elem_l_))
+ {
+ arpeggios_.push (info.elem_l_);
+ }
+
}
/*
Lyric_extender::brew_molecule (SCM smob)
{
Spanner *sp = dynamic_cast<Spanner*> (unsmob_element (smob));
-
- Real leftext = sp->get_bound (LEFT)->extent (X_AXIS).length ();
+
+ // ugh: refp
+ Real leftext = sp->get_bound (LEFT)->extent (sp->get_bound (LEFT),
+ X_AXIS).length ();
Real ss = sp->paper_l ()->get_var ("staffspace");
Real sl = sp->paper_l ()->get_var ("stafflinethickness");
Real righttrim = 0.5; // default to half a staffspace gap on the right
{
Item * col = sp->get_bound (d)->column_l ();
- Interval coldim = col->extent (X_AXIS)
- + col->relative_coordinate (0, X_AXIS);
+ Interval coldim = col->extent (0, X_AXIS);
sp_iv[d] = coldim[-d] ;
}
void
Multi_measure_rest::add_column (Score_element*me,Item* c)
{
- Pointer_group_interface gi (me, "columns");
- gi.add_element (c);
+ Pointer_group_interface::add_element (me, "columns",c);
add_bound_item (dynamic_cast<Spanner*> (me),c);
}
/*
should do something more advanced.
*/
- rod.distance_f_ = l->extent (X_AXIS)[BIGGER] - r->extent (X_AXIS)[SMALLER]
+ rod.distance_f_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
+ gh_scm2double (me->get_elt_property ("minimum-width")) * staff_space;
rod.add_to_cols ();
}
else if (Note_head::has_interface (h))
{
- Pointer_group_interface gi (me, "note-heads");
- gi.add_element (h);
+ Pointer_group_interface::add_element (me, "note-heads",h);
}
Axis_group_interface::add_element (me, h);
}
Note_column::rest_dim (Score_element*me)
{
Score_element * r = unsmob_element (me->get_elt_property ("rest"));
- return r->extent (Y_AXIS);
+ return r->extent (r, Y_AXIS); // ??
}
Score_element*
#include "group-interface.hh"
#include "score-element.hh"
-/*
- UGH clean me .
- */
-Pointer_group_interface::Pointer_group_interface (Score_element * e)
-{
- elt_l_ = e;
- name_ = "elements";
-}
-
-
-Pointer_group_interface::Pointer_group_interface (Score_element *e, String s)
-{
- elt_l_ =(Score_element*)e;
- name_ = s;
-}
-
-/*
- duh.
- */
-bool
-Pointer_group_interface::has_interface ()
-{
- SCM el = elt_l_->get_elt_property (name_.ch_C());
-
- return el == SCM_EOL || gh_pair_p (el);
-}
-
-void
-Pointer_group_interface::add_element (Score_element*p)
-{
- elt_l_->set_elt_property (name_.ch_C(),
- gh_cons (p->self_scm (),
- elt_l_->get_elt_property (name_.ch_C())));
-}
-int
-Pointer_group_interface::count ()
-{
- return scm_ilength (elt_l_->get_elt_property (name_.ch_C()));
-}
Rest_collision::add_column (Score_element*me,Score_element *p)
{
me->add_dependency (p);
- Pointer_group_interface gi (me);
- gi.add_element (p);
+ Pointer_group_interface::add_element (me, "elements", p);
p->add_offset_callback (Rest_collision::force_shift_callback_proc, Y_AXIS);
p->set_elt_property ("rest-collision", me->self_scm ());
Interval notedim;
for (int i = 0; i < notes.size(); i++)
{
- notedim.unite (notes[i]->extent (Y_AXIS));
+ notedim.unite (notes[i]->extent (notes[i],Y_AXIS)); // refp?
}
Interval inter (notedim);
/*
fixme: default should be no callback.
*/
- set_extent_callback (molecule_extent_proc, X_AXIS);
- set_extent_callback (molecule_extent_proc, Y_AXIS) ;
pscore_l_=0;
lookup_l_ =0;
smobify_self ();
- dim_cache_[X_AXIS].offset_callbacks_
- = get_elt_property ("X-offset-callbacks");
- dim_cache_[Y_AXIS].offset_callbacks_
- = get_elt_property ("Y-offset-callbacks");
-
- dim_cache_[X_AXIS].offsets_left_ = scm_ilength (dim_cache_[X_AXIS].offset_callbacks_);
- dim_cache_[Y_AXIS].offsets_left_ = scm_ilength (dim_cache_[Y_AXIS].offset_callbacks_);
-
- SCM cb = get_elt_property ("X-extent-callback");
- if (cb != SCM_EOL)
- dim_cache_[X_AXIS].dimension_ = cb;
-
- cb = get_elt_property ("Y-extent-callback");
- if (cb != SCM_EOL)
- dim_cache_[Y_AXIS].dimension_ = cb;
+ char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
+ char const*enames[] = {"X-extent-callback", "Y-extent-callback"};
+
+ for (int a = X_AXIS; a <= Y_AXIS; a++){
+ SCM l = get_elt_property (onames[a]);
+
+ if (scm_ilength (l) >=0)
+ {
+ dim_cache_[a].offset_callbacks_ = l;
+ dim_cache_[a].offsets_left_ = scm_ilength (l);
+ }
+ else
+ {
+ programming_error ("[XY]-offset-callbacks must be a list");
+ }
+
+ SCM cb = get_elt_property (enames[a]);
+
+ /*
+ Should change default to be empty?
+ */
+ if (!gh_procedure_p (cb) && !gh_pair_p (cb))
+ cb = molecule_extent_proc;
+
+ dim_cache_[a].dimension_ = cb;
+ }
}
{
if (e)
{
- Pointer_group_interface gi (this, "dependencies");
- gi.add_element (e);
+ Pointer_group_interface ::add_element (this, "dependencies",e);
+
}
else
programming_error ("Null dependency added");
gh_procedure_p (dim_cache_[a].dimension_ ));
}
+/*
+ TODO: add
+
+ Score_element *refpoint
+
+ to arguments?
+ */
Interval
-Score_element::extent (Axis a) const
+Score_element::extent (Score_element * refp, Axis a) const
{
+ Real x = relative_coordinate (refp, a);
+
+
Dimension_cache * d = (Dimension_cache *)&dim_cache_[a];
Interval ext ;
if (gh_pair_p (d->dimension_))
ext.unite (Interval (s * gh_scm2double (gh_car (extra)),
s * gh_scm2double (gh_cdr (extra))));
}
+
+ ext.translate (x);
return ext;
}
if (!gh_number_p (p))
return;
- Pointer_group_interface gi (me, "scripts");
- gi.add_element (i);
+ Pointer_group_interface::add_element (me, "scripts",i);
me->add_dependency (i);
}
void
Separating_group_spanner::add_spacing_unit (Score_element* me ,Item*i)
{
- Pointer_group_interface (me, "elements").add_element (i);
+ Pointer_group_interface::add_element (me, "elements",i);
me->add_dependency (i);
}
Separation_item::add_item (Score_element*s,Item* i)
{
assert (i);
- Pointer_group_interface (s).add_element (i);
+ Pointer_group_interface::add_element (s,"elements",i);
s->add_dependency (i);
}
continue;
}
- Interval iv (il->extent (X_AXIS));
+ Interval iv (il->extent (pc, X_AXIS));
if (!iv.empty_b ())
{
- Real off = il->relative_coordinate (pc, X_AXIS);
- w.unite (iv + off);
+ w.unite (iv);
}
}
void
Side_position::add_support (Score_element*me, Score_element*e)
{
- Pointer_group_interface (me, "side-support-elements").add_element (e);
+ Pointer_group_interface::add_element (me, "side-support-elements",e);
}
Score_element * e = unsmob_element ( gh_car (s));
if (e)
{
- Real coord = e->relative_coordinate (common, a);
-
- dim.unite (coord + e->extent (a));
+ dim.unite (e->extent (common, a));
}
}
SCM align (me->get_elt_property (s.ch_C()));
if (gh_number_p (align))
{
- Interval ext(me->extent (a));
+ Interval ext(me->extent (me,a));
if (ext.empty_b ())
{
Direction d = Side_position::get_direction (me);
Real o = gh_scm2double (side_position (element_smob,axis));
- Interval iv = me->extent (a);
+ Interval iv = me->extent (me, a);
if (!iv.empty_b ())
{
Axis a = (Axis) gh_scm2int (axis);
Score_element *him = me->parent_l (a);
- return gh_double2scm (him->extent (a).center ());
+ return gh_double2scm (him->extent (him,a).center ());
}
warning (_ ("Putting slur over rest. Ignoring."));
else
{
- Pointer_group_interface (me, "note-columns").add_element (n);
+ Pointer_group_interface::add_element (me, "note-columns",n);
me->add_dependency (n);
}
/*
Default position is centered in X, on outer side of head Y
*/
- o += Offset (0.5 * n->extent (X_AXIS).length (),
+ o += Offset (0.5 * n->extent (n,X_AXIS).length (),
0.5 * ss * Directional_element_interface::get (me));
}
else if (str == "alongside-stem")
/*
Default position is on stem X, on outer side of head Y
*/
- o += Offset (n->extent (X_AXIS).length ()
+ o += Offset (n->extent (n,X_AXIS).length ()
* (1 + Stem::get_direction (stem)),
0.5 * ss * Directional_element_interface::get (me));
}
Default position is on stem X, at stem end Y
*/
o += Offset (0.5 *
- (n->extent (X_AXIS).length ()
- - stem->extent (X_AXIS).length ())
+ (n->extent (n,X_AXIS).length ()
+ - stem->extent (stem,X_AXIS).length ())
* (1 + Stem::get_direction (stem)),
0);
}
Simply set x to middle of notehead
*/
- o[X_AXIS] -= 0.5 * stem_dir * col->extent (X_AXIS).length ();
+ o[X_AXIS] -= 0.5 * stem_dir * col->extent (col,X_AXIS).length ();
if ((stem_dir == dir)
- && !stem_l->extent (Y_AXIS).empty_b ())
+ && !stem_l->extent (stem_l, Y_AXIS).empty_b ())
{
- o[Y_AXIS] = stem_l->relative_coordinate (common[Y_AXIS], Y_AXIS); // iuhg
- o[Y_AXIS] += stem_l->extent (Y_AXIS)[dir];
+ o[Y_AXIS] = stem_l->extent (common[Y_AXIS], Y_AXIS)[dir];
}
else
{
- o[Y_AXIS] = col->relative_coordinate (common[Y_AXIS], Y_AXIS); // ugh
- o[Y_AXIS] += col->extent (Y_AXIS)[dir];
+ o[Y_AXIS] = col->extent (common[Y_AXIS], Y_AXIS)[dir];
}
/*
}
else
{
- Interval ext (rc->extent (X_AXIS));
+ Interval ext (rc->extent (rc, X_AXIS));
right_dist = ext.empty_b() ? 0.0 : - ext [LEFT];
}
Spacing_spanner::default_bar_spacing (Score_element*me, Score_element *lc, Score_element *rc,
Moment shortest)
{
- Real symbol_distance = lc->extent (X_AXIS)[RIGHT] ;
+ Real symbol_distance = lc->extent (lc,X_AXIS)[RIGHT] ;
Real durational_distance = 0;
Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc);
/**
-
Make arpeggios that span multiple staffs. Catch arpeggios, and span a
Span_arpeggio over them if we find more than two arpeggios.
*/
void
Span_arpeggio_engraver::process_acknowledged ()
{
+ /*
+ connectArpeggios is slightly brusque; we should really read a elt
+ property of the caught non-span arpeggios. That way, we can have
+
+ both non-connected and connected arps in one pianostaff.
+
+
+ */
if (!span_arpeggio_ && arpeggios_.size () > 1
&& to_boolean (get_property ("connectArpeggios")))
{
- span_arpeggio_ = new Item (get_property ("SpanArpeggio"));
- span_arpeggio_->set_parent (arpeggios_[0], Y_AXIS);
- Side_position::set_axis (span_arpeggio_, X_AXIS);
- Side_position::set_direction (span_arpeggio_, LEFT);
- Staff_symbol_referencer::set_interface (span_arpeggio_);
- Pointer_group_interface pgi (span_arpeggio_, "arpeggios");
- for (int i = 0; i < arpeggios_.size () ; i++)
- {
- pgi.add_element (arpeggios_[i]);
- span_arpeggio_->add_dependency (arpeggios_[i]);
- }
-
- announce_element (span_arpeggio_, 0);
+ span_arpeggio_ = new Item (get_property ("Arpeggio"));
+ announce_element (span_arpeggio_, 0);
}
}
{
if (span_arpeggio_)
{
+ /*
+ we do this very late, to make sure we also catch `extra'
+ side-pos support like accidentals.
+ */
+ for (int i=0; i < arpeggios_.size (); i ++)
+ {
+ for (SCM s = arpeggios_[i]->get_elt_property ("stems");
+ gh_pair_p (s); s = gh_cdr (s))
+ Group_interface::add_thing (span_arpeggio_, "stems", gh_car (s));
+ for (SCM s = arpeggios_[i]->get_elt_property ("side-support-elements");
+ gh_pair_p (s); s = gh_cdr (s))
+ Group_interface::add_thing (span_arpeggio_, "side-support-elements", gh_car (s));
+
+ /*
+ we can't kill the children, since we don't want to the
+ previous note to bump into the span arpeggio; so we make
+ it transparent. */
+ arpeggios_[i]->set_elt_property ("molecule-callback", SCM_BOOL_T);
+ }
+
typeset_element (span_arpeggio_);
span_arpeggio_ = 0;
}
-/*
- span-arpeggio.cc -- implement Span_arpeggio
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include <math.h>
-
-#include "axis-group-interface.hh"
-#include "molecule.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "arpeggio.hh"
-#include "span-arpeggio.hh"
-#include "score-element.hh"
-#include "stem.hh"
-#include "staff-symbol-referencer.hh"
-
-bool
-Span_arpeggio::has_interface (Score_element* me)
-{
- return me && me->has_interface (ly_symbol2scm ("span-arpeggio-interface"));
-}
-
-/*
- We could collapse this with Arpeggio::brew_molecule, but that requires
- hairy scm callback hacking.
- */
-MAKE_SCHEME_CALLBACK (Span_arpeggio, brew_molecule, 1);
-SCM
-Span_arpeggio::brew_molecule (SCM smob)
-{
- Score_element *me = unsmob_element (smob);
-
- Interval iv;
- Score_element *common = me;
- for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
- {
- Score_element *arpeggio = unsmob_element (gh_car (s));
- common = common->common_refpoint (arpeggio, Y_AXIS);
- }
- for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
- {
- Score_element *arpeggio = unsmob_element (gh_car (s));
- Real c = arpeggio->relative_coordinate (common, Y_AXIS);
- Interval height = arpeggio->extent (Y_AXIS);
- iv.unite (height + c);
- }
- iv *= 0.5;
-
- Molecule mol;
- Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- for (int i = (int)iv[MIN]/ 2; i < (int)(iv[MAX] - 1)/ 2; i++)
- {
- Molecule a (arpeggio);
- a.translate_axis (i * staff_space, Y_AXIS);
- mol.add_molecule (a);
- }
- /*
- urg?
- */
- Real dy = -(int)me->relative_coordinate (common, Y_AXIS);
- dy += iv.length () / 2;
- dy /= staff_space;
- dy = staff_space * rint (dy);
- mol.translate (Offset (0, dy));
-
- return mol.create_scheme ();
-}
-
void
Span_bar::add_bar (Score_element*me, Score_element*b)
{
- Pointer_group_interface gi (me);
- gi.add_element (b);
+ Pointer_group_interface::add_element (me,"elements", b);
me->add_dependency (b);
}
*/
if (dynamic_cast<Paper_column*> (i))
{
- Pointer_group_interface (i, "bounded-by-me").add_element (this);
+ Pointer_group_interface::add_element (i, "bounded-by-me",this);
}
}
But that doesn't make a difference, since the Paper_column
is likely to contain only a Break_align_item.
*/
- return sc->extent (X_AXIS)[RIGHT];
+ return sc->extent (sc, X_AXIS)[RIGHT];
}
return 0.0;
*/
Real whole_note_correction;
if (Stem::invisible_b (stem ))
- whole_note_correction = -Stem::get_direction (stem )
- * Stem::support_head (stem )->extent (X_AXIS).length () / 2;
+ {
+ Score_element *hed = Stem::support_head (stem );
+ whole_note_correction = -Stem::get_direction (stem )
+ *hed->extent (hed, X_AXIS).length () / 2;
+ }
else
whole_note_correction = 0;
int
Stem::heads_i (Score_element*me)
{
- Pointer_group_interface gi (me, "heads");
- return gi.count ();
+ return Pointer_group_interface::count (me, "heads");
}
/*
if (Note_head::has_interface (n))
{
- Pointer_group_interface (me, "heads").add_element (n);
+ Pointer_group_interface::add_element (me, "heads",n);
}
else
{
heads.reverse ();
- Real w = support_head (me)->extent (X_AXIS)[dir];
+ Score_element *hed = support_head (me);
+ Real w = hed->extent (hed, X_AXIS)[dir];
for (int i=0; i < heads.size (); i++)
{
- heads[i]->translate_axis (w - heads[i]->extent (X_AXIS)[dir], X_AXIS);
+ heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir], X_AXIS);
}
bool parity= true; // todo: make me settable.
{
if (parity)
{
- Real l = heads[i]->extent (X_AXIS).length ();
+ Real l = heads[i]->extent (heads[i], X_AXIS).length ();
heads[i]->translate_axis (l * get_direction (me), X_AXIS);
}
parity = !parity;
Item* item = dynamic_cast<Item*> (me);
Item * col = item->column_l ();
SCM dirlist =col->get_elt_property ("dir-list");
- if (dirlist == SCM_UNDEFINED)
- dirlist = SCM_EOL;
-
- if (scm_sloppy_memq (scmdir, dirlist) == SCM_EOL)
+ if (scm_sloppy_memq (scmdir, dirlist) == SCM_BOOL_F)
{
dirlist = gh_cons (scmdir, dirlist);
col->set_elt_property ("dir-list", dirlist);
Real dy = Staff_symbol_referencer::staff_space (me)/2.0;
Real head_wid = 0;
- if (support_head (me))
- head_wid = support_head (me)->extent (X_AXIS).length ();
+
+ if (Score_element *hed = support_head (me))
+ head_wid = hed->extent (hed,X_AXIS).length ();
stem_y[Direction(-d)] += d * head_wid * tan(ANGLE)/(2*dy);
if (!invisible_b (me))
MAKE_SCHEME_CALLBACK(Stem,off_callback,2);
SCM
-Stem::off_callback (SCM element_smob, SCM axis)
+Stem::off_callback (SCM element_smob, SCM )
{
Score_element *me = unsmob_element (element_smob);
-
+
Real r=0;
if (Score_element * f = first_head (me))
{
- Interval head_wid(0, f->extent (X_AXIS).length ());
+ Interval head_wid(0, f->extent (f,X_AXIS).length ());
if (to_boolean (me->get_elt_property ("stem-centered")))
return gh_double2scm ( head_wid.center ());
lyric_list_.push(lyric);
/* record longest and shortest lyrics */
if( longest_lyric_l_ ) {
- if(lyric->extent(X_AXIS).length() > (longest_lyric_l_->extent(X_AXIS)).length())
+ if(lyric->extent(lyric,X_AXIS).length() > (longest_lyric_l_->extent(longest_lyric_l_, X_AXIS)).length())
longest_lyric_l_ = lyric;
- if(lyric->extent(X_AXIS).length() < (shortest_lyric_l_->extent(X_AXIS)).length())
+ if(lyric->extent(lyric, X_AXIS).length() < (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length())
shortest_lyric_l_ = lyric;
}
else
// Right:
Real ss = extender->paper_l ()->get_var ("staffspace");
extender->set_elt_property("right-trim-amount",
- gh_double2scm(-notehead_l_->extent(X_AXIS).length()/ss));
+ gh_double2scm(-notehead_l_->extent(notehead_l_, X_AXIS).length()/ss));
}
}
lyric->set_parent(notehead_l_, X_AXIS);
lyric->add_offset_callback (Side_position::centered_on_parent_proc, X_AXIS);
// reference is on the right of the notehead; move it left half way, and add translation
- lyric->translate_axis (group_translation_f_-(notehead_l_->extent(X_AXIS)).center(), X_AXIS);
+ lyric->translate_axis (group_translation_f_-(notehead_l_->extent(notehead_l_, X_AXIS)).center(), X_AXIS);
}
}
return (notehead_l_);
Real translate = 0.0;
if(alignment_i_ != CENTER) {
// FIXME: do we really know the lyric extent here? Some font sizing comes later?
- if((longest_lyric_l_->extent(X_AXIS)).length() <
- (shortest_lyric_l_->extent(X_AXIS)).length() * 2 )
- translate = alignment_i_*(longest_lyric_l_->extent(X_AXIS)).length()/2;
- else
- translate = alignment_i_*(shortest_lyric_l_->extent(X_AXIS)).length();
+ Real l1 = longest_lyric_l_->extent(longest_lyric_l_, X_AXIS).length() / 2;
+ Real l2 = shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS).length();
+
+ translate = l1 <? l2;
+ translate *= alignment_i_ ;
}
return translate;
}
switch (alignment_i_) {
// case LEFT: // that's all
case CENTER: // move right so smallest lyric is left-aligned on notehead
- translation += (shortest_lyric_l_->extent(X_AXIS)).length()/2;
+ translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length()/2;
break;
case RIGHT: // move right so smallest lyric is left-aligned on notehead
- translation += (shortest_lyric_l_->extent(X_AXIS)).length();
+ translation += (shortest_lyric_l_->extent(shortest_lyric_l_, X_AXIS)).length();
break;
}
group_translation_f_ += translation;
don't add as Axis_group_interface::add_element (delim_, ),
because that would set the parent as well */
- Pointer_group_interface (delim_).add_element (inf.elem_l_);
+ Pointer_group_interface::add_element (delim_, "elements", inf.elem_l_);
}
else if (System_start_delimiter::has_interface (inf.elem_l_))
{
Real broken_left = spanner->get_broken_left_end_align ();
Real width = spanner->spanner_length ();
- width += spanner->get_bound (RIGHT)->extent (X_AXIS).length ();
+ Score_element *bnd = spanner->get_bound (RIGHT);
+ width += bnd->extent (bnd, X_AXIS).length ();
width -= broken_left;
width -= shorten[LEFT] + shorten[RIGHT];
width -= edge[LEFT].extent (X_AXIS).length ()
void
Tie_column::add_tie (Score_element*me,Score_element *s)
{
- Pointer_group_interface g (me, "ties");
- if (!g.count ())
+
+ if (! Pointer_group_interface ::count (me, "ties"))
{
dynamic_cast<Spanner*> (me)->set_bound (LEFT, Tie::head (s,LEFT));
dynamic_cast<Spanner*> (me)->set_bound (RIGHT, Tie::head (s,RIGHT));
}
- Pointer_group_interface (me, "ties").add_element (s);
+ Pointer_group_interface::add_element (me, "ties",s);
s->add_dependency (me);
}
Real left_x;
if (Note_head::has_interface (me->get_bound (LEFT)))
- left_x = l->extent (X_AXIS)[RIGHT] + x_gap_f;
+ left_x = l->extent (l, X_AXIS)[RIGHT] + x_gap_f;
else
- left_x = l->extent (X_AXIS).length () / 2;
+ left_x = l->extent (l, X_AXIS).length () / 2;
Real width;
if (Note_head::has_interface (me->get_bound (LEFT))
&& Note_head::has_interface (me->get_bound (RIGHT)))
{
- width = r->relative_coordinate (commonx, X_AXIS)
- + r->extent (X_AXIS)[LEFT]
- - l->relative_coordinate (commonx, X_AXIS)
- - l->extent (X_AXIS)[RIGHT]
+ width =
+ + r->extent (commonx,X_AXIS)[LEFT]
+ - l->extent (commonx, X_AXIS)[RIGHT]
-2 * x_gap_f;
}
else
{
if (Note_head::has_interface (me->get_bound (LEFT)))
width = r->relative_coordinate (commonx, X_AXIS)
- - l->relative_coordinate (commonx, X_AXIS)
- - l->extent (X_AXIS)[RIGHT]
+ - l->extent (commonx, X_AXIS)[RIGHT]
- 2 * x_gap_f;
else
- width = r->relative_coordinate (commonx, X_AXIS)
- - l->extent (X_AXIS).length () / 2
- + r->extent (X_AXIS)[LEFT]
+ width =
+ - l->extent (l, X_AXIS).length () / 2
+ + r->extent (commonx, X_AXIS)[LEFT]
- l->relative_coordinate (commonx, X_AXIS)
- 2 * x_gap_f;
}
Offset leave_dir = b.control_[1] - b.control_[0];
- Real dx = (head (me, headdir)->extent (X_AXIS).length () + x_gap_f)/2.0;
+ Score_element *hed =head (me, headdir);
+ Real dx = (hed->extent (hed, X_AXIS).length () + x_gap_f)/2.0;
Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
/*
Link_array<Score_element> column_arr=
Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
- Real ncw = column_arr.top ()->extent(X_AXIS).length ();
+ Real ncw = column_arr.top ()->extent(column_arr.top (), X_AXIS).length ();
Real w = dynamic_cast<Spanner*>(me)->spanner_length () + ncw;
Real staff_space = me->paper_l ()->get_var ("staffspace");
if (l < r)
{
- *dy = column_arr[r]->extent (Y_AXIS) [d] + column_arr[r]->relative_coordinate (commony, Y_AXIS)
- - column_arr[l]->extent (Y_AXIS) [d] - column_arr[l]->relative_coordinate (commony, Y_AXIS);
+ *dy = column_arr[r]->extent (commony, Y_AXIS) [d]
+ - column_arr[l]->extent (commony, Y_AXIS) [d] ;
}
else
* dy = 0;
for (int i = 0; i < column_arr.size (); i++)
{
- Real notey = column_arr[i]->extent (Y_AXIS)[d]
- + column_arr[i]->relative_coordinate (commony, Y_AXIS)
+ Real notey = column_arr[i]->extent (commony, Y_AXIS)[d]
- me->relative_coordinate (commony, Y_AXIS);
Real x = column_arr[i]->relative_coordinate (commonx, X_AXIS) - x0;
{
Link_array<Score_element> column_arr=
Pointer_group_interface__extract_elements (me, (Score_element*)0, "columns");
-
+
+ /*
+ ugh. refps.
+ */
Direction d = Directional_element_interface::get (me);
- *dy = column_arr.top ()->extent (Y_AXIS) [d]
- - column_arr[0]->extent (Y_AXIS) [d];
+ *dy = column_arr.top ()->extent (column_arr.top (), Y_AXIS) [d]
+ - column_arr[0]->extent (column_arr[0], Y_AXIS) [d];
}
MAKE_SCHEME_CALLBACK(Tuplet_spanner,after_line_breaking,1);
Tuplet_spanner::add_beam (Score_element*me, Score_element *b)
{
me->add_dependency (b);
- Pointer_group_interface gi (me, "beams");
- gi.add_element (b);
+ Pointer_group_interface::add_element (me, "beams",b);
}
void
Tuplet_spanner::add_column (Score_element*me, Item*n)
{
- Pointer_group_interface gi (me, "columns");
- gi.add_element (n);
+ Pointer_group_interface::add_element (me, "columns",n);
me->add_dependency (n);
add_bound_item (dynamic_cast<Spanner*> (me), n);
void
Volta_spanner::add_bar (Score_element *me, Item* b)
{
- Pointer_group_interface gi(me, "bars");
- gi.add_element (b);
-
+ Pointer_group_interface::add_element(me, "bars",b);
Side_position::add_support (me,b);
add_bound_item (dynamic_cast<Spanner*>(me), b);
}
\consists "Rest_collision_engraver";
\consists "Local_key_engraver";
\consists "Piano_pedal_engraver";
- \consists "Arpeggio_engraver";
\consistsend "Axis_group_engraver";
Generic_property_list = #generic-voice-properties
\consists "Output_property_engraver";
+ \consists "Arpeggio_engraver";
\consists "Dynamic_engraver"; % must come before text_engraver.
\consists "Text_spanner_engraver";
% staffspace (distances)
%
Arpeggio = #`(
- (interfaces . (arpeggio-interface))
+ (interfaces . (arpeggio-interface side-position-interface))
+ (X-extent-callback . ,Arpeggio::width_callback)
(molecule-callback . ,Arpeggio::brew_molecule)
- (name . "arpeggio")
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
+ (staff-position . 0.0)
+ (name . "Arpeggio")
)
BarLine = #`(
(interfaces . (bar-interface staff-bar-interface))
Accidentals = #`(
(molecule-callback . ,Local_key_item::brew_molecule)
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
(left-padding . 0.2)
(right-padding . 0.4)
(interfaces . (accidentals-interface))
(self-alignment-X . 0)
(text . "8")
(visibility-lambda . ,begin-of-line-visible)
- (X-offset-callbacks .
- (,Side_position::centered_on_parent
- ,Side_position::aligned_on_self
- ,Side_position::aligned_side
- ))
+ (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self))
+ (Y-offset-callbacks . (,Side_position::aligned_side))
(molecule-callback . ,Text_item::brew_molecule)
(style . "italic")
(name . "OctavateEight")
(maximum-duration-for-spacing . ,(make-moment 1 8))
(name . "SpacingSpanner")
)
- SpanArpeggio = #`(
- (interfaces . (span-arpeggio-interface))
- (molecule-callback . ,Span_arpeggio::brew_molecule)
- (name . "SpanArpeggio")
- )
SpanBar = #`(
(interfaces . (bar-interface span-bar-interface))
(break-align-symbol . Staff_bar)
Begin3
Title: LilyPond
-Version: 1.3.95
-Entered-date: 11OCT00
+Version: 1.3.96
+Entered-date: 13OKT00
Description:
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.3.95.tar.gz
+ 1000k lilypond-1.3.96.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.95.tar.gz
+ 1000k lilypond-1.3.96.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.3.95
+Version: 1.3.96
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.95.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.96.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
#!@PYTHON@
# vim: set noexpandtab:
# TODO:
-# * Figure out clean set of options. Hmm, isn't it pretty ok now?
+# * Figure out clean set of options.
# * add support for .lilyrc
+# * %\def\preMudelaExample should be ignored by mudela-book because
+# it is commented out
+# * if you run mudela-book once with --no-pictures, and then again
+# without the option, then the pngs will not be created. You have
+# to delete the generated .ly files and rerun mudela-book.
+# * kontroller hvordan det skannes etter preMudelaExample i preamble
+# det ser ut til at \usepackage{graphics} legges til bare hvis
+# preMudelaExample ikke finnes.
+# * add suppoert for @c comments. Check that preamble scanning works after this.
+
+# * in LaTeX, commenting out blocks like this
+# %\begin{mudela}
+# %c d e
+# %\end{mudela} works as expected.
+# * \usepackage{landscape} is gone. Convince me it is really neede to get it back.
+# * We are calculating more of the linewidths, for example 2 col from 1 col.
+
# This is was the idea for handling of comments:
}
}
-def output_verbatim (body):
+def output_verbatim (body):#ugh .format
if __main__.format == 'texi':
body = re.sub ('([@{}])', '@\\1', body)
return get_output ('output-verbatim') % body
+def output_mbverbatim (body):#ugh .format
+ if __main__.format == 'texi':
+ body = re.sub ('([@{}])', '@\\1', body)
+ return get_output ('output-verbatim') % body
re_dict = {
'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
'landscape': no_match,
'verbatim': r"""(?s)(?P<code>@example\s.*?@end example\s)""",
'verb': r"""(?P<code>@code{.*?})""",
- 'mudela-file': '(?m)^(?!@c)(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
+ 'mudela-file': '(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
'mudela' : '(?m)^(?!@c)(?P<match>@mudela(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
+ #ugh add check for @c
'mudela-block': r"""(?m)^(?!@c)(?P<match>(?s)(?P<match>@mudela(\[(?P<options>.*?)\])?\s(?P<code>.*?)@end mudela\s))""",
'option-sep' : ', *',
'intertext': r',?\s*intertext=\".*?\"',
+ #ugh fix
'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
'numcols': no_match,
paperguru.set_geo_option(k, o[k])
idx = idx + 1
-def scan_texi_preamble (chunks):
- # this is not bulletproof..., it checks the first 10 chunks
- idx = 0
- while 1:
- if chunks[idx][0] == 'input':
- if string.find(chunks[idx][1], "@afourpaper") != -1:
- paperguru.m_papersize = 'a4'
- elif string.find(chunks[idx][1], "@afourwide") != -1:
- paperguru.m_papersize = 'a4wide'
- elif string.find(chunks[idx][1], "@smallbook") != -1:
- paperguru.m_papersize = 'smallbook'
- idx = idx + 1
- if idx == 10 or idx == len(chunks):
- break
-
def scan_preamble (chunks):
if __main__.format == 'texi':
- scan_texi_preamble(chunks)
+ #ugh has to be fixed when @c comments are implemented
+ # also the searching here is far from bullet proof.
+ if string.find(chunks[0][1], "@afourpaper") != -1:
+ paperguru.m_papersize = 'a4'
+ elif string.find(chunks[0][1], "@afourwide") != -1:
+ paperguru.m_papersize = 'a4wide'
+ elif string.find(chunks[0][1], "@smallbook") != -1:
+ paperguru.m_papersize = 'smallbook'
else:
assert __main__.format == 'latex'
scan_latex_preamble(chunks)
else:
options = []
options = filter(lambda s: s != '', options)
+ if 'mbverbatim' in options:#ugh this is ugly and only for texi format
+ s = m.group()
+ im = get_re('intertext').search(s)
+ if im:
+ s = s[:im.start()] + s[im.end():]
+ im = re.search('mbverbatim', s)
+ if im:
+ s = s[:im.start()] + s[im.end():]
+ if s[:9] == "@mudela[]":
+ s = "@mudela" + s[9:]
+ return [('mudela', m.group('code'), options, s)]
return [('mudela', m.group('code'), options)]
def do_columns(m):
TODO has format [basename, extension, extension, ... ]
"""
- (type, body, opts) = chunk
+ if len(chunk) == 3:
+ (type, body, opts) = chunk
+ complete_body = None
+ else:# mbverbatim
+ (type, body, opts, complete_body) = chunk
assert type == 'mudela'
file_body = compose_full_body (body, opts)
basename = `abs(hash (file_body))`
else:
taken_file_names[basename] = taken_file_names[basename] + 1
basename = basename + "-%i" % taken_file_names[basename]
+ # writes the file if necessary, returns true if it was written
if not g_read_lys:
update_file(file_body, os.path.join(g_outdir, basename) + '.ly')
needed_filetypes = ['tex']
if 'eps' in opts and not ('eps' in needed_filetypes):
needed_filetypes.append('eps')
outname = os.path.join(g_outdir, basename)
- def f(base, ext1, ext2):
- a = os.path.isfile(base + ext2)
- if (os.path.isfile(base + ext1) and
- os.path.isfile(base + ext2) and
- os.stat(base+ext1)[stat.ST_MTIME] >
- os.stat(base+ext2)[stat.ST_MTIME]) or \
- not os.path.isfile(base + ext2):
- return 1
- todo = []
- if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
- todo.append('tex')
- if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
- todo.append('eps')
- if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
- todo.append('png')
+ if not os.path.isfile(outname + '.tex') \
+ or os.stat(outname+'.ly')[stat.ST_MTIME] > \
+ os.stat(outname+'.tex')[stat.ST_MTIME]:
+ todo = needed_filetypes
+ else:
+ todo = []
+
newbody = ''
if 'verbatim' in opts:
newbody = output_verbatim (body)
+ elif 'mbverbatim' in opts:
+ newbody = output_mbverbatim (complete_body)
for o in opts:
m = re.search ('intertext="(.*?)"', o)