From 08363e0a506470051f3024f3e49922c0f6f435c7 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 01:20:52 +0000 Subject: [PATCH] lilypond-1.5.6 --- Documentation/regression-test.tely | 33 ++++++++++++-- input/regression/grace-bar-line.ly | 5 +-- input/regression/grace-nest1.ly | 12 ++++++ input/regression/grace-nest2.ly | 4 +- input/regression/grace-nest4.ly | 14 ++++++ input/regression/grace-nest5.ly | 7 +++ input/regression/grace-sync.ly | 6 +-- input/regression/number-staff-lines.ly | 2 - lily/auto-beam-engraver.cc | 6 +-- lily/chord-tremolo-iterator.cc | 2 +- lily/duration.cc | 2 +- lily/global-translator.cc | 1 - lily/grob.cc | 52 +++++++++++++---------- lily/include/moment.hh | 2 +- lily/include/sequential-music-iterator.hh | 8 ++-- lily/midi-def.cc | 2 +- lily/midi-item.cc | 3 +- lily/midi-walker.cc | 2 +- lily/moment.cc | 10 ++--- lily/music-sequence.cc | 10 ++++- lily/new-spacing-spanner.cc | 2 +- lily/parser.yy | 2 +- lily/percent-repeat-engraver.cc | 2 +- lily/performance.cc | 2 +- lily/score-performer.cc | 2 +- lily/spacing-spanner.cc | 2 +- lily/tempo-performer.cc | 2 +- lily/timing-translator.cc | 6 +-- ly/grace-init.ly | 8 ++-- scm/grob-property-description.scm | 7 ++- 30 files changed, 147 insertions(+), 71 deletions(-) create mode 100644 input/regression/grace-nest1.ly create mode 100644 input/regression/grace-nest4.ly create mode 100644 input/regression/grace-nest5.ly diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index e6114b6f1c..b91c7158a0 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -12,10 +12,10 @@ @section Introduction -This document tries give a brief overview of LilyPond features. When -the text correspond with the shown notation, we consider LilyPond -Officially BugFree (tm). This document is intended for finding bugs, -and documenting bugfixes. +This document presents a brief overview of LilyPond features. When the +text correspond with the shown notation, we consider LilyPond Officially +BugFree (tm). This document is intended for finding bugs, and +documenting bugfixes. @section Notes and rests @@ -79,8 +79,24 @@ and documenting bugfixes. @section Grace notes +Grace note do weird things with timing. Fragile. + + @lilypondfile[printfilename]{grace.ly} +@lilypondfile[printfilename]{grace-bar-line.ly} + +@lilypondfile[printfilename]{grace-nest2.ly} + +@lilypondfile[printfilename]{grace-nest3.ly} + +@lilypondfile[printfilename]{grace-nest4.ly} + +@lilypondfile[printfilename]{grace-nest.ly} + +@lilypondfile[printfilename]{grace-start.ly} + +@lilypondfile[printfilename]{grace-sync.ly} @section Beams @@ -179,6 +195,7 @@ and documenting bugfixes. @lilypondfile[printfilename]{rest-collision.ly} @lilypondfile[printfilename]{collisions.ly} + @lilypondfile[printfilename]{collision-dots.ly} @lilypondfile[printfilename]{number-staff-lines.ly} @@ -195,6 +212,14 @@ and documenting bugfixes. @lilypondfile[printfilename]{spacing-loose.ly} +@lilypondfile[printfilename]{spacing-accidentals.ly} + +@lilypondfile[printfilename]{spacing-accidentals-staff.ly} + +@lilypondfile[printfilename]{spacing-accidentals.ly} + +@lilypondfile[printfilename]{spacing-accidentals-staff.ly} + @lilypondfile[printfilename]{lyrics-bar.ly} @lilypondfile[printfilename]{non-empty-text.ly} diff --git a/input/regression/grace-bar-line.ly b/input/regression/grace-bar-line.ly index 69b0ceed92..176da92aa9 100644 --- a/input/regression/grace-bar-line.ly +++ b/input/regression/grace-bar-line.ly @@ -1,6 +1,5 @@ \header { - -texidoc = "Bar line should come before the grace note."; +texidoc = "Bar line should come before the grace note." } @@ -8,6 +7,6 @@ texidoc = "Bar line should come before the grace note."; \score {\notes \relative c' \context Staff { - f1 \ngrace { [a'16 f] } g1 } + f1 \grace { [a'16 f] } g1 } \paper { linewidth = -1. } } diff --git a/input/regression/grace-nest1.ly b/input/regression/grace-nest1.ly new file mode 100644 index 0000000000..71ca4b43e3 --- /dev/null +++ b/input/regression/grace-nest1.ly @@ -0,0 +1,12 @@ +\header { +texidoc = "grace code should not be confused by nested sequential musics, containing grace notes; practically speaking, this means that the end-bar and measure bar coincide in this example." + +} +\score{ +\notes + +{ c''2 { \grace b'16 c''2 } \bar "|." } + \paper { +} + } + diff --git a/input/regression/grace-nest2.ly b/input/regression/grace-nest2.ly index 5ab4e1e56c..fbd4c8989e 100644 --- a/input/regression/grace-nest2.ly +++ b/input/regression/grace-nest2.ly @@ -4,6 +4,6 @@ texidoc = "grace code should not be confused by nested sequential musics, contai } \score { \notes \context Voice { - { \grace b'4 c''2 } - \grace b'4 c''2 \bar "|." + { \grace b'8 c''2 } + \grace b'16 c''4 c''4 \bar "|." }} diff --git a/input/regression/grace-nest4.ly b/input/regression/grace-nest4.ly new file mode 100644 index 0000000000..416983ba1c --- /dev/null +++ b/input/regression/grace-nest4.ly @@ -0,0 +1,14 @@ +\header { +texidoc = "Another combination of grace note nesting." +} + +\score { \notes \context Voice { + + < + { \grace g32 f4 } + > + \grace c16 c2. \bar "|." +} +} + + diff --git a/input/regression/grace-nest5.ly b/input/regression/grace-nest5.ly new file mode 100644 index 0000000000..36e0290d14 --- /dev/null +++ b/input/regression/grace-nest5.ly @@ -0,0 +1,7 @@ + +\score +{ \notes { + s2 + \grace g e4 +} +} diff --git a/input/regression/grace-sync.ly b/input/regression/grace-sync.ly index 4ce8fa85b8..69efcd5df6 100644 --- a/input/regression/grace-sync.ly +++ b/input/regression/grace-sync.ly @@ -4,12 +4,12 @@ \score {\notes < \context Staff { c2 \grace c8 - c2 c4 } + c4 c4 } \context Staff = SB { c2 \clef bass \grace { [dis8 ( d8] } - ) c2 c4 } - \context Staff = SC { c2 c2 c4 } + ) c4 c4 } + \context Staff = SC { c2 c4 c4 \bar "|." } > \paper { linewidth = -1. } } diff --git a/input/regression/number-staff-lines.ly b/input/regression/number-staff-lines.ly index 8c05e30225..e522311a04 100644 --- a/input/regression/number-staff-lines.ly +++ b/input/regression/number-staff-lines.ly @@ -1,11 +1,9 @@ \version "1.3.146" \header{ - texidoc=" The number of stafflines of a staff can be set. Ledger lines both on note heads and rests are adjusted. Barlines also are adjusted. " - } \score { diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index fdd0f1e633..0f8bf698bd 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -76,7 +76,7 @@ Auto_beam_engraver::Auto_beam_engraver () { count_i_ = 0; stem_l_arr_p_ = 0; - shortest_mom_ = Moment (1, 8); + shortest_mom_ = Moment (Rational (1, 8)); finished_beam_p_ = 0; finished_grouping_p_ = 0; grouping_p_ = 0; @@ -265,7 +265,7 @@ Auto_beam_engraver::junk_beam () delete grouping_p_; grouping_p_ = 0; - shortest_mom_ = Moment (1, 8); + shortest_mom_ = Moment (Rational (1, 8)); } void @@ -286,7 +286,7 @@ Auto_beam_engraver::end_beam () grouping_p_ = 0; } - shortest_mom_ = Moment (1, 8); + shortest_mom_ = Moment (Rational (1, 8)); } void diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 1cfbc590d3..2556751e84 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -20,7 +20,7 @@ void Chord_tremolo_iterator::construct_children () { Repeated_music * rep = dynamic_cast (music_l ()); - factor_ = Moment (1, rep->repeat_count ()); + factor_ = Moment (Rational(1, rep->repeat_count ())); child_iter_p_ = get_iterator_p (rep->body ()); } diff --git a/lily/duration.cc b/lily/duration.cc index 38cb80f6ca..1a0273850d 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -71,7 +71,7 @@ String Duration::str () const { String s = to_str (durlog_i_) + to_str ('.', dots_i_); - if (factor_ != Moment (1,1)) + if (factor_ != Moment (Rational (1,1))) { s += "*" + factor_.str (); } diff --git a/lily/global-translator.cc b/lily/global-translator.cc index f7848d72a2..4e4208bd82 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -86,7 +86,6 @@ Global_translator::run_iterator_on_me (Music_iterator * iter) if (iter-> ok ()) prev_mom_ = now_mom_ = iter->pending_moment (); - bool first = true; while (iter->ok () || moments_left_i ()) { diff --git a/lily/grob.cc b/lily/grob.cc index abbe22874b..0f233e6136 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -56,32 +56,40 @@ Grob::Grob (SCM basicprops) smobify_self (); + /* + TODO: + + destill this into a function, so we can re-init the immutable + properties with a new BASICPROPS value after creation. Convenient + eg. when using \override with StaffSymbol. */ + char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"}; char const*enames[] = {"X-extent-callback", "Y-extent-callback"}; - for (int a = X_AXIS; a <= Y_AXIS; a++){ - SCM l = get_grob_property (onames[a]); - - if (scm_ilength (l) >=0) - { - dim_cache_[a].offset_callbacks_ = l; - dim_cache_[a].offsets_left_ = scm_ilength (l); - } - else - { - programming_error ("[XY]-offset-callbacks must be a list"); - } - - SCM cb = get_grob_property (enames[a]); - - /* - Should change default to be empty? - */ - if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb)) - cb = molecule_extent_proc; + for (int a = X_AXIS; a <= Y_AXIS; a++) + { + SCM l = get_grob_property (onames[a]); + + if (scm_ilength (l) >=0) + { + dim_cache_[a].offset_callbacks_ = l; + dim_cache_[a].offsets_left_ = scm_ilength (l); + } + else + { + programming_error ("[XY]-offset-callbacks must be a list"); + } + + SCM cb = get_grob_property (enames[a]); + + /* + Should change default to be empty? + */ + if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb)) + cb = molecule_extent_proc; - dim_cache_[a].dimension_ = cb; - } + dim_cache_[a].dimension_ = cb; + } SCM meta = get_grob_property ("meta"); SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta); diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 6881b933da..4993b7691f 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -23,8 +23,8 @@ class Moment public: Moment (); Moment (int m); - Moment (int m, int n); + Moment (Rational, Rational); Moment (Rational m); Moment operator - () const; diff --git a/lily/include/sequential-music-iterator.hh b/lily/include/sequential-music-iterator.hh index fcedb517f7..37cfbe34be 100644 --- a/lily/include/sequential-music-iterator.hh +++ b/lily/include/sequential-music-iterator.hh @@ -35,13 +35,13 @@ by initting here_mom_ with Music::start_music (); no fixups are needed. */ -struct Grace_skip +struct Grace_fixup { Moment start_; - Rational length_; + Moment length_; Rational grace_start_; - Grace_skip *next_; + Grace_fixup *next_; }; /** Sequential_music iteration: walk each element in turn, and @@ -51,7 +51,7 @@ struct Grace_skip class Sequential_music_iterator : public Music_iterator { public: - Grace_skip * grace_skips_; + Grace_fixup * grace_fixups_; VIRTUAL_COPY_CONS (Music_iterator); static SCM constructor_cxx_function; diff --git a/lily/midi-def.cc b/lily/midi-def.cc index 6f3a2cd642..40a2d065b3 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -16,7 +16,7 @@ Midi_def::Midi_def () { // ugh - set_tempo (Moment (1, 4), 60); + set_tempo (Moment (Rational (1, 4)), 60); } int diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 11f6bd559f..baf6e9ec3c 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -228,7 +228,8 @@ Midi_note::length_mom () const { Moment m = audio_l_->length_mom_; #if 0 - if (m < Moment (1, 1000)) + //junkme? + if (m < Moment (Rational (1, 1000))) { warning (_ ("silly duration")); m = 1; diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 17548174b4..6a568b43fc 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -45,7 +45,7 @@ Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l) Midi_walker::~Midi_walker () { // ugh - do_stop_notes (last_mom_ + Moment (10, 1)); + do_stop_notes (last_mom_ + Moment (Rational (10, 1))); } /** diff --git a/lily/moment.cc b/lily/moment.cc index 2f98bfd2ea..e75b6880f6 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -51,11 +51,11 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) SCM make_rational (SCM n, SCM d) { - Moment m (1,1); + Moment m (Rational (1,1)); if (SCM_INUMP (n) && SCM_INUMP (d)) { - m = Moment (gh_scm2int (n), gh_scm2int (d)); + m = Moment (Rational (gh_scm2int (n), gh_scm2int (d))); } else { @@ -112,10 +112,10 @@ Moment::Moment (int m) grace_part_ = Rational( 0); } -Moment::Moment (int m, int n) +Moment::Moment (Rational m, Rational g) { - main_part_ = Rational (m,n); - grace_part_ = Rational (0); + main_part_ = m; + grace_part_ = g; } Moment::Moment (Rational m) diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 17da5f4674..a8e9e76fa5 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -85,6 +85,8 @@ Music_sequence::cumulative_length () const last_len.grace_part_ = Rational (0); cumulative += last_len; + + cumulative += - first_start (); return cumulative; } @@ -101,8 +103,14 @@ Music_sequence::maximum_length () const { Moment dur = 0; for (SCM s = music_list (); gh_pair_p (s); s = gh_cdr (s)) - dur = dur >? unsmob_music (gh_car (s))->length_mom (); + { + Music * m = unsmob_music (gh_car (s)); + Moment l = m->length_mom () + m->start_mom (); + dur = dur >? l; + } + dur -= minimum_start (); + return dur; } int diff --git a/lily/new-spacing-spanner.cc b/lily/new-spacing-spanner.cc index e67af0ea08..b67c373fcb 100644 --- a/lily/new-spacing-spanner.cc +++ b/lily/new-spacing-spanner.cc @@ -146,7 +146,7 @@ cout << "params for cols " << Paper_column::rank_i (l) << " " << Paper_column::r UGH: KLUDGE! */ - // if (delta_t > Moment (1,32)) + // if (delta_t > Moment (Rational (1,32))) hinterfleisch += stem_dir_correction (me, l, r); } diff --git a/lily/parser.yy b/lily/parser.yy index 5019a8d8a2..c732454e53 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -872,7 +872,7 @@ Composite_music: scm_gc_unprotect_object (mp->self_scm ()); $$->set_mus_property ("numerator", gh_int2scm (n)); $$->set_mus_property ("denominator", gh_int2scm (d)); - $$->compress (Moment (n,d)); + $$->compress (Moment (Rational (n,d))); } | Repeated_music { $$ = $1; } diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc index 0082971d9b..193a350c6c 100644 --- a/lily/percent-repeat-engraver.cc +++ b/lily/percent-repeat-engraver.cc @@ -103,7 +103,7 @@ Percent_repeat_engraver::try_music (Music * m) meas_len = *unsmob_moment (m); if (body_length_ < meas_len && - meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (0,0)) + meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (Rational (0,0))) repeat_sign_type_ = BEAT; else if (meas_len == body_length_) repeat_sign_type_ = MEASURE; diff --git a/lily/performance.cc b/lily/performance.cc index 55122e302a..f77674fe55 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -123,7 +123,7 @@ Performance::output_header_track (Midi_stream& midi_stream) midi_track.add (Moment (0), &track_name); // Some sequencers read track 0 last. - // Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (1, 4))); + // Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (Rational (1, 4)))); // Midi_tempo tempo (&tempo_a); // midi_track.add (Moment (0), &tempo); diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 63af656abe..b1267acdce 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -83,7 +83,7 @@ Score_performer::start () int Score_performer::get_tempo_i () const { - return performance_p_->midi_l_->get_tempo_i (Moment (1, 4)); + return performance_p_->midi_l_->get_tempo_i (Moment (Rational (1, 4))); } void diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index e5a519f1ea..472fa6732b 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -478,7 +478,7 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, UGH: KLUDGE! */ - if (delta_t > Moment (1,32)) + if (delta_t > Moment (Rational (1,32))) dist += stem_dir_correction (me, lc,rc); diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index f24dd0f8aa..97be2fd709 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -51,7 +51,7 @@ Tempo_performer::create_audio_elements () SCM met = tempo_req_l_->get_mus_property ("metronome-count"); Duration *d = unsmob_duration (tempo_req_l_->get_mus_property ("duration")); - Rational r = (d->length_mom () / Moment (1, 4) * Moment (gh_scm2int (met))).main_part_; + Rational r = (d->length_mom () / Moment (Rational (1, 4)) * Moment (gh_scm2int (met))).main_part_; audio_p_ = new Audio_tempo (int (r)); diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 5548a249d8..7c05a7d14b 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -90,9 +90,9 @@ Timing_translator::initialize () daddy_trans_l_->set_property ("timeSignatureFraction", gh_cons (gh_int2scm (4), gh_int2scm (4))); - daddy_trans_l_->set_property ("measurePosition", Moment (0).smobbed_copy ()); - daddy_trans_l_->set_property ("measureLength", Moment (1).smobbed_copy ()); - daddy_trans_l_->set_property ("beatLength", Moment (1,4).smobbed_copy ()); + daddy_trans_l_->set_property ("measurePosition", Moment (Rational (0)).smobbed_copy ()); + daddy_trans_l_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ()); + daddy_trans_l_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ()); } Rational diff --git a/ly/grace-init.ly b/ly/grace-init.ly index b9a895cdc4..691498d1bd 100644 --- a/ly/grace-init.ly +++ b/ly/grace-init.ly @@ -9,20 +9,20 @@ startGraceMusic = { \property Voice.Stem \override #'lengths = #(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0)) \property Voice.Stem \override #'beamed-lengths = - #(map (lambda (x) (* 1.25 x)) '(0.0 2.5 2.0 1.5)) + #(map (lambda (x) (* 0.8 x)) '(0.0 2.5 2.0 1.5)) \property Voice.Stem \override #'beamed-minimum-lengths = - #(map (lambda (x) (* 1.25 x)) '(0.0 1.5 1.25 1.0)) + #(map (lambda (x) (* 0.8 x)) '(0.0 1.5 1.25 1.0)) \property Voice.Stem \override #'no-stem-extend = ##t \property Voice.Stem \override #'flag-style = #"grace" \property Voice.Beam \override #'space-function = #grace-beam-space-function - \property Voice.Beam \override #'thickness = #0.3 + \property Voice.Beam \override #'thickness = #0.384 % Can't use Staff.fontSize, since time sigs, keys sigs, etc. will % be smaller as well. \property Voice.fontSize = #-2 - \property Staff.LocalKeyItem \override #'font-relative-size = #-2 + \property Staff.Accidentals \override #'font-relative-size = #-2 } stopGraceMusic = { diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index e08b36c8e4..74dd0faf62 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -204,7 +204,12 @@ For barline, space after a thick line.") (grob-property-description 'left-padding number? "space left of accs.") (grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.") (grob-property-description 'lengths list? "Stem length given multiplicity of flag.") -(grob-property-description 'line-count integer? "Number of staff lines.") +(grob-property-description 'line-count integer? "Number of staff +lines. If you want to override this for staffs individually, you must +use @code{\outputproperty}. @code{\property .. \override} will not +work: @code{\override} is processed after the StaffSymbol is created, +and will have no effect. +") (grob-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line.") (grob-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name.") (grob-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts.") -- 2.39.5