+2002-06-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/spacing-spanner.cc (find_shortest): make 1/8 configurable:
+ introduce base-shortest-duration
+
+ * lily/parser.yy (music_output_def_body): don't crash when \tempo
+ in unexpected \midi{} is found.
+
2002-06-13 Jan Nieuwenhuizen <janneke@gnu.org>
* stepmake/GNUmakefile.in: Don't install stepmake. This breaks
*/
int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
- dynamic_cast<Midi_def*> ($$)->set_tempo (d->length_mom (), m);
+ Midi_def * md = dynamic_cast<Midi_def*> ($$);
+ if (md)
+ md->set_tempo (d->length_mom (), m);
}
| music_output_def_body error {
static Real default_bar_spacing (Grob*,Grob*,Grob*,Moment);
static Real note_spacing (Grob*,Grob*,Grob*,Moment, bool*);
static Real get_duration_space (Grob*,Moment dur, Rational shortest, bool*);
- static Rational find_shortest (Link_array<Grob> const &);
+ static Rational find_shortest (Grob *, Link_array<Grob> const &);
static void breakable_column_spacing (Grob*, Item* l, Item *r, Moment);
static void find_loose_columns () {}
static void prune_loose_colunms (Grob*,Link_array<Grob> *cols, Rational);
set_explicit_neighbor_columns (all);
- Rational global_shortest = find_shortest (all);
+ Rational global_shortest = find_shortest (me, all);
prune_loose_colunms (me, &all, global_shortest);
set_implicit_neighbor_columns (all);
*/
Rational
-Spacing_spanner::find_shortest (Link_array<Grob> const &cols)
+Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
{
/*
ascending in duration
// printf ("duration %d/%d, count %d\n", durations[i].num (), durations[i].den (), counts[i]);
}
- /*
- TODO: 1/8 should be adjustable?
- */
+ SCM bsd = me->get_grob_property ("base-shortest-duration");
Rational d = Rational (1,8);
+ if (Moment *m = unsmob_moment (bsd))
+ d = m->main_part_;
+
if (max_idx >= 0)
d = d <? durations[max_idx] ;
(grob-property-description 'bar-size number? "size of a bar line.")
(grob-property-description 'bars list? "list of barline pointers.")
(grob-property-description 'bar-size-procedure procedure? "Procedure that computes the size of a bar line.")
+(grob-property-description 'base-shortest-duration moment?
+ "Spacing is based on the shortest notes in a piece. Normally, pieces are spaced as if notes at least as short as this are present.")
(grob-property-description 'baseline-skip number? "Baseline skip to use for multiple lines of text.")
(grob-property-description 'bass list? " musical-pitch, optional.")
(grob-property-description 'beam ly-grob? "pointer to the beam, if applicable.")