* input/regression/collision-dots-invert.ly: new file.
* lily/note-collision.cc (check_meshing_chords): add stem_to_stem
case.
* lily/new-lyric-combine-music-iterator.cc (process): let iterator
die if melody died too.
+2004-02-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * input/no-notation/midi-lyric-barcheck.ly: new file.
+
+ * input/regression/collision-dots-invert.ly: new file.
+
+ * lily/note-collision.cc (check_meshing_chords): add stem_to_stem
+ case.
+
+ * lily/new-lyric-combine-music-iterator.cc (process): let iterator
+ die if melody died too.
+
2004-02-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * Documentation/user/refman.itely (More stanzas): document slur
- deficiency.
+ * lily/source-file.cc (load_stdin): add trailing 0. Fixes problem
+ with reading from stdin.
+
+ * lily/slur-performer.cc (try_music): new file.
* lily/melisma-performer.cc (try_music): new file. Handle
melismata to help lyrics.
* lily/score-performer.cc (one_time_step): reinstate
process_music().
-
* lily/performer.cc (process_music): add to interface.
foo = \lyrics bar4
@end example
-The MIDI version of @code{\lyricsto} doesn't detect melismata caused
-by slurs.
-
@node Ambitus
@subsection Ambitus
--- /dev/null
+\header {
+
+ texidoc = "Lyrics in MIDI are aligned to ties and beams:
+this examples causes no bar checks in MIDI.
+TODO: slurs.
+"
+
+
+ }
+\score {
+
+ <<\notes\relative c'' \context Voice = A {
+ \autoBeamOff
+ c8[ c] c2.
+ c1~c4 c2. c1 }
+ \lyricsto "A" \lyrics\new LyricsVoice { bla bla | bla bla | bla }
+ >>
+ \paper {}
+ \midi {}
+ }
--- /dev/null
+\header {
+
+ texidoc = "When notes are colliding, the resolution depends on the
+ dots: notes with dots should go to the right, if there could be
+ confusion to which notes the dots belong."
+}
+\version "2.1.19"
+\score {
+ \notes \relative c'' {
+ << <a c>2\\ { <b d>4 <b d>4 } >>
+ << { <a c>2 } \\ { <b d>4. <b e>8 } >>
+ }
+ \paper { raggedright = ##t }
+}
#include "global-translator.hh"
#include "warn.hh"
-/**
-Convert evs to audio beams.
-*/
class Beam_performer : public Performer {
public:
TRANSLATOR_DECLARATIONS(Beam_performer);
if (start_ev_)
{
- if (beam_)
- {
- start_ev_->origin ()->warning (_ ("already have a beam"));
- return;
- }
-
beam_ = true;
set_melisma (true);
}
daddy_trans_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
-
void
Beam_performer::start_translation_timestep ()
{
start_ev_ = 0;
now_stop_ev_ = 0;
}
-
-
bool
Beam_performer::try_music (Music *m)
#include "note-head.hh"
#include "group-interface.hh"
-
bool
Lyric_extender::is_visible (Grob *gr)
{
Real h = sl * robust_scm2double (me->get_grob_property ("thickness"), 0);
Real pad = 2* h;
- if (!r->break_status_dir ())
+ if (r->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
right_point = right_point <? (r->extent (common, X_AXIS)[LEFT] - pad);
+ else if (Note_head::has_interface (r))
+ ;
else if (!last_line)
{
/*
String name = ly_scm2string (voice_name);
Translator_group *voice = find_context_below (t, "Voice", name);
if (!voice)
- get_music ()->origin ()->warning (_f ("Cannot find Voice: %s\n",
+ get_music ()->origin ()->warning (_f ("cannot find Voice: %s\n",
name.to_str0 ()));
else
music_context_ = voice;
if (!music_context_->daddy_trans_)
{
- music_context_ = 0;
+ /*
+ The melody has died.
+ We die too.
+ */
if (lyrics_context_)
lyrics_context_->unset_property (ly_symbol2scm ("associatedVoiceContext"));
+ lyric_iter_ = 0;
+ music_context_ = 0;
}
if (music_context_
}
}
+ full_collide = full_collide || (close_half_collide
+ && distant_half_collide);
+
Drul_array<Real> center_note_shifts;
center_note_shifts[LEFT] = 0.0;
center_note_shifts[RIGHT] = 0.0;
Real shift_amount = 1;
- bool touch = (ups[0] - dps.top () >= 0);
+ bool touch = (ups[0] >= dps.top ());
if (touch)
shift_amount *= -1;
/* For full collisions, the right hand head may obscure dots, so
make sure the dotted heads go to the right. */
- if (Rhythmic_head::dot_count (nu) > Rhythmic_head::dot_count (nd)
- && full_collide)
- shift_amount = 1;
-
+ bool stem_to_stem = false;
+ if (full_collide)
+ if (Rhythmic_head::dot_count (nu) > Rhythmic_head::dot_count (nd))
+ shift_amount = 1;
+ else if (Rhythmic_head::dot_count (nu) < Rhythmic_head::dot_count (nd))
+ stem_to_stem = true;
+
if (merge_possible)
{
shift_amount = 0;
}
/* TODO: these numbers are magic; should devise a set of grob props
to tune this behavior. */
+ else if (stem_to_stem)
+ shift_amount *= -0.65;
else if (close_half_collide && !touch)
shift_amount *= 0.52;
else if (distant_half_collide && !touch)
--- /dev/null
+/*
+ slur-performer.cc -- implement Slur_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"
+
+/*
+ this is C&P from beam_performer.
+ */
+
+class Slur_performer : public Performer {
+public:
+ TRANSLATOR_DECLARATIONS(Slur_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 slur_;
+};
+
+void
+Slur_performer::process_music ()
+{
+ if (now_stop_ev_)
+ {
+ slur_ = false;
+ }
+
+ if (start_ev_)
+ {
+ slur_ = true;
+ set_melisma (true);
+ }
+}
+
+
+void
+Slur_performer::set_melisma (bool ml)
+{
+ daddy_trans_->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+}
+
+void
+Slur_performer::start_translation_timestep ()
+{
+ if (slur_)
+ {
+ set_melisma (true);
+ }
+
+ start_ev_ = 0;
+ now_stop_ev_ = 0;
+}
+
+bool
+Slur_performer::try_music (Music *m)
+{
+ if (m->is_mus_type ("slur-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(Slur_performer,"","",
+ "slur-event","","","");
+
+Slur_performer::Slur_performer()
+{
+ slur_ = false;
+}
while ((c = fgetc (stdin)) != EOF)
chs.push (c);
+ chs.push (0);
length_ = chs.size ();
contents_str0_ = chs.remove_array ();
}
return a-b;
}
+/*
+ The positions, in ascending order.
+ */
Array<int>
Stem::note_head_positions (Grob *me)
{
(make-simultaneous-music (car lst))))
'Voice (number->string number))
- (voicify-list (cdr lst) (+ number 1))
+ (voicify-list (cdr lst) (1+ number))
))
)
(if
(and (equal? (ly:music-name m) "Simultaneous_music")
(reduce (lambda (x y ) (or x y)) #f (map music-separator? es)))
- (voicify-chord m)
+ (set! m (context-spec-music (voicify-chord m) 'Staff))
)
m