deficiency.
* lily/melisma-performer.cc (try_music): new file. Handle
melismata to help lyrics.
* lily/beam-performer.cc (try_music): new file. Handle beam events
to help lyrics.
* lily/score-performer.cc (one_time_step): reinstate
process_music().
* lily/performer.cc (process_music): add to interface.
* lily/performer-group-performer.cc (process_music): new function.
* lily/dot-column.cc (do_shifts): do collision resolution before
dot positioning.
2004-02-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * Documentation/user/refman.itely (More stanzas): document slur
+ deficiency.
+
+ * lily/melisma-performer.cc (try_music): new file. Handle
+ melismata to help lyrics.
+
+ * lily/beam-performer.cc (try_music): new file. Handle beam events
+ to help lyrics.
+
+ * lily/score-performer.cc (one_time_step): reinstate
+ process_music().
+
+
+ * lily/performer.cc (process_music): add to interface.
+
+ * lily/performer-group-performer.cc (process_music): new function.
+
+ * lily/dot-column.cc (do_shifts): do collision resolution before
+ dot positioning.
+
* scripts/lilypond-book.py (Snippet.output_print_filename): new
file, process printfilename option.
(Snippet.__init__): rewrite: do not use global variables h or
foo = \lyrics bar4
@end example
-
+The MIDI version of @code{\lyricsto} doesn't detect melismata caused
+by slurs.
@node Ambitus
class Beam_engraver : public Engraver
{
protected:
- Drul_array<Music*> evs_drul_;
+ Music * start_ev_;
Spanner *finished_beam_;
Spanner *beam_;
finished_beam_info_=0;
beam_info_ =0;
now_stop_ev_ = 0;
- evs_drul_[LEFT] = evs_drul_[RIGHT] =0;
+ start_ev_ = 0;
prev_start_ev_ =0;
}
if (d == START)
{
- evs_drul_[d] = m;
+ start_ev_ = m;
}
else if (d==STOP)
{
void
Beam_engraver::process_music ()
{
- if (evs_drul_[STOP])
- {
- prev_start_ev_ =0;
- finished_beam_ = beam_;
- finished_beam_info_ = beam_info_;
-
- beam_info_ =0;
- beam_ = 0;
- }
-
if (beam_ && !to_boolean (get_property ("allowBeamBreak")))
{
top_engraver ()->forbid_breaks ();
}
- if (evs_drul_[START])
+ if (start_ev_)
{
if (beam_)
{
- evs_drul_[START]->origin ()->warning (_ ("already have a beam"));
+ start_ev_->origin ()->warning (_ ("already have a beam"));
return;
}
set_melisma (true);
- prev_start_ev_ = evs_drul_[START];
+ prev_start_ev_ = start_ev_;
beam_ = make_spanner ("Beam");
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_info_ = new Beaming_info_list;
/* urg, must copy to Auto_beam_engraver too */
- announce_grob (beam_, evs_drul_[START]->self_scm());
+ announce_grob (beam_, start_ev_->self_scm());
}
}
void
Beam_engraver::start_translation_timestep ()
{
- evs_drul_ [START] =0;
- evs_drul_[STOP] = 0;
+ start_ev_ = 0;
if (beam_)
{
beam_ = 0;
beam_info_ = 0;
typeset_beam();
- set_melisma (false);
+ set_melisma (false);
}
}
--- /dev/null
+/*
+ beam-performer.cc -- implement Beam_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+ */
+
+#include "performer.hh"
+#include "event.hh"
+#include "audio-item.hh"
+#include "audio-column.hh"
+#include "global-translator.hh"
+#include "warn.hh"
+
+/**
+Convert evs to audio beams.
+*/
+class Beam_performer : public Performer {
+public:
+ TRANSLATOR_DECLARATIONS(Beam_performer);
+
+protected:
+ virtual bool try_music (Music *ev) ;
+ virtual void start_translation_timestep ();
+ virtual void process_music ();
+ void set_melisma (bool);
+private:
+ Music *start_ev_;
+ Music *now_stop_ev_;
+ bool beam_;
+};
+
+void
+Beam_performer::process_music ()
+{
+ if (now_stop_ev_)
+ {
+ beam_ = false;
+ }
+
+ if (start_ev_)
+ {
+ if (beam_)
+ {
+ start_ev_->origin ()->warning (_ ("already have a beam"));
+ return;
+ }
+
+ beam_ = true;
+ set_melisma (true);
+ }
+}
+
+
+void
+Beam_performer::set_melisma (bool ml)
+{
+ SCM b = get_property ("autoBeaming");
+ if (!to_boolean (b))
+ daddy_trans_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+}
+
+
+void
+Beam_performer::start_translation_timestep ()
+{
+ if (beam_)
+ {
+ set_melisma (true);
+ }
+
+ start_ev_ = 0;
+ now_stop_ev_ = 0;
+}
+
+
+
+bool
+Beam_performer::try_music (Music *m)
+{
+ if (m->is_mus_type ("beam-event"))
+ {
+ Direction d = to_dir (m->get_mus_property ("span-direction"));
+
+ if (d == START)
+ {
+ start_ev_ = m;
+ }
+ else if (d==STOP)
+ {
+ now_stop_ev_ = m;
+ }
+ return true;
+ }
+ return false;
+}
+
+ENTER_DESCRIPTION(Beam_performer,"","",
+ "beam-event","","","");
+
+Beam_performer::Beam_performer()
+{
+ beam_ = false;
+}
{
Link_array<Grob> dots =
Pointer_group_interface__extract_grobs (me, (Grob*)0, "dots");
+
+ { /*
+ Trigger note collision resolution first, since that may kill off
+ dots when merging.
+ */
+ Grob * c = 0;
+ for (int i = dots.size (); i-- ; )
+ {
+ Grob * n = dots[i]->get_parent (Y_AXIS);
+ if (c)
+ c = n->common_refpoint (c, X_AXIS);
+ else
+ c = n;
+ }
+ for (int i = dots.size (); i-- ; )
+ {
+ Grob * n = dots[i]->get_parent (Y_AXIS);
+ n->relative_coordinate (c , X_AXIS);
+ }
+ }
dots.sort (compare_position);
for (int i = dots.size (); i--;)
TRANSLATOR_DECLARATIONS(Performer_group_performer);
virtual void do_announces ();
+ virtual void process_music ();
virtual void announce_element (Audio_element_info);
protected:
Array<Audio_element_info> announce_infos_;
virtual void create_audio_elements ();
virtual int get_tempo () const;
virtual void play_element (Audio_element * elem );
+ virtual void process_music ();
};
Translator_group * daddy_trans_ ;
void removal_processing ();
- /**
- ask daddy for a feature
- */
Music_output_def *get_output_def () const;
SCM internal_get_property (SCM symbol) const;
*/
+/*
+ duplicated in melisma-performer
+ */
#include "engraver.hh"
#include "event.hh"
#include "grob.hh"
/**
Signal existence of melismas.
*/
-class Melisma_engraver:public Engraver
+class Melisma_engraver : public Engraver
{
public:
TRANSLATOR_DECLARATIONS(Melisma_engraver);
--- /dev/null
+
+/*
+ melisma-performer.cc -- implement Melisma_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+/*
+ copy of melisma-engraver - see there.
+ */
+#include "performer.hh"
+#include "event.hh"
+#include "grob.hh"
+#include "translator-group.hh"
+
+/**
+ Signal existence of melismas.
+ */
+class Melisma_performer : public Performer
+{
+public:
+ TRANSLATOR_DECLARATIONS(Melisma_performer);
+ bool try_music (Music *);
+};
+
+
+bool
+Melisma_performer::try_music (Music *)
+{
+ /*
+ This can only be melisma-playing-event.
+ */
+ return melisma_busy (this);
+}
+
+Melisma_performer::Melisma_performer()
+{
+}
+
+ENTER_DESCRIPTION(Melisma_performer,
+/* descr */ "This performer collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code. ",
+/* creats*/ "",
+/* accepts */ "melisma-playing-event",
+/* acks */ "",
+/* reads */ "melismaBusy melismaBusyProperties slurMelismaBusy tieMelismaBusy beamMelismaBusy",
+/* write */ "");
}
}
-Performer_group_performer::Performer_group_performer(){}
+Performer_group_performer::Performer_group_performer()
+{
+}
+
+/*
+ C & P from Engraver.
+
+ Should move into Translator ?
+ */
+void
+Performer_group_performer::process_music ()
+{
+ for (SCM p = get_simple_trans_list (); gh_pair_p (p); p =ly_cdr (p))
+ {
+ Translator * t = unsmob_translator (ly_car (p));
+ Performer * eng = dynamic_cast<Performer*> (t);
+
+ if (eng)
+ eng->process_music ();
+ }
+ for (SCM p = trans_group_list_; gh_pair_p (p); p =ly_cdr (p))
+ {
+ Translator * t = unsmob_translator (ly_car (p));
+ Performer*eng = dynamic_cast<Performer*> (t);
+ if (eng)
+ eng->process_music ();
+ }
+}
i.origin_trans_= this;
get_daddy_perf ()->announce_element (i);
}
+
+
+void
+Performer::process_music ()
+{
+
+}
void
Score_performer::one_time_step ()
{
- // fixme: put this back.
- // process_music ();
+ process_music ();
do_announces ();
stop_translation_timestep ();
check_removal ();
}
void
-Translator:: stop_translation_timestep ()
+Translator::stop_translation_timestep ()
{
}
\type "Performer_group_performer"
\name Voice
\consists "Note_performer"
+ \consists "Beam_performer"
+ \consists "Melisma_performer"
}
\translator {
\name Score
\alias Timing
+ melismaBusyProperties = #default-melisma-properties
instrument = #"bright acoustic"
\accepts Staff
\accepts DrumStaff
$(outdir)/%.texi: $(outdir)/%.tely
if [ -f $@ ]; then chmod a+w $@; fi
-# debugging:
-# set|egrep '(TEX|LILY)'
$(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
#
# DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE.
# for plain info doco: don't run lily
$(outdir)/%.nexi: %.tely
if [ -f $@ ]; then chmod a+w $@; fi
- time $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) --process='true' $<
+ $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) --process='true' $<
mv $(outdir)/$*.texinfo $@ 2>/dev/null || mv $(outdir)/$*.texi $@
chmod -w $@