\mudelafile{multi-measure-rest.ly}
+\section{Stems}
+
+Stem tremolos (official naming?) or rolls are tremolo signs that look
+like beam segments crossing stems. If the stem is in a beam, the
+tremolo must be parallel to the beam. If the stem is invisible
+(eg. on a whole note), the tremolo must be centered on the note.
+
+\mudelafile{stem-tremolo.ly}
+
\section{Beams, slurs and other spanners}
+pl 47.jcn1
+ - bf: interstaff slurs (urg: more segfaults in scm_gc_mark ())
+
+pl 45.hwn3
+ - Abbreviation -> Stem_tremolo.
+ - bf: Stem_tremolo in Beam.
+ - bf: Stem_tremolo over whole note.
+ - spacing before clefs.
+ - Spacing_spanner is now on by default
+ - junked most of Spring_spacer
+ - Tunable space after barline.
+
+*********
pl 46.mb2
- Reintroduced the tupletVisibility property. Same values as
the old version (pletvisibility), see the Reference Manual.
. * fix MIDI
. * \shape 1st dim skipped?
. * turn slope-damping on/off
-. * tremolo stuff
+. * tremolo stuff: tremolo over whole note.
. * We need feta-din*.mf files for more sizes than 10.
-. * feta-accordeon has some 'strange turning paths' on 300dpi
. * fix dynamics decently, ie. use kerning & ligatures.
. * dots & rest collisions?
. * mudela-book.py
. * make wide_spanner_engraver (line_group_spanner, staff_symbol)
. * remove Interval dim_ from Dimension_cache and rename the struct.
. * do scaled fonts generally
-. * Spacing.
. * The Lilypond accidental symbols are available through the TeX macros,
\textflat, \textsharp and \textnatural defined in the init file
lilyponddefs.tex. All the symbols are defined in the files fetaXX.tex
. * add new glyphs to font.ly
. * formatting of input stuff.
. * \notes{ a \< b \cr } vs \notes{ a \< b \! }
-. * space after bars?
. * 'hinterfleisch' before bar (e.g. wtk1-fugue2)?
. * Summary of minor spelling irregularities:
. * capitalization/use of underscores in property names
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=1
-PATCH_LEVEL=47
+PATCH_LEVEL=48
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
*/
struct Union_find {
- void connect (int i, int j);
- int find (int i);
- bool equiv (int i, int j) { return find (i) == find (j); }
- Union_find (int sz);
+ void connect (int i, int j);
+ int find (int i);
+ bool equiv (int i, int j) { return find (i) == find (j); }
+ Union_find (int sz);
-private:
/**
This array provides the representing point for each node in the graph.
- */
+ */
Array<int> classes_;
};
#endif
+++ /dev/null
-
-\version "1.0.20";
-\score{
- \notes \transpose c'''{
- \stemup
-% \stemdown
- % default abbreviations
- c4 c4: c4:32 c4: c4 c2.
- a,1
- a,1:32
- c,4:8 c': c,4:16 c':
- [ c,8:16 c, c, c, ] [ a a a a ]
- [ c, f, b, e ]
- [ c,16:32 c, c, c, ] [ a16:32 a a a ]
-% % there's still some hairy beam bugfixing todo
- [ c'8:16 g d a, ]
- [ c,8:32 f, b, e ]
-% [ c'16:32 g d a, ]
- [:32 c16 e]
- [:32 c16 e]
- [:16 c8 e]
- [:16 e4 g]
- [:16 e2 g]
- [:16 e1 g]
-
- }
- \paper{
- castingalgorithm = \Wordwrap;
- }
-}
--- /dev/null
+
+ % broken.
+ [:32 c16 e]
+ [:32 c16 e]
+ [:16 c8 e]
+ [:16 e4 g]
+ [:16 e2 g]
+ [:16 e1 g]
\property Voice.noteHeadStyle = "harmonic"
c4 c2 c8 c16 c16 c1
- \context ThreadedVoice <
+ \context Voice <
\context Thread = TA
{ \property Thread.noteHeadStyle = "cross"
- \property ThreadedVoice.verticalDirection = \up c16}
+ \property Voice.verticalDirection = \up c16}
\context Thread = TB
{ \property Thread.noteHeadStyle = "" a16 }
}
\paper {
- \translator {
- \VoiceContext
- \remove Note_heads_engraver;
- \accepts Thread;
- \name ThreadedVoice;
- }
- \translator {
- \StaffContext
- \accepts ThreadedVoice;
- }
- \translator {
- \type Engraver_group_engraver;
- \consists Note_heads_engraver;
- \name Thread;
- }
+
}
}
\version "1.0.20";
--- /dev/null
+
+\version "1.0.20";
+\score{
+ \notes \transpose c'''{
+ \stemup
+% \stemdown
+ % default abbreviations
+ c4 c4: c4:32 c4: c4 c2.
+ a,1
+ a,1:32
+ c,4:8 c': c,4:16 c':
+ [ c,8:16 c, c, c, ]
+ [ a a a a ]
+ [ c, f, b, e ]
+ [ c,16:32 c, c, c, ] [ a16:32 a a a ]
+% % there's still some hairy beam bugfixing todo
+ [ c'8:16 g d a, ]
+ [ c,8:32 f, b, e ]
+ [ c'16:32 g d a, ]
+
+
+ }
+ \paper{
+ castingalgorithm = \Wordwrap;
+ }
+}
+++ /dev/null
-/*
- abbrev.cc -- implement Abbreviation
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "abbrev.hh"
-#include "debug.hh"
-#include "beam.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "stem.hh"
-#include "offset.hh"
-
-Abbreviation::Abbreviation ()
-{
- stem_l_ = 0;
- abbrev_flags_i_ = 1;
-}
-
-void
-Abbreviation::do_print () const
-{
- DOUT << "abbrev_flags_i_ " << abbrev_flags_i_;
-}
-
-Molecule*
-Abbreviation::do_brew_molecule_p () const
-{
- Beam * b = stem_l_->beam_l_;
- int mult =0;
- if (b)
- {
- Stem_info i = b->get_stem_info (stem_l_);
- mult = i.mult_i_;
- }
-
- Real interbeam_f = paper_l ()->interbeam_f (mult);
- Real w = 1.5 * lookup_l ()->notehead (2, "").dim_[X_AXIS].length ();
- Real space = stem_l_->staff_line_leading_f ();
- Real internote_f = space/2;
-
- Real beam_f = paper_l ()->beam_thickness_f ();
-
- int beams_i = 0;
- Real slope_f = internote_f / 4 / internote_f; // HUH?
-
- if (stem_l_ && stem_l_->beam_l_) {
- slope_f = stem_l_->beam_l_->slope_f_;
- // ugh, rather calc from Abbreviation_req
- beams_i = stem_l_->beams_i_drul_[RIGHT] >? stem_l_->beams_i_drul_[LEFT];
- }
- Real sl = slope_f * internote_f;
-
- Molecule a (lookup_l ()->beam (sl, w, beam_f));
- a.translate (Offset (-w/2, w / 2 * slope_f));
-
- Molecule *beams= new Molecule;
- for (int i = 0; i < abbrev_flags_i_; i++)
- {
- Molecule b (a);
- b.translate_axis (interbeam_f * i, Y_AXIS);
- beams->add_molecule (b);
- }
- beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS);
-
- if (stem_l_)
- {
- if (stem_l_->beam_l_)
- {
- beams->translate (Offset(stem_l_->hpos_f () - hpos_f (),
- stem_l_->stem_end_f () * internote_f -
- stem_l_->beam_l_->dir_ * beams_i * interbeam_f));
- }
- else
- {
- /*
- Beams should intersect one beamthickness below staff end
- */
- Real dy = - beams->extent ()[Y_AXIS].length () / 2 * stem_l_->dir_;
- dy /= internote_f;
- dy += stem_l_->stem_end_f ();
- dy *= internote_f;
-// urg: can't: stem should be stetched first
-// dy -= paper_l ()->beam_thickness_f () * stem_l_->dir_;
- beams->translate (Offset(stem_l_->hpos_f () - hpos_f (), dy));
- }
-
- /*
- there used to be half a page of code that was long commented out.
- Removed in 1.1.35
- */
- }
-
- return beams;
-}
-
-void
-Abbreviation::do_substitute_element_pointer (Score_element*o, Score_element*n)
-{
- if (stem_l_ == o)
- stem_l_ = dynamic_cast<Stem*> (n);
-}
-
-
-void
-Abbreviation::set_stem (Stem *s)
-{
- stem_l_ = s;
- add_dependency (s);
-}
Interval y = elem_l_arr_[i]->extent(axis ());
if (!y.empty_b())
{
- dims.push (y);
+
Score_element *e =dynamic_cast<Score_element*>(elem_l_arr_[i]);
- SCM extra_dims = e->get_elt_property (extra_space_scm_sym);
+ // todo: fucks up if item both in Halign & Valign.
+ SCM min_dims = e->remove_elt_property (minimum_space_scm_sym);
+ if (min_dims != SCM_BOOL_F)
+ {
+ min_dims = SCM_CDR (min_dims);
+ y.unite (Interval (gh_scm2double (SCM_CAR (min_dims)),
+ gh_scm2double (SCM_CDR (min_dims))));
+ }
+
+ SCM extra_dims = e->remove_elt_property (extra_space_scm_sym);
if (extra_dims != SCM_BOOL_F)
{
extra_dims = SCM_CDR (extra_dims);
- dims.top ()[LEFT] -= gh_scm2double (SCM_CAR (extra_dims));
- dims.top ()[RIGHT] += gh_scm2double (SCM_CDR (extra_dims));
+ y[LEFT] += gh_scm2double (SCM_CAR (extra_dims));
+ y[RIGHT] += gh_scm2double (SCM_CDR (extra_dims));
}
elems.push (e);
+ dims.push (y);
}
}
Auto_beam_engraver::Auto_beam_engraver ()
{
stem_l_arr_p_ = 0;
- //shortest_mom_ = 1;
shortest_mom_ = Moment (1, 8);
finished_beam_p_ = 0;
finished_grouping_p_ = 0;
void
Auto_beam_engraver::begin_beam ()
{
- // DOUT << String ("starting autobeam at: ") + now_mom ().str () + "\n";
assert (!stem_l_arr_p_);
stem_l_arr_p_ = new Array<Stem*>;
assert (!grouping_p_);
delete stem_l_arr_p_;
stem_l_arr_p_ = 0;
grouping_p_ = 0;
- //shortest_mom_ = 1;
shortest_mom_ = Moment (1, 8);
}
}
}
grouping_p_->add_child (start, rhythmic_req->length_mom ());
- //stem_l->flag_i_ = rhythmic_req->duration_.durlog_i_;
-
stem_l_arr_p_->push (stem_l);
Moment now = now_mom ();
last_add_mom_ = now;
stem_l_arr_p_ = 0;
delete grouping_p_;
grouping_p_ = 0;
- //shortest_mom_ = 1;
shortest_mom_ = Moment (1, 8);
}
#include "dimensions.hh"
#include "p-score.hh"
#include "paper-def.hh"
+#include "p-col.hh"
+
+
+/*
+ Handle spacing for prefatory matter.
+
+
+
+ TODO: rewrite this. It is kludgy
+*/
void
Break_align_item::do_pre_processing()
align_dir_ = break_status_dir();
flip (&align_dir_);
sort_elements ();
-
+ Real interline= paper_l ()->get_realvar (interline_scm_sym);
Link_array<Score_element> elems;
for (int i=0; i < elem_l_arr_.size(); i++)
}
- if (elems.size ())
- {
- Score_element *current_elt =elems[0];
- SCM current_origin = current_elt->get_elt_property (origin_scm_sym);
+
+ if (!elems.size ())
+ return;
- if (current_origin != SCM_BOOL_F)
- current_origin = SCM_CDR (current_origin);
+ SCM symbol_list = SCM_EOL;
+ Array<Real> dists;
+ SCM current_origin = gh_str02scm ("");
+ for (int i=0; i <= elems.size (); i++)
+ {
+ Score_element *next_elt = i < elems.size ()
+ ? elems[i]
+ : 0 ;
- for (int i=1; i < elems.size (); i++)
+ SCM next_origin;
+
+ if (next_elt)
{
- Score_element *next_elt = elems[i];
- SCM next_origin = next_elt->get_elt_property (origin_scm_sym);
- if (next_origin != SCM_BOOL_F)
- {
- next_origin = SCM_CDR(next_origin);
- SCM extra_space = scm_eval (scm_listify (ly_symbol ("break-align-spacer"),
- current_origin,
- next_origin,
- SCM_UNDEFINED));
-
-
- Real spc = gh_scm2double (extra_space);
- spc *= paper_l ()->get_realvar (interline_scm_sym);
-
- current_elt->set_elt_property (extra_space_scm_sym,
- scm_cons (gh_double2scm (0.0),
- gh_double2scm (spc)));
-
- }
- current_elt = next_elt;
- current_origin = next_origin;
+ next_origin = next_elt->get_elt_property (origin_scm_sym);
+ next_origin =
+ (next_origin == SCM_BOOL_F)
+ ? gh_str02scm ("")
+ : SCM_CDR (next_origin);
}
+ else
+ next_origin = gh_str02scm ("begin-of-note");
+
+ SCM extra_space
+ = scm_eval (scm_listify (ly_symbol ("break-align-spacer"),
+ current_origin, next_origin, SCM_UNDEFINED));
+ SCM symbol = SCM_CAR (extra_space);
+ Real spc = gh_scm2double (SCM_CADR(extra_space));
+ spc *= interline;
+
+ dists.push(spc);
+ symbol_list = gh_cons (symbol, symbol_list);
+ current_origin = next_origin;
+ }
+
+ // skip the first sym.
+ symbol_list = SCM_CDR (scm_reverse (symbol_list));
+ for (int i=0; i <elems.size()-1; i++)
+ {
+ elems[i]->set_elt_property (SCM_CAR (symbol_list),
+ scm_cons (gh_double2scm (0),
+ gh_double2scm (dists[i+1])));
+
+ symbol_list = SCM_CDR (symbol_list);
}
+
+
+ // urg
+ SCM first_pair = elems[0]->get_elt_property (minimum_space_scm_sym);
+ if (first_pair == SCM_BOOL_F)
+ first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0));
+ else
+ first_pair = SCM_CDR (first_pair);
+
+ scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
+ elems[0]->set_elt_property (minimum_space_scm_sym, first_pair);
+
+
+
Axis_align_item::do_pre_processing();
-}
+ Real pre_space = elems[0]->extent (X_AXIS)[LEFT];
+ Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT];
+ if (SCM_CAR (symbol_list) == extra_space_scm_sym)
+ {
+ spring_len += dists.top ();
+ }
+ else if (SCM_CAR (symbol_list) == minimum_space_scm_sym)
+ {
+ spring_len = spring_len >? dists.top ();
+ }
+
+
+ /*
+ Hint the spacing engine how much space to put in.
+ */
+ column_l ()->set_elt_property (extra_space_scm_sym,
+ scm_cons (gh_double2scm (pre_space),
+ gh_double2scm (spring_len)));
+}
Break_align_item::Break_align_item ()
{
stacking_dir_ = RIGHT;
- threshold_interval_[SMALLER] = 1.5 PT;
set_axis (X_AXIS);
}
center_l_ = hg;
}
- /*
- hg->set_elt_property (ly_symbol("origin"),
- scm_cons (gh_str02scm (it->name()),
- hg->get_elt_property (ly_symbol ("origin"))));
- */
hg->add_element (it);
-
-
}
+++ /dev/null
-/*
- abbrev.hh -- declare Abbreviation
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef ABBREV_HH
-#define ABBREV_HH
-
-#include "item.hh"
-class Abbreviation : public Item {
- Stem * stem_l_;
-protected:
- virtual void do_print () const;
- virtual Molecule *do_brew_molecule_p () const;
- virtual void do_substitute_element_pointer (Score_element*, Score_element*);
-public:
- int abbrev_flags_i_;
- Abbreviation ();
- void set_stem (Stem *);
-};
-
-#endif /* ABBREV_HH */
-
#include "proto.hh"
struct Absolute_dynamic_req;
-struct Abbreviation;
+struct Stem_tremolo;
struct Abbreviation_beam;
struct Abbreviation_beam_req;
struct Abbreviation_beam_engraver;
-struct Abbreviation_req;
+struct Tremolo_req;
struct Adobe_font_metric;
struct Adobe_font_char_metric;
struct All_font_metrics;
DECLARE_LY_SYMBOL(interbeam4);
DECLARE_LY_SYMBOL(interline);
DECLARE_LY_SYMBOL(linewidth);
+DECLARE_LY_SYMBOL(minimum_space);
DECLARE_LY_SYMBOL(molecule);
DECLARE_LY_SYMBOL(notewidth);
DECLARE_LY_SYMBOL(non_default);
DECLARE_LY_SYMBOL(volta_thick);
+
#endif /* LY_SYMBOLS_HH */
};
-struct Abbreviation_req : public Request {
- VIRTUAL_COPY_CONS (Abbreviation_req);
- Abbreviation_req ();
+struct Tremolo_req : public Request {
+ VIRTUAL_COPY_CONS (Music);
+ Tremolo_req ();
int type_i_;
virtual void do_print () const;
};
/// make the energy function
void make_matrices (Matrix &quad, Vector &lin,Real&) const;
- void get_ruling_durations(Array<Moment>&);
+
/// generate the LP constraints
void make_constraints (Mixed_qp& lp) const;
void position_loose_cols (Vector &) const;
bool try_initial_solution_and_tell (Vector&)const;
Vector try_initial_solution() const;
- void calc_idealspacing();
+
void set_fixed_cols (Mixed_qp&) const;
Score_column* scol_l (int);
virtual void solve (Column_x_positions*) const;
virtual void lower_bound_solution (Column_x_positions*) const;
virtual void add_column (Paper_column *, bool fixed=false, Real fixpos=0.0);
-
virtual Vector default_solution() const;
virtual bool check_constraints (Vector v) const;
{
int default_abbrev_i_;
Stem *stem_p_;
- Abbreviation *abbrev_p_;
+ Stem_tremolo *abbrev_p_;
Rhythmic_req *rhythmic_req_l_;
- Abbreviation_req* abbrev_req_l_;
+ Tremolo_req* abbrev_req_l_;
protected:
virtual void do_creation_processing ();
virtual void acknowledge_element (Score_element_info);
--- /dev/null
+/*
+ stem-tremolo.hh -- declare Abbreviation
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef ABBREV_HH
+#define ABBREV_HH
+
+#include "item.hh"
+
+
+class Stem_tremolo : public Item {
+ Stem * stem_l_;
+protected:
+ virtual void do_print () const;
+ virtual Molecule *do_brew_molecule_p () const;
+ virtual void do_substitute_element_pointer (Score_element*, Score_element*);
+ virtual Interval do_width () const;
+ virtual void do_pre_processing ();
+public:
+ int abbrev_flags_i_;
+ Stem_tremolo ();
+ void set_stem (Stem *);
+};
+
+#endif /* ABBREV_HH */
+
ly_warning (SCM str)
{
assert (gh_string_p (str));
- warning ("scheme: " + ly_scm2string (str));
+ warning ("lily-guile: " + ly_scm2string (str));
return SCM_BOOL_T;
}
#endif
}
-Abbreviation_req::Abbreviation_req ()
+Tremolo_req::Tremolo_req ()
{
type_i_ = 0;
}
void
-Abbreviation_req::do_print () const
+Tremolo_req::do_print () const
{
#ifndef NPRINT
DOUT << "type " << type_i_ << '\n';
$$ = sp_p;
}
| abbrev_type {
- Abbreviation_req* a = new Abbreviation_req;
+ Tremolo_req* a = new Tremolo_req;
a->set_spot (THIS->here_input ());
a->type_i_ = $1;
$$ = a;
int first = 1;
int last = encompass_arr_.size () - 1;
+
+ Array<Offset> notes;
+ notes.push (Offset (0,0));
+
// prebreak
if (broken_edge_b (RIGHT))
last++;
-
+ else
+ {
+ Encompass_info info (encompass_arr_.top (), dir_, this);
+ d[Y_AXIS] += info.interstaff_f_;
+ }
+
// postbreak
if (broken_edge_b (LEFT))
first--;
+ else
+ {
+ Encompass_info info (encompass_arr_[0], dir_, this);
+ notes[0][Y_AXIS] += info.interstaff_f_;
+ }
- Array<Offset> notes;
- notes.push (Offset (0,0));
-
- Real dy =0.0;
- for (int i = 0; i < last; i++)
+ for (int i = first; i < last; i++)
{
Encompass_info info (encompass_arr_[i], dir_, this);
- if (i >= first)
- notes.push (info.o_ - left);
- else
- dy = info.interstaff_f_;
+ notes.push (info.o_ - left);
}
- notes[0][Y_AXIS] += dy;
notes.push (d);
return notes;
/*
cut 'n paste from spring-spacer.cc
+
+ generate springs between columns.
+
+
+ TODO
+
+ * Spacing should take optical effects into account
+
+ The algorithm is partly taken from :
+
+ John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+ OSU-CISRC-10/87-TR35, Department of Computer and Information
+ Science, The Ohio State University, 1987.
+
*/
Array<Spring>
Spacing_spanner::do_measure (int col1, int col2) const
Array<Spring> meas_springs;
+ /*
+ UGR GUR URG. duplicate code for spacing generation.
+ */
for (int i= col1; i < col2; i++)
{
- if (!scol (i)->musical_b() && i+1 < col_count())
+ SCM hint = scol (i)->get_elt_property (extra_space_scm_sym);
+ if (hint != SCM_BOOL_F)
+ {
+ hint = SCM_CDR (hint);
+
+ Spring s;
+ s.item_l_drul_[LEFT] = scol (i);
+ s.item_l_drul_[RIGHT] = scol (i+1);
+ Real unbroken_dist = gh_scm2double (SCM_CDR(hint));
+
+ s.distance_f_ = unbroken_dist;
+ s.strength_f_ = 2.0;
+
+
+ meas_springs.push (s);
+
+
+ Item * l = scol(i)->find_prebroken_piece (RIGHT);
+ Item * r = scol(i+1)->find_prebroken_piece (LEFT);
+ if (l)
+ {
+ Spring s;
+ s.item_l_drul_[LEFT] = l;
+ s.item_l_drul_[RIGHT] = scol (i+1);
+ hint = l->get_elt_property (extra_space_scm_sym);
+
+ if (hint == SCM_BOOL_F)
+ {
+ programming_error ("No postbreak breakable spacing hint set.");
+ s.distance_f_= unbroken_dist;
+ }
+ else
+ s.distance_f_ = gh_scm2double (SCM_CDDR(hint));
+
+ /*
+ space around barlines should not stretch very much.
+ */
+ s.strength_f_ = 2.0;
+ meas_springs.push (s);
+ }
+
+ if (r)
+ {
+ Spring s;
+ s.item_l_drul_[LEFT] = scol (i);
+ s.item_l_drul_[RIGHT] = r;
+ s.distance_f_ = unbroken_dist;
+
+ /*
+ space around barlines should not stretch very much.
+ */
+ s.strength_f_ = 2.0;
+ meas_springs.push (s);
+ }
+
+ if (l&&r)
+ {
+ Spring s;
+ s.item_l_drul_[LEFT] = l;
+ s.item_l_drul_[RIGHT] = r;
+
+ hint = l->get_elt_property (extra_space_scm_sym);
+ if (hint == SCM_BOOL_F)
+ {
+ programming_error ("No postbreak breakable spacing hint set.");
+ s.distance_f_= unbroken_dist;
+ }
+ else
+ s.distance_f_ = gh_scm2double (SCM_CDDR(hint));
+
+ /*
+ space around barlines should not stretch very much.
+ */
+ s.strength_f_ = 2.0;
+ meas_springs.push (s);
+ }
+ }
+ else if (!scol (i)->musical_b() && i+1 < col_count())
{
Real symbol_distance = scol (i)->extent (X_AXIS)[RIGHT] ;
Real durational_distance = 0;
r_rod.other_idx_ = this_rank;
cols_[left_idx].rods_[RIGHT].push (r_rod);
}
-#if 1
- if (experimental_features_global_b)
- {
- for (int i=0; i < col->spring_arr_drul_[LEFT].size (); i++)
- {
- Column_spring &cr = col->spring_arr_drul_[LEFT][i];
- int idx = cr.other_l_->rank_i () - cols_[0].pcol_l_->rank_i ();
- if (idx < 0)
- continue;
- if (cols_[idx].pcol_l_ != cr.other_l_)
+ for (int i=0; i < col->spring_arr_drul_[LEFT].size (); i++)
+ {
+ Column_spring &cr = col->spring_arr_drul_[LEFT][i];
+ int idx = cr.other_l_->rank_i () - cols_[0].pcol_l_->rank_i ();
+ if (idx < 0)
+ continue;
+
+ if (cols_[idx].pcol_l_ != cr.other_l_)
continue;
-
-
- connect (idx, this_rank, cr.distance_f_,
- cr.strength_f_ / cr.distance_f_);
- }
+
+
+ connect (idx, this_rank, cr.distance_f_,
+ cr.strength_f_ / cr.distance_f_);
}
-#endif
-
+
cols_.push (c);
}
}
return retval;
}
+
/*
Ugh. Should junk this.
*/
void
Spring_spacer::prepare()
{
- if (!experimental_features_global_b)
- calc_idealspacing();
handle_loose_cols();
print();
}
-/**
- get the shortest_playing running note at a time. */
-void
-Spring_spacer::get_ruling_durations(Array<Moment> &context_shortest_arr)
-{
- for (int i=0; i < cols_.size(); i++)
- {
- scol_l (i)->preprocess();
- scol_l (i)->print ();
- }
- int start_context_i=0;
- Moment context_shortest;
- context_shortest.set_infinite (1);
- context_shortest_arr.set_size(cols_.size());
-
- for (int i=0; i < cols_.size(); i++)
- {
- Score_column * sc = scol_l(i);
-
- if (sc->breakable_b () || sc->break_status_dir ())
- {
- for (int ji=i; ji >= start_context_i; ji--)
- context_shortest_arr[ji] = context_shortest;
- start_context_i = i;
- context_shortest.set_infinite (1);
- }
- else if (sc->musical_b ())
- context_shortest = context_shortest <? sc->shortest_starter_mom_;
- }
-
-#ifndef NPRINT
- DOUT << "context shortest :[ ";
- for (int i=0; i < context_shortest_arr.size(); i++)
- {
- DOUT << context_shortest_arr[i] << ", ";
- }
- DOUT << "]\n";
-#endif
-}
-
-/*
- TODO: take out the refs to width
-
- */
-/**
- generate springs between columns.
-
- TODO: This needs rethinking.......
-
- * Spacing should take optical effects into account
-
- * Should be decentralised
-
- The algorithm is taken from :
-
- John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
- OSU-CISRC-10/87-TR35, Department of Computer and Information
- Science, The Ohio State University, 1987.
-
- */
-void
-Spring_spacer::calc_idealspacing()
-{
- Array<Moment> context_shortest_arr;
- get_ruling_durations(context_shortest_arr);
-
- Real interline_f = paper_l ()->get_realvar (interline_scm_sym);
-
- Array<Real> ideal_arr;
- Array<Real> hooke_arr;
- for (int i=0; i < cols_.size() - 1; i++){
- ideal_arr.push (-1.0);
- hooke_arr.push (1.0);
- }
-
- /*
- First do all non-musical columns
- */
- for (int i=0; i < cols_.size(); i++)
- {
- if (!scol_l (i)->musical_b() && i+1 < cols_.size())
- {
- Real symbol_distance =cols_[i].width_[RIGHT] + 2 PT;
- Real durational_distance = 0;
- Moment delta_t = scol_l (i+1)->when_mom () - scol_l (i)->when_mom () ;
-
- /*
- ugh should use shortest_playing distance
- */
- if (delta_t)
- {
- Real k= paper_l()->arithmetic_constant (context_shortest_arr[i]);
- durational_distance = paper_l()->length_mom_to_dist (delta_t,k);
- }
- symbol_distance += -cols_[i+1].width_[LEFT];
-
-
- ideal_arr[i] = symbol_distance >? durational_distance;
- hooke_arr[i] = 1; //2.0;
- }
- }
-
- /*
- Then musicals
- */
- for (int i=0; i < cols_.size(); i++)
- {
- if (scol_l (i)->musical_b())
- {
- Moment shortest_playing_len = scol_l(i)->shortest_playing_mom_;
- Moment context_shortest = context_shortest_arr[i];
- if (! shortest_playing_len)
- {
- warning (_f ("can't find a ruling note at %s",
- scol_l (i)->when_mom ().str ()));
- shortest_playing_len = 1;
- }
- if (! context_shortest)
- {
- warning (_f ("no minimum in measure at %s",
- scol_l (i)->when_mom ().str ()));
- context_shortest = 1;
- }
- Moment delta_t = scol_l (i+1)->when_mom () - scol_l (i)->when_mom ();
- Real k= paper_l()->arithmetic_constant(context_shortest);
- Real dist = paper_l()->length_mom_to_dist (shortest_playing_len, k);
- dist *= (double)(delta_t / shortest_playing_len);
-
- /*
- According to [Ross] and [Wanske], and from what i've seen:
-
- * whitespace at the begin of the bar should be fixed at
- (about) one interline.
-
- [Ross]:
- when spacing gets real tight, a smaller fixed value may be
- used, so that there are two discrete amounts of whitespace
- possible at the begin of a bar; but this is not implemented
- right now.
-
- * whitespace at the end of the bar is the normal amount of
- "hinterfleish" that would have been used, had there been
- yet another note in the bar.
-
- [Ross]:
- some editors argue that the bar line should not take any
- space, not to hinder the flow of music spaced around a bar
- line.
-
- [Ross] and [Wanske] do not suggest this, however. Further,
- it introduces some spacing problems and I think that it is ugly
- too.
-
- [jcn]
- */
-
- /*
- first musical column of bar
- */
- if (i && !scol_l (i - 1)->musical_b ())
- {
- // one interline minimum at start of bar
-
- // cols_[i].width_[RIGHT] += interline_f;
- cols_[i].width_[RIGHT] = cols_[i].width_[RIGHT] >? interline_f;
-
- // should adjust dist too?
- ideal_arr[i-1] = ideal_arr[i-1] >? (2 * interline_f);
- }
-
- /*
- last musical column of bar
- */
- if (i + 1 < cols_.size () && !scol_l(i+1)->musical_b ())
- {
- // two interline minimum ok for last column?
- dist = dist >? 2 * interline_f;
-
- // set minimum rod
- /*
- urg: simply *adding* an interline leaves big gaps at
- end of measure in star-spangled-banner (after lyrics
- at eom).
-
- cols_[i].width_[RIGHT] += interline_f; // before
-
- having a minimum of one interline solves this problem
- in most (but not all??) cases.
-
- for music without lyrics (esp. when set very tightly),
- adding an interline looks good: probably because this
- hides a bug that allows the last note's "hinterfleish"
- to be removed (e.g., see wtk1-fugue2: that's ugly now).
- -- jcn
- */
-
- cols_[i].width_[RIGHT] = cols_[i].width_[RIGHT] >? 2 * interline_f;
- }
-
- // ugh, do we need this?
- if (i < cols_.size () - 1 && !scol_l (i + 1)->musical_b ())
- {
- Real minimum = -cols_[i + 1].width_[LEFT] + cols_[i].width_[RIGHT]
- + interline_f / 2;
- dist = dist >? minimum;
- }
- ideal_arr[i] = dist;
- }
- }
-
- /*
- shorter distances should stretch less.
-
- (and how bout
-
- hooke[i] = 2 * max_ideal_space - ideal[i]
-
- ?)
- */
- for (int i=0; i < ideal_arr.size(); i++)
- hooke_arr[i] = 1/ideal_arr[i];
-
- for (int i=0; i < ideal_arr.size(); i++)
- {
- assert (ideal_arr[i] >=0 && hooke_arr[i] >=0);
- connect (i, i+1, ideal_arr[i], hooke_arr[i]);
- }
-}
#include "musical-request.hh"
#include "duration-convert.hh"
#include "misc.hh"
-#include "abbrev.hh"
+#include "stem-tremolo.hh"
#include "staff-info.hh"
#include "translator-group.hh"
if (t)
{
- abbrev_p_ = new Abbreviation;
+ abbrev_p_ = new Stem_tremolo;
announce_element (Score_element_info (abbrev_p_, abbrev_req_l_));
abbrev_p_->abbrev_flags_i_ =intlog2 (t) - (duration_log>? 2);
}
{
r->warning (_f("Adding note head to incompatible stem (type = %d)", 1 << stem_p_->flag_i_));
}
-
+
stem_p_->add_head (h);
}
}
bool
Stem_engraver::do_try_music (Music* r)
{
- if (Abbreviation_req* a = dynamic_cast <Abbreviation_req *> (r))
+ if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
{
abbrev_req_l_ = a;
return true;
--- /dev/null
+/*
+ abbrev.cc -- implement Stem_tremolo
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "stem-tremolo.hh"
+#include "debug.hh"
+#include "beam.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "stem.hh"
+#include "offset.hh"
+
+Stem_tremolo::Stem_tremolo ()
+{
+ stem_l_ = 0;
+ abbrev_flags_i_ = 1;
+}
+
+void
+Stem_tremolo::do_print () const
+{
+ DOUT << "abbrev_flags_i_ " << abbrev_flags_i_;
+}
+
+Interval
+Stem_tremolo::do_width () const
+{
+ Real space = stem_l_->staff_line_leading_f ();
+ return Interval (-space, space);
+}
+
+void
+Stem_tremolo::do_pre_processing ()
+{
+}
+
+Molecule*
+Stem_tremolo::do_brew_molecule_p () const
+{
+ int mult =0;
+ if (Beam * b = stem_l_->beam_l_)
+ {
+ Stem_info i = b->get_stem_info (stem_l_);
+ mult = i.mult_i_;
+ }
+
+ Real interbeam_f = paper_l ()->interbeam_f (mult);
+ Real w = 1.5 * lookup_l ()->notehead (2, "").dim_[X_AXIS].length ();
+ Real space = stem_l_->staff_line_leading_f ();
+ Real internote_f = space/2;
+
+ Real beam_f = paper_l ()->beam_thickness_f ();
+
+ int beams_i = 0;
+ Real slope_f = internote_f / 4 / internote_f; // HUH?
+
+ if (stem_l_ && stem_l_->beam_l_) {
+ slope_f = stem_l_->beam_l_->slope_f_;
+ // ugh, rather calc from Stem_tremolo_req
+ beams_i = stem_l_->beams_i_drul_[RIGHT] >? stem_l_->beams_i_drul_[LEFT];
+ }
+ Real sl = slope_f * internote_f;
+
+ Molecule a (lookup_l ()->beam (sl, w, beam_f));
+ a.translate (Offset (-w/2, w / 2 * slope_f));
+
+ Molecule *beams= new Molecule;
+ for (int i = 0; i < abbrev_flags_i_; i++)
+ {
+ Molecule b (a);
+ b.translate_axis (interbeam_f * i, Y_AXIS);
+ beams->add_molecule (b);
+ }
+ beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS);
+
+ if (stem_l_)
+ {
+ if (stem_l_->beam_l_)
+ {
+ beams->translate (Offset(stem_l_->hpos_f () - hpos_f (),
+ stem_l_->stem_end_f () * internote_f -
+ stem_l_->beam_l_->dir_ * beams_i * interbeam_f));
+ }
+ else
+ {
+ /*
+ Beams should intersect one beamthickness below staff end
+ */
+ Real dy = - beams->extent ()[Y_AXIS].length () / 2 * stem_l_->dir_;
+
+ /*
+ uhg. Should use relative coords and placement
+ */
+ Real whole_note_correction = (stem_l_ && stem_l_->invisible_b( ))
+ ? -stem_l_->get_dir () * stem_l_->note_delta_f ()/2
+ : 0.0;
+
+ /*
+ UGH. Internote fudging.
+ */
+ dy /= internote_f;
+ dy += stem_l_->stem_end_f ();
+ dy *= internote_f;
+ beams->translate (Offset(stem_l_->hpos_f () - hpos_f ()+
+ whole_note_correction, dy));
+ }
+
+ /*
+ there used to be half a page of code that was long commented out.
+ Removed in 1.1.35
+ */
+ }
+
+ return beams;
+}
+
+void
+Stem_tremolo::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+ if (stem_l_ == o)
+ stem_l_ = dynamic_cast<Stem*> (n);
+}
+
+
+void
+Stem_tremolo::set_stem (Stem *s)
+{
+ stem_l_ = s;
+ add_dependency (s);
+}
Begin3
Titel: LilyPond
-Versie: 1.1.47
-Inschrijf datum: 09JUN99
+Versie: 1.1.48
+Inschrijf datum: 17JUN99
Beschrijving: @FLAPTEKST@
Trefwoorden: muziek typezetten midi notatie
Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys)
Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
- 770k lilypond-1.1.47.tar.gz
+ 770k lilypond-1.1.48.tar.gz
Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.47.tar.gz
+ 770k lilypond-1.1.48.tar.gz
Copi-eer voorwaarden: GPL
End
Begin3
Title: LilyPond
-Version: 1.1.47
-Entered-date: 09JUN99
+Version: 1.1.48
+Entered-date: 17JUN99
Description:
LilyPond is the GNU Project music typesetter. This program can print
beautiful sheet music from a music definition file. It can also play
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 770k lilypond-1.1.47.tar.gz
+ 770k lilypond-1.1.48.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.47.tar.gz
+ 770k lilypond-1.1.48.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.1.47
+Version: 1.1.48
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.47.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.48.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
;; Spacing constants for prefatory matter.
;;
-;; rules for this spacing are much more complicated than this. See [Wanske] page 126 -- 134
+;; rules for this spacing are much more complicated than this. See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147
;;
;;
+
(define space-alist
'(
- (("Clef_item" "Key_item") . 2.5)
- (("Key_item" "Time_signature") . 2.5)
- (("Clef_item" "Time_signature") . 2.75)
- (("Staff_bar" "Clef_item") . 1.0)
- (("Clef_item" "Staff_bar") . 3.7)
- (("Time_signature" "Staff_bar") . 2.0)
- (("Key_item" "Staff_bar") . 2.5)
- (("Span_bar" "Clef_item") . 1.0)
- (("Clef_item" "Span_bar") . 3.7)
- (("Time_signature" "Span_bar") . 2.0)
- (("Key_item" "Span_bar") . 2.5)
- (("Staff_bar" "Time_signature") . 1.0)
+ (("" "Clef_item") . (minimum_space 1.0))
+ (("" "Staff_bar") . (minimum_space 0.0))
+ (("" "Clef_item") . (minimum_space 1.0))
+ (("" "Key_item") . (minimum_space 0.5))
+ (("" "Span_bar") . (extra_space 0.0))
+ (("" "Time_signature") . (extra_space 0.0))
+ (("" "begin-of-note") . (minimum_space 1.5))
+ (("Clef_item" "Key_item") . (minimum_space 3.5))
+ (("Key_item" "Time_signature") . (extra_space 2.0))
+ (("Clef_item" "Time_signature") . (minimum_space 3.5))
+ (("Staff_bar" "Clef_item") . (minimum_space 1.0))
+ (("Clef_item" "Staff_bar") . (minimum_space 3.7))
+ (("Time_signature" "Staff_bar") . (minimum_space 2.0))
+ (("Key_item" "Staff_bar") . (extra_space 1.0))
+ (("Span_bar" "Clef_item") . (extra_space 1.0))
+ (("Clef_item" "Span_bar") . (minimum_space 3.7))
+ (("Time_signature" "Span_bar") . (minimum_space 2.0))
+ (("Key_item" "Span_bar") . (minimum_space 2.5))
+ (("Staff_bar" "Time_signature") . (minimum_space 1.0))
+ (("Time_signature" "begin-of-note") . (extra_space 1.0)) ; Huh? see twinkle.ly
+ (("Key_item" "begin-of-note") . (extra_space 3.0))
+ (("Staff_bar" "begin-of-note") . (extra_space 1.0))
+ (("Clef_item" "begin-of-note") . (minimum_space 5.0))
)
+)
+
- )
(define (break-align-spacer this next)
(let ((entry (assoc `(,this ,next) space-alist)))
(if entry
(cdr entry)
- (begin (ly-warn (string-append "Unknown spacing pair " this ", " next))
- 0.0))))
+ (begin (ly-warn (string-append "Unknown spacing pair `" this "', `" next "'"))
+ '(minimum_space 0.0)))))