]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.6
authorfred <fred>
Wed, 27 Mar 2002 01:20:52 +0000 (01:20 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:20:52 +0000 (01:20 +0000)
30 files changed:
Documentation/regression-test.tely
input/regression/grace-bar-line.ly
input/regression/grace-nest1.ly [new file with mode: 0644]
input/regression/grace-nest2.ly
input/regression/grace-nest4.ly [new file with mode: 0644]
input/regression/grace-nest5.ly [new file with mode: 0644]
input/regression/grace-sync.ly
input/regression/number-staff-lines.ly
lily/auto-beam-engraver.cc
lily/chord-tremolo-iterator.cc
lily/duration.cc
lily/global-translator.cc
lily/grob.cc
lily/include/moment.hh
lily/include/sequential-music-iterator.hh
lily/midi-def.cc
lily/midi-item.cc
lily/midi-walker.cc
lily/moment.cc
lily/music-sequence.cc
lily/new-spacing-spanner.cc
lily/parser.yy
lily/percent-repeat-engraver.cc
lily/performance.cc
lily/score-performer.cc
lily/spacing-spanner.cc
lily/tempo-performer.cc
lily/timing-translator.cc
ly/grace-init.ly
scm/grob-property-description.scm

index e6114b6f1c8797d30f67333f64fe20e802993c7d..b91c7158a0b1a1ea409b65446a8a6eda8fa56c64 100644 (file)
 
 @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}
index 69b0ceed92135a21873a7f4155460384aa85bc0d..176da92aa9719320cec2873f9a0681a1761e105b 100644 (file)
@@ -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 (file)
index 0000000..71ca4b4
--- /dev/null
@@ -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 {
+}
+ }
+
index 5ab4e1e56cfeb5ab72c3843b1bfc0af776db3252..fbd4c8989e3b59bf41ffe7f6cfaeadddda71f7ce 100644 (file)
@@ -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 (file)
index 0000000..416983b
--- /dev/null
@@ -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 (file)
index 0000000..36e0290
--- /dev/null
@@ -0,0 +1,7 @@
+
+\score
+{ \notes {
+     s2 <f4>
+    \grace g e4
+}
+}
index 4ce8fa85b8f39d971b56bff204763400aae72ab6..69efcd5df6192061bb04c56ff30bbcbde60806b8 100644 (file)
@@ -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. }
  } 
index 8c05e3022556fa4aacdca667868f2e37894e6117..e522311a04817daf538ab1b6235634279ccdf14c 100644 (file)
@@ -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 { 
index fdd0f1e633dd91f53f30d3a1fedb14255abe5075..0f8bf698bd35b61575d4508c7c1c996a099eafe3 100644 (file)
@@ -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
index 1cfbc590d32623048437bd7acab6717f0ebdb7de..2556751e84f24c3eeef96978d212d8a2c27a4f1c 100644 (file)
@@ -20,7 +20,7 @@ void
 Chord_tremolo_iterator::construct_children ()
 {
   Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l ());
-  factor_  = Moment (1, rep->repeat_count ());
+  factor_  = Moment (Rational(1, rep->repeat_count ()));
   child_iter_p_ = get_iterator_p (rep->body ());
 }
 
index 38cb80f6ca1ae2ba244239255d77e3b803c190e6..1a0273850db88f4fbd81aeb6569c7afea6513237 100644 (file)
@@ -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 ();
     }
index f7848d72a2206a292fd1d3374ca3f0124f0801d5..4e4208bd8282ab00b31d6e982ff3cbd83375e136 100644 (file)
@@ -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 ())
     {
index abbe22874bd2ba68630cda5af3e2117c1dbccf2c..0f233e61369b61a04650580be4d96088635d4c0e 100644 (file)
@@ -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);
index 6881b933da19b1fc51493bdecc019012e5faad05..4993b7691f84bebb64f30cb45571a5805ee6aeb7 100644 (file)
@@ -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;
index fcedb517f77ddbdca36de33ed0c24d6ea11bc254..37cfbe34be57dccdac82a5284f7b74a5cf7e4f39 100644 (file)
   by initting here_mom_ with Music::start_music (); no fixups are needed.
 
 */
-struct Grace_ski
+struct Grace_fixu
 {
   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;
index 6f3a2cd642e62fcade2be97c4216df40dc757d70..40a2d065b35dcedb0d23a8ace68003879e4bef86 100644 (file)
@@ -16,7 +16,7 @@
 Midi_def::Midi_def ()
 {
   // ugh
-  set_tempo (Moment (1, 4), 60);
+  set_tempo (Moment (Rational (1, 4)), 60);
 }
 
 int
index 11f6bd559fa57659a28524887e6645e6adb38d68..baf6e9ec3c24cc0d88295de020fa5732e2f9fbd9 100644 (file)
@@ -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;
index 17548174b49d48161037100ee54cf3352b745bee..6a568b43fce3a393d1edd0ac72e0c7011355dcc4 100644 (file)
@@ -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)));
 }
 
 /**
index 2f98bfd2ea848f2362a914612d3475e31caad436..e75b6880f6958acc8319de3175963ddd6f2f7eb8 100644 (file)
@@ -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)
index 17da5f46746ed0b99ab9193a071192e3f3328656..a8e9e76fa52a8f7088de2594b16974fad58093c1 100644 (file)
@@ -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
index e67af0ea089378bc372da5620469ecad10a77c36..b67c373fcb705a5fdbb0111564e9edf8c71fafaa 100644 (file)
@@ -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);
        }
 
index 5019a8d8a231c5a45b6a10780836260050eb6bff..c732454e5325a659c8996f5539b185d604deb000 100644 (file)
@@ -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; }
index 0082971d9b4b62dd934b6bc6f7da102175039e05..193a350c6cc6b6f09b9aca4be2ae9cbe1d36d111 100644 (file)
@@ -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;
index 55122e302a43f1cb649421e527d07a8107d360c3..f77674fe5508043c84c88003d1c91c3507a1be44 100644 (file)
@@ -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);
 
index 63af656abedbe03fbb08e34d87c5c5826b0912a4..b1267acdce216ac3b2bdc6d164eea1c012573acc 100644 (file)
@@ -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
index e5a519f1ea9e2e5914df4346e4e486ab431ed7ff..472fa6732bd82528b5ec2584caaeab60fe99c6b2 100644 (file)
@@ -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);
 
 
index f24dd0f8aab44cac0028e0a25476851fefe8f645..97be2fd709eec34ec61522592abdb8bf71b0e94e 100644 (file)
@@ -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));
 
index 5548a249d81963ff5d844b4a3a42a46ce1ef8143..7c05a7d14bd5f292e01ceb8bdf815051fef4531d 100644 (file)
@@ -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
index b9a895cdc40f4f163ffe9a0a7f283526ecc89d39..691498d1bd00aaa847793c49a961d364684b4c80 100644 (file)
@@ -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 = {
index e08b36c8e4f4b48e4e841b6d954bde95f2d74382..74dd0faf6237cd3e948961fb7e64b293020413a8 100644 (file)
@@ -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.")