* lily/GNUmakefile (static-gxx-libs): new target
static-gxx-libs. Create link to libstdc++.a
- * lily/new-lyric-combine-music-iterator.cc: rename to Lyric_combine_music_iterator
+ * lily/new-lyric-combine-music-iterator.cc: rename to
+ Lyric_combine_music_iterator
* lily/lyric-combine-music-iterator.cc
- (Old_lyric_combine_music_iterator): rename to Old_lyric_combine_music_iterator
+ (Old_lyric_combine_music_iterator): rename to
+ Old_lyric_combine_music_iterator
* lily/*-engraver.cc (various): remove double use of
PRECOMPUTED_VIRTUAL function: only use
2005-07-16 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/system.cc (do_derived_mark): don't mark from object_alist_
- anymore, but do it centrally. Speedup: approximately 3-5 %.
+ anymore, but do it centrally.
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): remove
hammer hack.
" systems (expecting " (number->string n))))))
+#(define (assert-system-count-override count)
+ (ly:export #{ \override NoteHead
+ #'after-line-breaking-callback
+ = #(lambda (smob) (assert-system-count smob $count))
+ #}))
+
+
\header {
title = "Solo Cello Suite II"
piece ="Sarabande"
<< { d8. e16 e4.\trill d16 e } \\
{ d4 a2 } >>
- <d, a' f'>4. e'8[ d c] |
+ <d, a' f'>4. e'8[ d c] |
bes[ g'] f[
e16(f] g[ a bes d,)] |
cis4.\trill b8[ a g] |
d'[ cis] |
%% d4 d,,2 |
d4
- \override NoteHead
- #'after-line-breaking-callback
- = #(lambda (smob) (assert-system-count smob 6))
+ #(assert-system-count-override 6)
d,,2 |
}
\sarabandeCelloScripts
>>
-% size perversions
+%% size perversions
smallerPaper = \layout {
- \context { \Staff
- fontSize = #-1
- \override StaffSymbol #'staff-space = #0.8
- }
- \context { \Score
- \override SpacingSpanner #'spacing-increment = #0.96
- }
-
- indent = 5.6 \mm
- linewidth = 146.8 \mm
+ \context {
+ \Staff
+ fontSize = #-1
+ \override StaffSymbol #'staff-space = #0.8
+ }
+ \context {
+ \Score
+ \override SpacingSpanner #'spacing-increment = #0.96
+ }
+
+ indent = 5.6 \mm
+ linewidth = 146.8 \mm
}
\paper {
noclefs = {
s1
- \override Staff.Clef #'break-visibility = #(lambda (dir) (cons #t #t))
+ \override Staff.Clef #'break-visibility =
+ #all-invisible
}
setMargins = {
TRANSLATOR_DECLARATIONS (Breathing_sign_engraver);
protected:
- virtual bool try_music (Music *req);
+ virtual bool try_music (Music *event);
PRECOMPUTED_VIRTUAL void process_acknowledged ();
PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
private:
- Music *breathing_sign_req_;
+ Music *breathing_sign_event_;
Grob *breathing_sign_;
};
Breathing_sign_engraver::Breathing_sign_engraver ()
{
breathing_sign_ = 0;
- breathing_sign_req_ = 0;
+ breathing_sign_event_ = 0;
}
bool
Breathing_sign_engraver::try_music (Music *r)
{
- breathing_sign_req_ = r;
+ breathing_sign_event_ = r;
return true;
}
void
Breathing_sign_engraver::process_acknowledged ()
{
- if (breathing_sign_req_ && ! breathing_sign_)
+ if (breathing_sign_event_ && ! breathing_sign_)
{
- breathing_sign_ = make_item ("BreathingSign", breathing_sign_req_->self_scm ());
- breathing_sign_req_ = 0;
+ breathing_sign_ = make_item ("BreathingSign", breathing_sign_event_->self_scm ());
+ breathing_sign_event_ = 0;
}
}
Breathing_sign_engraver::stop_translation_timestep ()
{
breathing_sign_ = 0;
- breathing_sign_req_ = 0;
+ breathing_sign_event_ = 0;
}
#include "translator.icc"
longer than what's specified, than what is left to do and it should
not cross barlines.
- We copy the reqs into scratch note reqs, to make sure that we get
+ We copy the events into scratch note events, to make sure that we get
all durations exactly right.
*/
Link_array<Grob> ties_;
Link_array<Item> dots_;
- Link_array<Music> note_reqs_;
- Link_array<Music> scratch_note_reqs_;
+ Link_array<Music> note_events_;
+ Link_array<Music> scratch_note_events_;
Moment note_end_mom_;
bool is_first_;
protected:
virtual void initialize ();
PRECOMPUTED_VIRTUAL void start_translation_timestep ();
- virtual bool try_music (Music *req);
+ virtual bool try_music (Music *event);
PRECOMPUTED_VIRTUAL void process_music ();
PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
};
{
if (m->is_mus_type ("note-event"))
{
- note_reqs_.push (m);
+ note_events_.push (m);
is_first_ = true;
Moment musiclen = m->get_length ();
}
else if (m->is_mus_type ("busy-playing-event"))
{
- return note_reqs_.size () && is_first_;
+ return note_events_.size () && is_first_;
}
return false;
}
else
{
- orig = unsmob_duration (note_reqs_[0]->get_property ("duration"));
+ orig = unsmob_duration (note_events_[0]->get_property ("duration"));
note_dur = *orig;
}
Moment nb = next_barline_moment ();
if (orig && note_dur.get_length () != orig->get_length ())
{
- if (!scratch_note_reqs_.size ())
- for (int i = 0; i < note_reqs_.size (); i++)
+ if (!scratch_note_events_.size ())
+ for (int i = 0; i < note_events_.size (); i++)
{
- Music *m = note_reqs_[i]->clone ();
- scratch_note_reqs_.push (m);
+ Music *m = note_events_[i]->clone ();
+ scratch_note_events_.push (m);
}
}
for (int i = 0;
- left_to_do_ && i < note_reqs_.size (); i++)
+ left_to_do_ && i < note_events_.size (); i++)
{
- Music *req = note_reqs_[i];
- if (scratch_note_reqs_.size ())
+ Music *event = note_events_[i];
+ if (scratch_note_events_.size ())
{
- req = scratch_note_reqs_[i];
- SCM pits = note_reqs_[i]->get_property ("pitch");
- req->set_property ("pitch", pits);
+ event = scratch_note_events_[i];
+ SCM pits = note_events_[i]->get_property ("pitch");
+ event->set_property ("pitch", pits);
}
- req->set_property ("duration", note_dur.smobbed_copy ());
+ event->set_property ("duration", note_dur.smobbed_copy ());
- Item *note = make_item ("NoteHead", req->self_scm ());
+ Item *note = make_item ("NoteHead", event->self_scm ());
note->set_property ("duration-log",
scm_int2num (note_dur.duration_log ()));
dots_.push (d);
}
- Pitch *pit = unsmob_pitch (req->get_property ("pitch"));
+ Pitch *pit = unsmob_pitch (event->get_property ("pitch"));
int pos = pit->steps ();
SCM c0 = get_property ("middleCPosition");
dots_.clear ();
- for (int i = scratch_note_reqs_.size (); i--;)
+ for (int i = scratch_note_events_.size (); i--;)
{
- scm_gc_unprotect_object (scratch_note_reqs_[i]->self_scm ());
+ scm_gc_unprotect_object (scratch_note_events_[i]->self_scm ());
}
- scratch_note_reqs_.clear ();
+ scratch_note_events_.clear ();
}
void
Moment now = now_mom ();
if (note_end_mom_.main_part_ <= now.main_part_)
{
- note_reqs_.clear ();
+ note_events_.clear ();
prev_notes_.clear ();
}
}
Music *script_ev_;
Music *current_cresc_ev_;
- Drul_array<Music *> accepted_spanreqs_drul_;
+ Drul_array<Music *> accepted_spanevents_drul_;
Link_array<Note_column> pending_columns_;
Link_array<Grob> pending_elements_;
protected:
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
- virtual bool try_music (Music *req);
+ virtual bool try_music (Music *event);
PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
PRECOMPUTED_VIRTUAL void process_music ();
};
cresc_ = 0;
script_ev_ = 0;
- accepted_spanreqs_drul_[START] = 0;
- accepted_spanreqs_drul_[STOP] = 0;
+ accepted_spanevents_drul_[START] = 0;
+ accepted_spanevents_drul_[STOP] = 0;
}
bool
{
Direction d = to_dir (m->get_property ("span-direction"));
- accepted_spanreqs_drul_[d] = m;
+ accepted_spanevents_drul_[d] = m;
if (current_cresc_ev_ && d == START)
- accepted_spanreqs_drul_[STOP] = m;
+ accepted_spanevents_drul_[STOP] = m;
return true;
}
return false;
void
Dynamic_engraver::process_music ()
{
- if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_ev_)
+ if (accepted_spanevents_drul_[START] || accepted_spanevents_drul_[STOP] || script_ev_)
{
if (!line_spanner_)
{
- Music *rq = accepted_spanreqs_drul_[START];
+ Music *rq = accepted_spanevents_drul_[START];
line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm () : SCM_EOL);
if (script_ev_)
Axis_group_interface::add_element (line_spanner_, script_);
}
- Music *stop_ev = accepted_spanreqs_drul_ [STOP]
- ? accepted_spanreqs_drul_[STOP] : script_ev_;
+ Music *stop_ev = accepted_spanevents_drul_ [STOP]
+ ? accepted_spanevents_drul_[STOP] : script_ev_;
- if (accepted_spanreqs_drul_[STOP] || script_ev_)
+ if (accepted_spanevents_drul_[STOP] || script_ev_)
{
/*
finish side position alignment if the (de)cresc ends here, and
cresc_ = 0;
current_cresc_ev_ = 0;
}
- else if (accepted_spanreqs_drul_[STOP])
+ else if (accepted_spanevents_drul_[STOP])
{
- accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
+ accepted_spanevents_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
stop_ev = 0;
}
}
- if (accepted_spanreqs_drul_[START])
+ if (accepted_spanevents_drul_[START])
{
if (current_cresc_ev_)
{
if (current_cresc_ev_->is_mus_type ("decrescendo-event"))
msg = _ ("already have a crescendo");
- accepted_spanreqs_drul_[START]->origin ()->warning (msg);
+ accepted_spanevents_drul_[START]->origin ()->warning (msg);
current_cresc_ev_->origin ()->warning (_ ("cresc starts here"));
}
else
{
- current_cresc_ev_ = accepted_spanreqs_drul_[START];
+ current_cresc_ev_ = accepted_spanevents_drul_[START];
if (Direction d = to_dir (current_cresc_ev_->get_property ("direction")))
set_grob_direction (line_spanner_, d);
SCM s = get_property ((start_type + "Spanner").to_str0 ());
if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
{
- cresc_ = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ());
+ cresc_ = make_spanner ("Hairpin", accepted_spanevents_drul_[START]->self_scm ());
if (finished_cresc_)
{
Pointer_group_interface::add_grob (finished_cresc_,
*/
else
{
- cresc_ = make_spanner ("DynamicTextSpanner", accepted_spanreqs_drul_[START]->self_scm ());
+ cresc_ = make_spanner ("DynamicTextSpanner", accepted_spanevents_drul_[START]->self_scm ());
cresc_->set_property ("style", s);
context ()->set_property ((start_type
+ "Spanner").to_str0 (), SCM_EOL);
}
script_ev_ = 0;
- accepted_spanreqs_drul_[START] = 0;
- accepted_spanreqs_drul_[STOP] = 0;
+ accepted_spanevents_drul_[START] = 0;
+ accepted_spanevents_drul_[STOP] = 0;
}
void
TRANSLATOR_DECLARATIONS (Ligature_engraver);
private:
- Drul_array<Music *> reqs_drul_;
+ Drul_array<Music *> events_drul_;
Spanner *ligature_;
Array<Grob_info> primitives_;
Spanner *finished_ligature_;
Array<Grob_info> finished_primitives_;
- Music *prev_start_req_;
+ Music *prev_start_event_;
// moment where ligature started.
Moment ligature_start_mom_;
/*
* This abstract class provides the general framework for ligatures of
- * any kind. It cares for handling start/stop ligatures requests and
+ * any kind. It cares for handling start/stop ligatures events and
* collecting all noteheads inbetween, but delegates creation of a
* ligature spanner for each start/stop pair and typesetting of the
* ligature spanner to a concrete subclass.
{
ligature_ = 0;
finished_ligature_ = 0;
- reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
- prev_start_req_ = 0;
+ events_drul_[LEFT] = events_drul_[RIGHT] = 0;
+ prev_start_event_ = 0;
last_bound_ = 0;
brew_ligature_primitive_proc = SCM_EOL;
}
if (m->is_mus_type ("ligature-event"))
{
Direction d = to_dir (m->get_property ("span-direction"));
- reqs_drul_[d] = m;
+ events_drul_[d] = m;
return true;
}
return false;
void
Ligature_engraver::process_music ()
{
- if (reqs_drul_[STOP])
+ if (events_drul_[STOP])
{
if (!ligature_)
{
- reqs_drul_[STOP]->origin ()->warning (_ ("can't find start of ligature"));
+ events_drul_[STOP]->origin ()->warning (_ ("can't find start of ligature"));
return;
}
if (!last_bound_)
{
- reqs_drul_[STOP]->origin ()->warning (_ ("no right bound"));
+ events_drul_[STOP]->origin ()->warning (_ ("no right bound"));
}
else
{
ligature_->set_bound (RIGHT, last_bound_);
}
- prev_start_req_ = 0;
+ prev_start_event_ = 0;
finished_primitives_ = primitives_;
finished_ligature_ = ligature_;
primitives_.clear ();
get_score_engraver ()->forbid_breaks ();
}
- if (reqs_drul_[START])
+ if (events_drul_[START])
{
if (ligature_)
{
- reqs_drul_[START]->origin ()->warning (_ ("already have a ligature"));
+ events_drul_[START]->origin ()->warning (_ ("already have a ligature"));
return;
}
- prev_start_req_ = reqs_drul_[START];
+ prev_start_event_ = events_drul_[START];
ligature_ = create_ligature_spanner ();
brew_ligature_primitive_proc
= ligature_->get_property ("ligature-primitive-callback");
Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
if (!bound)
{
- reqs_drul_[START]->origin ()->warning (_ ("no left bound"));
+ events_drul_[START]->origin ()->warning (_ ("no left bound"));
}
else
{
ligature_start_mom_ = now_mom ();
// TODO: dump cause into make_item/spanner.
- // announce_grob (ligature_, reqs_drul_[START]->self_scm ());
+ // announce_grob (ligature_, events_drul_[START]->self_scm ());
override_stencil_callback ();
}
}
finished_ligature_ = 0;
}
- reqs_drul_[START] = 0;
- reqs_drul_[STOP] = 0;
+ events_drul_[START] = 0;
+ events_drul_[STOP] = 0;
}
void
}
if (ligature_)
{
- prev_start_req_->origin ()->warning (_ ("unterminated ligature"));
+ prev_start_event_->origin ()->warning (_ ("unterminated ligature"));
ligature_->suicide ();
}
}
if (Rest::has_interface (info.grob ()))
{
info.music_cause ()->origin ()->warning (_ ("ignoring rest: ligature may not contain rest"));
- prev_start_req_->origin ()->warning (_ ("ligature was started here"));
+ prev_start_event_->origin ()->warning (_ ("ligature was started here"));
// TODO: maybe better should stop ligature here rather than
// ignoring the rest?
}
TRANSLATOR_DECLARATIONS (Lyric_performer);
protected:
- virtual bool try_music (Music *req);
+ virtual bool try_music (Music *event);
PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
virtual void create_audio_elements ();
private:
- Link_array<Music> lreqs_;
+ Link_array<Music> events_;
Audio_text *audio_;
};
Lyric_performer::create_audio_elements ()
{
// FIXME: won't work with fancy lyrics
- if (lreqs_.size ()
- && scm_is_string (lreqs_[0]->get_property ("text"))
- && ly_scm2string (lreqs_[0]->get_property ("text")).length ())
+ if (events_.size ()
+ && scm_is_string (events_[0]->get_property ("text"))
+ && ly_scm2string (events_[0]->get_property ("text")).length ())
{
audio_ = new Audio_text (Audio_text::LYRIC,
- ly_scm2string (lreqs_[0]->get_property ("text")));
- Audio_element_info info (audio_, lreqs_[0]);
+ ly_scm2string (events_[0]->get_property ("text")));
+ Audio_element_info info (audio_, events_[0]);
announce_element (info);
}
- lreqs_.clear ();
+ events_.clear ();
}
void
play_element (audio_);
audio_ = 0;
}
- lreqs_.clear ();
+ events_.clear ();
}
bool
-Lyric_performer::try_music (Music *req)
+Lyric_performer::try_music (Music *event)
{
- if (req->is_mus_type ("lyric-event"))
+ if (event->is_mus_type ("lyric-event"))
{
- lreqs_.push (req);
+ events_.push (event);
return true;
}
return false;
}
bool
-Multi_measure_rest_engraver::try_music (Music *req)
+Multi_measure_rest_engraver::try_music (Music *event)
{
- if (req->is_mus_type ("multi-measure-rest-event"))
+ if (event->is_mus_type ("multi-measure-rest-event"))
{
- rest_ev_ = req;
+ rest_ev_ = event;
stop_moment_ = now_mom () + rest_ev_->get_length ();
return true;
}
- else if (req->is_mus_type ("multi-measure-text-event"))
+ else if (event->is_mus_type ("multi-measure-text-event"))
{
- text_events_.push (req);
+ text_events_.push (event);
return true;
}
return false;
#include "axis-group-interface.hh"
#include "warn.hh"
+#include "translator.icc"
Paper_column_engraver::Paper_column_engraver ()
}
first_ = false;
+ break_event_ = 0;
}
void
-#include "translator.icc"
ADD_TRANSLATOR (Paper_column_engraver,
/* descr */ "Takes care of generating columns."
struct Pedal_info
{
char const *name_;
- Music *start_req_;
- Drul_array<Music *> req_drul_;
+ Music *start_event_;
+ Drul_array<Music *> event_drul_;
};
public:
do
{
p->name_ = *np;
- p->req_drul_[START] = 0;
- p->req_drul_[STOP] = 0;
- p->start_req_ = 0;
+ p->event_drul_[START] = 0;
+ p->event_drul_[STOP] = 0;
+ p->start_event_ = 0;
p++;
}
for (Pedal_info *p = info_alist_; p && p->name_; p++)
{
- if (p->req_drul_[STOP])
+ if (p->event_drul_[STOP])
{
- if (!p->start_req_)
+ if (!p->start_event_)
{
- p->req_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
+ p->event_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
}
else
{
a->dir_ = STOP;
audios_.push (a);
}
- p->start_req_ = 0;
+ p->start_event_ = 0;
}
- if (p->req_drul_[START])
+ if (p->event_drul_[START])
{
- p->start_req_ = p->req_drul_[START];
+ p->start_event_ = p->event_drul_[START];
Audio_piano_pedal *a = new Audio_piano_pedal;
a->type_string_ = String (p->name_);
a->dir_ = START;
audios_.push (a);
}
- p->req_drul_[START] = 0;
- p->req_drul_[STOP] = 0;
+ p->event_drul_[START] = 0;
+ p->event_drul_[STOP] = 0;
}
}
{
for (Pedal_info *p = info_alist_; p && p->name_; p++)
{
- p->req_drul_[STOP] = 0;
- p->req_drul_[START] = 0;
+ p->event_drul_[STOP] = 0;
+ p->event_drul_[START] = 0;
}
}
scm_str2symbol (nm.to_str0 ())))
{
Direction d = to_dir (r->get_property ("span-direction"));
- p->req_drul_[d] = r;
+ p->event_drul_[d] = r;
return true;
}
}
protected:
- virtual bool try_music (Music *req);
+ virtual bool try_music (Music *event);
PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
virtual void create_audio_elements ();
private:
- Music *tempo_req_;
+ Music *tempo_event_;
Audio_tempo *audio_;
};
Tempo_performer::Tempo_performer ()
{
- tempo_req_ = 0;
+ tempo_event_ = 0;
audio_ = 0;
}
void
Tempo_performer::create_audio_elements ()
{
- if (tempo_req_)
+ if (tempo_event_)
{
- SCM met = tempo_req_->get_property ("metronome-count");
- Duration *d = unsmob_duration (tempo_req_->get_property ("tempo-unit"));
+ SCM met = tempo_event_->get_property ("metronome-count");
+ Duration *d = unsmob_duration (tempo_event_->get_property ("tempo-unit"));
Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (scm_to_int (met))).main_part_;
audio_ = new Audio_tempo (int (r));
- Audio_element_info info (audio_, tempo_req_);
+ Audio_element_info info (audio_, tempo_event_);
announce_element (info);
- tempo_req_ = 0;
+ tempo_event_ = 0;
}
}
}
bool
-Tempo_performer::try_music (Music *req)
+Tempo_performer::try_music (Music *event)
{
- if (tempo_req_)
+ if (tempo_event_)
return false;
- tempo_req_ = req;
+ tempo_event_ = event;
return true;
}
private:
Spanner *span_;
Spanner *finished_;
- Music *current_req_;
- Drul_array<Music *> req_drul_;
+ Music *current_event_;
+ Drul_array<Music *> event_drul_;
void typeset_all ();
};
Text_spanner_engraver::Text_spanner_engraver ()
{
finished_ = 0;
- current_req_ = 0;
+ current_event_ = 0;
span_ = 0;
- req_drul_[START] = 0;
- req_drul_[STOP] = 0;
+ event_drul_[START] = 0;
+ event_drul_[STOP] = 0;
}
bool
if (m->is_mus_type ("text-span-event"))
{
Direction d = to_dir (m->get_property ("span-direction"));
- req_drul_[d] = m;
+ event_drul_[d] = m;
return true;
}
void
Text_spanner_engraver::process_music ()
{
- if (req_drul_[STOP])
+ if (event_drul_[STOP])
{
if (!span_)
{
- req_drul_[STOP]->origin ()->warning (_ ("can't find start of text spanner"));
+ event_drul_[STOP]->origin ()->warning (_ ("can't find start of text spanner"));
}
else
{
finished_ = span_;
span_ = 0;
- current_req_ = 0;
+ current_event_ = 0;
}
}
- if (req_drul_[START])
+ if (event_drul_[START])
{
- if (current_req_)
+ if (current_event_)
{
- req_drul_[START]->origin ()->warning (_ ("already have a text spanner"));
+ event_drul_[START]->origin ()->warning (_ ("already have a text spanner"));
}
else
{
- current_req_ = req_drul_[START];
- span_ = make_spanner ("TextSpanner", req_drul_[START]->self_scm ());
+ current_event_ = event_drul_[START];
+ span_ = make_spanner ("TextSpanner", event_drul_[START]->self_scm ());
Side_position_interface::set_axis (span_, Y_AXIS);
- req_drul_[START] = 0;
+ event_drul_[START] = 0;
}
}
}
}
typeset_all ();
- req_drul_[START] = 0;
- req_drul_[STOP] = 0;
+ event_drul_[START] = 0;
+ event_drul_[STOP] = 0;
}
void
typeset_all ();
if (span_)
{
- current_req_->origin ()->warning (_ ("unterminated text spanner"));
+ current_event_->origin ()->warning (_ ("unterminated text spanner"));
span_->suicide ();
span_ = 0;
}