test-baseline: test
+ if test -d .git ; then \
+ @$(if $(shell git diff), echo "commit before base lining" && false,true) ; \
+ fi
rm -rf input/regression/out-test-baseline
mv input/regression/out-test input/regression/out-test-baseline
Mats Bengtsson - Support Guru
John Mandereau - Translation Meister
+
CONTRIBUTORS
Rune Zedeler
Maximilian Albert
+
SPONSORS
Mike Amundsen
Trevor Bača
+
BUG HUNTERS/SUGGESTIONS
Alard de Boer
def text_record_string (self):
return '%-30f %-20s\n' % (self.distance (),
- self.name ())
+ self.name ()
+ + os.path.splitext (self.file_names[1])[1]
+ )
+
def calc_distance (self):
return 0.0
return self._distance
+ def source_file (self):
+ for ext in ('.ly', '.ly.txt'):
+ base = os.path.splitext (self.file_names[1])[0]
+ f = base + ext
+ if os.path.exists (f):
+ return f
+
+ return ''
def name (self):
base = os.path.basename (self.file_names[1])
base = os.path.splitext (base)[0]
-
base = hash_to_original_name.get (base, base)
base = os.path.splitext (base)[0]
return base
return 0.0
else:
return 100.0;
+
def get_content (self, f):
print 'reading', f
return s
+
+
class GitFileCompareLink (FileCompareLink):
def get_cell (self, oldnew):
str = self.contents[oldnew]
d = 1.0001 *options.threshold
return d
+
class TextFileCompareLink (FileCompareLink):
def calc_distance (self):
return d + orphan_distance
- def source_file (self):
- for ext in ('.ly', '.ly.txt'):
- if os.path.exists (self.base_names[1] + ext):
- return self.base_names[1] + ext
- return ''
-
+
+
def add_file_compare (self, f1, f2):
system_index = []
self.base_names = (os.path.normpath (base1),
os.path.normpath (base2))
- def note_original (match):
- hash_to_original_name[os.path.basename (self.base_names[1])] = match.group (1)
- return ''
-
- ## ugh: drop the .ly.txt
- for ext in ('.ly', '.ly.txt'):
- try:
- re.sub (r'\\sourcefilename "([^"]+)"',
- note_original, open (base1 + ext).read ())
- except IOError:
- pass
-
s1 = read_signature_file (f1)
s2 = read_signature_file (f2)
self.added = []
self.file_links = {}
+ def read_sources (self):
+
+ ## ugh: drop the .ly.txt
+ for (key, val) in self.file_links.items ():
+
+ def note_original (match, ln=val):
+ key = ln.name ()
+ hash_to_original_name[key] = match.group (1)
+ return ''
+
+ sf = val.source_file ()
+ if sf:
+ re.sub (r'\\sourcefilename "([^"]+)"',
+ note_original, open (sf).read ())
+ else:
+ print 'no source for', val
+
def compare_trees (self, dir1, dir2):
self.compare_directories (dir1, dir2)
self.compare_trees (d1, d2)
def compare_directories (self, dir1, dir2):
- for ext in ['signature', 'midi', 'log', 'profile', 'gittxt']:
+ for ext in ['signature',
+ 'midi',
+ 'log',
+ 'profile',
+ 'gittxt']:
(paired, m1, m2) = paired_files (dir1, dir2, '*.' + ext)
self.missing += [(dir1, m) for m in m1]
def compare_trees (dir1, dir2, dest_dir, threshold):
data = ComparisonData ()
data.compare_trees (dir1, dir2)
+ data.read_sources ()
+
+
data.print_results (threshold)
if os.path.isdir (dest_dir):
--- /dev/null
+\header
+{
+
+ texidoc = "Lyrics are ignored for aftergrace notes."
+
+}
+
+\version "2.11.13"
+\paper {
+ ragged-right = ##t
+}
+
+<<
+ \new Staff {
+ \new Voice = "myVoice" {
+ \afterGrace c''2 { e''32( } c''2)
+ }}
+ \new Lyrics \lyricsto "myVoice" \lyricmode { foo -- bar }
+>>
--- /dev/null
+
+\header {
+
+ texidoc = "If a page break is forced where it is forbidden,
+ a warning is printed."
+
+}
+
+\version "2.11.14"
+
+\new Staff {
+ c'1 \glissando
+ \pageBreak
+ d'1
+}
+
if (!to_boolean (me->get_property ("restore-first"))
&& !parens)
{
- Rational alteration
- = robust_scm2rational (me->get_property ("alteration"), 0);
- if (alteration == FLAT_ALTERATION)
+ SCM alist = me->get_property ("glyph-name-alist");
+ SCM alt = me->get_property ("alteration");
+ string glyph_name = robust_scm2string (ly_assoc_get (alt, alist, SCM_BOOL_F),
+ "");
+
+ if (glyph_name == "accidentals.flat"
+ || glyph_name == "accidentals.mirroredflat")
{
Box stem = b;
Box bulb = b;
we could make the stem thinner, but that places the flats
really close.
*/
- stem[X_AXIS][RIGHT] *= .5;
+ Direction bulb_dir =
+ glyph_name=="accidentals.mirroredflat" ? LEFT : RIGHT;
+ stem[X_AXIS][bulb_dir] = stem[X_AXIS].center ();
/*
To prevent vertical alignment for 6ths
boxes.push_back (bulb);
boxes.push_back (stem);
}
- else if (alteration == NATURAL_ALTERATION)
+ else if (glyph_name == "accidentals.natural")
{
Box lstem = b;
Box rstem = b;
durlog - 2);
stems_->push_back (stem);
last_add_mom_ = now;
- extend_mom_ = max (extend_mom_, now) + get_event_length (ev);
+ extend_mom_ = max (extend_mom_, now) + get_event_length (ev, now);
}
void
}
note_head_ = info.grob ();
- stop_moment_ = now_mom () + get_event_length (info.event_cause ());
+ stop_moment_ = now_mom () + get_event_length (info.event_cause (),
+ now_mom ());
}
Bend_engraver::Bend_engraver ()
note_events_.push_back (ev);
is_first_ = true;
- Moment musiclen = get_event_length (ev);
Moment now = now_mom ();
-
- if (now_mom ().grace_part_)
- {
- musiclen.grace_part_ = musiclen.main_part_;
- musiclen.main_part_ = Rational (0, 1);
- }
+ Moment musiclen = get_event_length (ev, now);
note_end_mom_ = max (note_end_mom_, (now + musiclen));
do_nothing_until_ = Rational (0, 0);
SCM melisma_properties = tr->get_property ("melismaBusyProperties");
bool busy = false;
- for (; scm_is_pair (melisma_properties);
+ for (; !busy && scm_is_pair (melisma_properties);
melisma_properties = scm_cdr (melisma_properties))
busy = busy || to_boolean (tr->internal_get_property (scm_car (melisma_properties)));
tie_event = ev;
}
- Moment len = get_event_length (n);
- if (now_mom ().grace_part_)
- {
- len.grace_part_ = len.main_part_;
- len.main_part_ = Rational (0);
- }
-
+ Moment len = get_event_length (n, now_mom ());
Audio_note *p = new Audio_note (*pit, len,
tie_event, Pitch (0, 0, 0));
Figured_bass_engraver::listen_bass_figure (Stream_event *ev)
{
new_event_found_ = true;
- Moment stop = now_mom () + get_event_length (ev);
+ Moment stop = now_mom () + get_event_length (ev, now_mom ());
stop_moment_ = max (stop_moment_, stop);
if (to_boolean (get_property ("useBassFigureExtenders")))
&& !gi.grob ()->internal_has_interface (ly_symbol2scm ("multi-measure-interface")))
{
Moment n = now_mom ();
- Moment l = get_event_length (ev);
+ Moment l = get_event_length (ev, n);
if (!l.to_bool ())
return;
- if (n.grace_part_)
- {
- l.grace_part_ = l.main_part_;
- l.main_part_ = 0;
- }
-
Moment end = n + l;
Grob_pq_entry e;
void add_translator (Translator *trans);
Translator *get_translator (SCM s);
+Moment get_event_length (Stream_event *s, Moment now);
Moment get_event_length (Stream_event *s);
DECLARE_UNSMOB (Translator, translator);
? scm_from_int (0)
: scm_cdar (s);
- SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
- if (!scm_is_string (glyph_name))
+ SCM glyph_name_scm = ly_assoc_get (alt, alist, SCM_BOOL_F);
+ if (!scm_is_string (glyph_name_scm))
{
me->warning (_f ("No glyph found for alteration: %s",
ly_scm2rational (alt).to_string ().c_str ()));
continue;
}
-
- Stencil acc (fm->find_by_name (ly_scm2string (glyph_name)));
+
+ string glyph_name = ly_scm2string (glyph_name_scm);
+
+ Stencil acc (fm->find_by_name (glyph_name));
if (acc.is_empty ())
me->warning (_ ("alteration not found"));
has vertical edges on both sides. A little padding is
needed to prevent collisions.
*/
- Real padding = 0.0;
- if (is_cancellation
+ Real padding = robust_scm2double (me->get_property ("padding"),
+ 0.0);
+ if (glyph_name == "accidentals.natural"
&& last_pos < pos + 2
&& last_pos > pos - 6)
- padding = 0.3;
+ padding += 0.3;
mol.add_at_edge (X_AXIS, LEFT, acc, padding);
last_pos = pos;
"alteration-alist "
"c0-position "
"glyph-name-alist "
+ "padding "
"style "
);
DECLARE_LISTENER (set_busy);
DECLARE_LISTENER (check_new_context);
- bool pending_grace_lyric_;
bool music_found_;
Context *lyrics_context_;
Context *music_context_;
SCM lyricsto_voice_name_;
Moment busy_moment_;
+ Moment pending_grace_moment_;
Music_iterator *lyric_iter_;
};
Lyric_combine_music_iterator::Lyric_combine_music_iterator ()
{
music_found_ = false;
- pending_grace_lyric_ = false;
+ pending_grace_moment_.set_infinite (1);
lyric_iter_ = 0;
music_context_ = 0;
lyrics_context_ = 0;
if ((e->in_event_class ("note-event") || e->in_event_class ("cluster-note-event"))
&& music_context_)
+
busy_moment_ = max (music_context_->now_mom (),
busy_moment_);
}
void
-Lyric_combine_music_iterator::process (Moment)
+Lyric_combine_music_iterator::process (Moment when)
{
+ (void) when;
+
/* see if associatedVoice has been changed */
Context *new_voice = find_voice ();
if (new_voice)
if (music_context_
- && (start_new_syllable () || pending_grace_lyric_)
+ && (start_new_syllable () ||
+ (busy_moment_ >= pending_grace_moment_))
&& lyric_iter_->ok ())
{
- if (music_context_->now_mom ().grace_part_)
+ Moment now = music_context_->now_mom ();
+ if (now.grace_part_)
{
- pending_grace_lyric_ = true;
+ pending_grace_moment_ = now;
+ pending_grace_moment_.grace_part_ = Rational (0);
return;
}
else
- pending_grace_lyric_ = false;
+ {
+ pending_grace_moment_.set_infinite (1);
+ }
Moment m = lyric_iter_->pending_moment ();
lyrics_context_->set_property (ly_symbol2scm ("associatedVoiceContext"),
/* FIXME: Should use ASSIGN_EVENT_ONCE. Can't do that yet because of
the kill-mm-rests hack in part-combine-iterator. */
rest_ev_ = ev;
- stop_moment_ = now_mom () + get_event_length (rest_ev_);
+ stop_moment_ = now_mom () + get_event_length (rest_ev_, now_mom ());
/*
if (ASSIGN_EVENT_ONCE (rest_ev_, ev))
stop_moment_ = now_mom () + get_event_length (rest_ev_);
tie_event = ev;
}
- Moment len = get_event_length (n);
- if (now_mom ().grace_part_)
- {
- len.grace_part_ = len.main_part_;
- len.main_part_ = Rational (0);
- }
+ Moment len = get_event_length (n, now_mom ());
Audio_note *p = new Audio_note (*pitp, len,
tie_event, transposing.negated ());
if (get_event_length (ev) < meas_length)
ASSIGN_EVENT_ONCE (slash_, ev);
-
+
/*
don't warn if nothing happens: this can happen if there are whole
measure repeats.
#include "output-def.hh"
#include "spanner.hh"
#include "staff-symbol-referencer.hh"
-#include "staff-symbol.hh"
#include "stem.hh"
#include "text-interface.hh"
#include "tie.hh"
#include "warn.hh"
#include "slur-scoring.hh"
#include "separation-item.hh"
-#include "script-interface.hh"
+#include "international.hh"
}
}
else
- e->warning ("Ignoring grob for slur. avoid-slur not set?");
+ e->warning (_f ("Ignoring grob for slur: %s. avoid-slur not set?",
+ e->name().c_str ()));
}
MAKE_SCHEME_CALLBACK (Slur, cross_staff, 1)
Stream_event *r = i.event_cause ();
if (r && r->in_event_class ("rhythmic-event"))
{
- Moment len = get_event_length (r);
+ Moment len = get_event_length (r, now_);
Rhythmic_tuple t (i, now_mom () + len);
now_durations_.push_back (t);
}
Stream_event *ev = playing_durations_[i].info_.event_cause ();
if (ev)
{
+ Moment now = now_mom ();
Moment m = get_event_length (ev);
shortest_playing = min (shortest_playing, m);
}
return 0;
}
+
Moment
get_event_length (Stream_event *e)
{
return Moment (0);
}
+Moment
+get_event_length (Stream_event *e, Moment now)
+{
+ Moment len = get_event_length (e);
+
+ if (now.grace_part_)
+ {
+ len.grace_part_ = len.main_part_;
+ len.main_part_ = Rational (0);
+ }
+ return len;
+}
+
/*
Helper, used through ASSIGN_EVENT_ONCE to throw warnings for
simultaneous events. The helper is only useful in listen_* methods