+pl 19.jcn2
+ - multi-measure-rest is now spanner SkipBars=0 is broken
+
+pl 19.jcn1
+ - hmm, almost centered whole-bar rests -- NOT
+
pl 18.jcn5
- bf: beamtrend
- bf: vv-duet
* update mi2mu for lilypond 1.1
BUGS:
+ * collisions/voices \voiceone \voicetwo are broken; see
+ input/praeludium-fuga-E.ly
+ mutopia/J.S.Bach/wtk1-fugue2.ly
* fix: standchen.
* handle EOF graciously in error messages.
- * centered whole rest
+ * really centered whole rest
+
+ * centered multi-bar-rest
* declare notenametab?
MAJOR_VERSION=1
MINOR_VERSION=1
PATCH_LEVEL=19
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
%}
% \type "Hara_kiri_line_group_engraver";
+ \consists "Multi_measure_rest_engraver";
\consists "Repeat_engraver";
\consists "Bar_engraver";
\consists "Clef_engraver";
\consists "Stem_engraver";
\consists "Beam_engraver";
\consists "Abbreviation_beam_engraver";
- \consists "Multi_measure_rest_engraver";
+% \consists "Multi_measure_rest_engraver";
% ugh. Order matters here.
\consists "Text_engraver";
Multi_measure_rest_engraver ();
protected:
+ virtual void acknowledge_element (Score_element_info i);
virtual void do_process_requests ();
virtual bool do_try_music (Music*);
virtual void do_pre_move_processing ();
virtual void do_post_move_processing ();
+
private:
- Moment rest_req_stop_mom_;
- Moment rest_item_creation_mom_;
- Moment req_start_mom_;
+ Moment rest_stop_mom_;
+// Moment rest_item_creation_mom_;
+ Moment rest_start_mom_;
int start_measure_i_;
Multi_measure_rest_req* multi_measure_req_l_;
Multi_measure_rest* mmrest_p_;
+ Multi_measure_rest* lastrest_p_;
};
#endif // MULTI_MEASURE_REST_ENGRAVER_HH
#ifndef MULTI_MEASURE_REST_HH
#define MULTI_MEASURE_REST_HH
-#include "item.hh"
+#include "spanner.hh"
-class Multi_measure_rest : public Item
+class Multi_measure_rest : public Spanner
{
public:
Multi_measure_rest ();
int measures_i_;
+ void add_column (Bar*);
-
+ Link_array<Bar> column_arr_;
protected:
- virtual void do_print () const;
virtual Molecule *do_brew_molecule_p () const;
+ VIRTUAL_COPY_CONS (Score_element);
+
+ virtual void do_add_processing ();
+ virtual void do_post_processing ();
+ virtual void do_print () const;
+ virtual void do_substitute_dependency (Score_element*,Score_element*);
};
#endif /* MULTI_MEASURE_REST_HH */
Moment when() { return when_; }
- Score_column (Moment when, bool musical_b = false);
+ Score_column (Moment when, bool musical_b=false);
void add_duration (Moment);
void preprocess();
bool musical_b() { return musical_b_; }
#include "text-def.hh"
#include "pointer.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
/** Volta bracket with number */
-class Volta_spanner : public Directional_spanner
+class Volta_spanner : public Spanner
{
public:
Volta_spanner ();
protected:
virtual Molecule* do_brew_molecule_p () const;
- VIRTUAL_COPY_CONS(Score_element);
+ VIRTUAL_COPY_CONS (Score_element);
virtual void do_add_processing ();
virtual void do_post_processing ();
#include "multi-measure-rest-engraver.hh"
#include "score-column.hh"
#include "time-description.hh"
-#include "p-score.hh"
+//#include "paper-score.hh"
+//#include "p-score.hh"
+//#include "paper-def.hh"
+//#include "main.hh"
+//#include "global-translator.hh"
+#include "bar.hh"
ADD_THIS_TRANSLATOR (Multi_measure_rest_engraver);
Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
{
start_measure_i_ = 0;
- rest_item_creation_mom_ = rest_req_stop_mom_ =0;
+ rest_stop_mom_ =0;
+ // rest_item_creation_mom_ = 0;
multi_measure_req_l_ = 0;
mmrest_p_ = 0;
}
+void
+Multi_measure_rest_engraver::acknowledge_element (Score_element_info i)
+{
+ if (Bar *c = dynamic_cast<Bar*> (i.elem_l_))
+ {
+ if (mmrest_p_)
+ mmrest_p_->add_column (c);
+ if (lastrest_p_)
+ lastrest_p_->add_column (c);
+ }
+}
+
bool
Multi_measure_rest_engraver::do_try_music (Music* req_l)
{
{
if (multi_measure_req_l_)
if (!multi_measure_req_l_->equal_b (mr)
- || req_start_mom_ != now_moment ())
+ || rest_start_mom_ != now_moment ())
return false;
multi_measure_req_l_ = mr;
- req_start_mom_ = now_moment ();
+ rest_start_mom_ = now_moment ();
- rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length ();
+ rest_stop_mom_ = rest_start_mom_ + multi_measure_req_l_->duration_.length ();
return true;
}
return false;
{
Time_description const *time = get_staff_info().time_C_;
mmrest_p_ = new Multi_measure_rest;
- rest_item_creation_mom_ = time->when_mom ();
-
- rest_item_creation_mom_ += time->whole_per_measure_ / Moment (2);
-#if 0
- // core dump because of missing column?
- mmrest_p_->pscore_l_->add_column (new Score_column (rest_item_creation_mom_));
- mmrest_p_->pscore_l_->add_column (new Score_column (rest_item_creation_mom_, true));
-#endif
-
+ // rest_item_creation_mom_ = time->when_mom ();
announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_));
start_measure_i_ = time->bars_i_;
}
Multi_measure_rest_engraver::do_pre_move_processing ()
{
Moment now (now_moment ());
- if (mmrest_p_ && rest_item_creation_mom_ == now)
+ //urg lily dumps core if i want to let her print all (SkipBars=0) rests...
+#if 0
+ if (mmrest_p_ && (now >= rest_start_mom_) && (mmrest_p_->column_arr_.size () >= 2))
{
typeset_element (mmrest_p_);
}
+#endif
+ if (lastrest_p_)
+ {
+ typeset_element (lastrest_p_);
+ lastrest_p_ = 0;
+ }
}
void
{
Time_description const *time = get_staff_info().time_C_;
Moment now (now_moment ());
- if (rest_req_stop_mom_ <= now)
- multi_measure_req_l_ = 0;
- if (mmrest_p_ && (!time->whole_in_measure_ || !multi_measure_req_l_))
+ /*
+ when our time's up, calculate the number of bars rest and
+ make way for new request
+ however, linger around a bit to catch this last column when
+ its announced
+ */
+ if (mmrest_p_ && (now >= rest_stop_mom_)) //&& (!time->whole_in_measure_))
{
- assert (rest_item_creation_mom_ < now);
+ lastrest_p_ = mmrest_p_;
+ lastrest_p_->measures_i_ = time->bars_i_ - start_measure_i_;
+ //urg lily dumps core if i want to let her print all (SkipBars=0) rests...
+#if 0
+ if (lastrest_p_->column_arr_.size () >= 2)
+ lastrest_p_ = 0;
+#endif
+ multi_measure_req_l_ = 0;
mmrest_p_ = 0;
}
}
+
source file of the GNU LilyPond music typesetter
- (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998, 1999 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "multi-measure-rest.hh"
#include "debug.hh"
#include "paper-def.hh"
+#include "p-col.hh" // urg
+#include "bar.hh"
#include "lookup.hh"
#include "rest.hh"
#include "script.hh"
Multi_measure_rest::do_brew_molecule_p () const
{
/*
- [TODO] 3
- * make real multi-measure rest symbol: |---|
- * make two,four,eight-measure-rest symbols
+ [TODO] 17
+ * variable-sized multi-measure rest symbol: |====| ??
+ * build 3, 5, 6, 7, 8 symbols (how far, property?)
+ from whole, brevis and longa rests
*/
+ Molecule* mol_p = new Molecule;
+ if (!column_arr_.size ())
+ return mol_p;
+
Atom s;
if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
{
s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+ s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
}
else
{
s = (lookup_l ()->rest (-4, 0));
}
- Molecule* mol_p = new Molecule ( Atom (s));
+ mol_p->add_atom (s);
Real interline_f = paper ()->interline_f ();
if (measures_i_ == 1)
{
return mol_p;
}
+void
+Multi_measure_rest::do_add_processing ()
+{
+ if (column_arr_.size ())
+ {
+ set_bounds (LEFT, column_arr_[0 >? column_arr_.size () - 2]);
+ set_bounds (RIGHT, column_arr_[column_arr_.size () - 1]);
+ }
+}
+
+void
+Multi_measure_rest::do_post_processing ()
+{
+ if (column_arr_.size ())
+ translate_axis (extent (X_AXIS).length () / 2, X_AXIS);
+}
+
+void
+Multi_measure_rest::do_substitute_dependency (Score_element* o, Score_element* n)
+{
+ if (Bar* c = dynamic_cast <Bar*> (o))
+ column_arr_.substitute (c, dynamic_cast<Bar*> (n));
+}
+
+void
+Multi_measure_rest::add_column (Bar* c)
+{
+ column_arr_.push (c);
+ add_dependency (c);
+}
+
#include "score-column.hh"
#include "command-request.hh"
#include "paper-def.hh"
-#include "p-score.hh"
if (((int)s->chord_start_f ()) && (s->dir_ != s->get_default_dir ()))
{
idealy_f_ -= shorten_f;
- miny_f_ = miny_f_ <? idealy_f_ + internote_f;
+// miny_f_ = miny_f_ <? idealy_f_ + internote_f;
}
// lowest beam of (UP) beam must never be lower than second staffline
/* allbars == ! skipbars */
bool allbars = ! get_property ("SkipBars", 0).to_bool ();
-
+ // urg: multi bar rests: should always must process whole of first bar?
if (!time_.cadenza_b_ && allbars)
global_l->add_moment_to_process (time_.next_bar_moment ());
}
#include "stem.hh"
#include "text-def.hh"
-/*
- Hmm, should probably make generic Bracket_spanner,
- or and derive Plet and volta spanner from that.
- */
-
Volta_spanner::Volta_spanner ()
{
- dir_ = UP;
last_b_ = false;
number_p_.set_p (new Text_def);
number_p_->align_dir_ = LEFT;
{
Molecule* mol_p = new Molecule;
- if (column_arr_.size ())
- {
- Real internote_f = paper ()->internote_f ();
- Real dx = internote_f;
- Real w = extent (X_AXIS).length () - 2 * dx;
- Atom volta (lookup_l ()->volta (w, last_b_));
- Real h = volta.dim_.y ().length ();
- Atom num (number_p_->get_atom (paper (), LEFT));
- Atom dot (dot_p_->get_atom (paper (), LEFT));
- Real dy = column_arr_.top ()->extent (Y_AXIS) [dir_] >
- column_arr_[0]->extent (Y_AXIS) [dir_];
- dy += 2 * h;
+ if (!column_arr_.size ())
+ return mol_p;
- /*
- UGH. Must use extent ()[dir_]
- */
- for (int i = 0; i < note_column_arr_.size (); i++)
- dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
- dy -= h;
+ Real internote_f = paper ()->internote_f ();
+ Real dx = internote_f;
+ Real w = extent (X_AXIS).length () - 2 * dx;
+ Atom volta (lookup_l ()->volta (w, last_b_));
+ Real h = volta.dim_.y ().length ();
+ Atom num (number_p_->get_atom (paper (), LEFT));
+ Atom dot (dot_p_->get_atom (paper (), LEFT));
+ Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] >
+ column_arr_[0]->extent (Y_AXIS) [UP];
+ dy += 2 * h;
- Real gap = num.dim_.x ().length () / 2;
- Offset off (num.dim_.x ().length () + gap,
- (h - num.dim_.y ().length ()) / internote_f - gap);
- num.translate (off);
- Real dotheight = dot.dim_.y ().length () / 7;
- off -= Offset (0, dotheight);
- dot.translate (off);
- mol_p->add_atom (volta);
- mol_p->add_atom (num);
- mol_p->add_atom (dot);
- mol_p->translate (Offset (dx, dy));
- }
+ /*
+ UGH. Must use extent ()[dir_]
+ */
+ for (int i = 0; i < note_column_arr_.size (); i++)
+ dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
+ dy -= h;
+
+ Real gap = num.dim_.x ().length () / 2;
+ Offset off (num.dim_.x ().length () + gap,
+ (h - num.dim_.y ().length ()) / internote_f - gap);
+ num.translate (off);
+ Real dotheight = dot.dim_.y ().length () / 7;
+ off -= Offset (0, dotheight);
+ dot.translate (off);
+ mol_p->add_atom (volta);
+ mol_p->add_atom (num);
+ mol_p->add_atom (dot);
+ mol_p->translate (Offset (dx, dy));
return mol_p;
}
void
Volta_spanner::do_post_processing ()
{
- if (column_arr_.size())
- translate_axis (column_arr_[0]->extent (Y_AXIS)[dir_], Y_AXIS);
+ if (column_arr_.size())
+ translate_axis (column_arr_[0]->extent (Y_AXIS)[UP], Y_AXIS);
}
void
comes = \notes \relative c'' {
\voiceone
- r1 |
- r1 |
+ R1 |
+ R1 |
r8 [g'16 fis] [g8 c,] [es g16 fis] [g8 a] |
[d,8 g16 fis] [g8 a] [c,16 d] es4 [d16 c] |
%%5
bassdux = \notes \relative c' {
\clef bass;
- r1 |
- r |
- r |
- r |
+ R1 |
+ R |
+ R |
+ R |
%%5
- r |
- r1 |
+ R |
+ R1 |
r8 [c16 b] [c8 g] [as c16 b] [c8 d] |
[g, c16 b] [c8 d] [f,16 g] as4 [g16 f] |
[es c' b a] [g f es d] [c d es d] [c bes! as! g] |