]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.4 release/1.5.4
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Aug 2001 12:19:40 +0000 (14:19 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Aug 2001 12:19:40 +0000 (14:19 +0200)
==========

* midi2ly bugfixes: don't print ';' in .ly output.

* small cleanup of input/bugs/

* bugfix: nested grace notes; added input/regression/grace-nest.ly

* Bugfix: add double alterations to keyAccidentalOrder (Mats)

* Fixes for PostScript beams and stems.

1.5.2.h

40 files changed:
CHANGES
VERSION
input/bugs/braces.ly
input/bugs/dots.ly
input/bugs/grace-clef.ly [deleted file]
input/bugs/grace-dynamic.ly
input/bugs/grace-finger.ly
input/bugs/grace-gets-slur.ly
input/bugs/grace-pedal.ly [deleted file]
input/bugs/nest-core.ly [deleted file]
input/bugs/newgrace.ly [deleted file]
input/bugs/sbug.ly [deleted file]
input/bugs/triplet.ly [deleted file]
input/regression/grace-nest.ly [new file with mode: 0644]
input/regression/grace-start.ly
input/regression/grace-sync.ly
lily/auto-beam-engraver.cc
lily/beam-engraver.cc
lily/grace-iterator.cc
lily/grace-music.cc
lily/include/moment.hh
lily/include/sequential-music-iterator.hh
lily/midi-item.cc
lily/moment.cc
lily/music-sequence.cc
lily/paper-stream.cc
lily/parser.yy
lily/script-engraver.cc
lily/separation-item.cc
lily/sequential-music-iterator.cc
lily/spacing-spanner.cc
ly/engraver-init.ly
ly/grace-init.ly
make/out/lilypond.lsm
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
midi2ly/lilypond-item.cc
midi2ly/lilypond-stream.cc
scripts/etf2ly.py
scripts/ly2dvi.py

diff --git a/CHANGES b/CHANGES
index d0644b08e003f39355e1cf60fed2d08643b686b7..78a9eaa2a5614adda3b5bbb3b63062fdfd1ae659 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,10 +1,15 @@
-1.5.3.jcn1
+1.5.3.hwn1
 ==========
 
-* Fixes for PostScript beams and stems.
+* midi2ly bugfixes: don't print ';' in .ly output.
 
-1.5.3
-=====
+* small cleanup of input/bugs/
+
+* bugfix: nested grace notes; added input/regression/grace-nest.ly
+
+* Bugfix: add double alterations to keyAccidentalOrder (Mats)
+
+* Fixes for PostScript beams and stems.
 
 1.5.2.hwn1
 ==========
diff --git a/VERSION b/VERSION
index 6b8ac095dfb6cc0b3f913034589720e7e6e59569..c76a3bf252af2cf46436d8612f591ba6c5a7a7cc 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=3
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=4
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 10d474ef81cbf768d6154524f71a718fa9129c59..04179b0ec397c085155f6fa63a605704416f9793 100644 (file)
@@ -1,3 +1,6 @@
+% this bug apparently caused by dvips + mf rounding.
+
+
 \header {
 texidoc="Run this through ly2dvi to show differerent brace sizes"
 }
index f48fe19b75061082625b09eaecad9236a37c0aa6..ff1d7f20ff06ea77f88784958bdc171dfbb7ac5f 100644 (file)
@@ -1,6 +1,6 @@
 
 \header {
- texidoc = "Dots should remain close to the heads they belong to, but should not overlap.";
+ texidoc = "Dots should remain close to the heads they belong to, but should not overlap."
 }
 
 
diff --git a/input/bugs/grace-clef.ly b/input/bugs/grace-clef.ly
deleted file mode 100644 (file)
index 460ee4d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-\score  {\notes\context Voice {
-c4 \clef bass  \grace c'8  c4
-      }}
index b79d9753fd7f3d4104536f9207e3ee272cecf20d..89b002c4cf726080eca2582bc6917daca00a834d 100644 (file)
@@ -1,3 +1,4 @@
 
-
-\score { \notes {\grace {c'_\f} d e f g}}
+ % ?
+ \score { \notes \context Voice {\grace {c'_\f} d e f g}}
index 38095ef78bc34dfe7663565c36964f637a10db57..077b407038a43a7b950ce0d02642d11ebe6151ac 100644 (file)
@@ -1,6 +1,7 @@
 
 
-
+ % ?
 \score {
 \notes \context Voice = VA \relative c'' {
        \grace {[b8^1 c^2]} d4^3
index 65703e7b81a07dd3413a95e6b867a6f5fa8f568e..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,12 +1 @@
 
-
-\score {
-       \notes\relative c''{
-               \grace g8 g'2 ( )g
-       }
-       \paper {
-               linewidth=40.\mm;
-               indent=0.;
-       }
-}
-
diff --git a/input/bugs/grace-pedal.ly b/input/bugs/grace-pedal.ly
deleted file mode 100644 (file)
index 0d381d1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-% dumps core: 1.3.93
-\score{
-       \notes{
-                   \grace { <e,,,32\sustainDown( e,> } <)gis'2 e>
-       }
-}
diff --git a/input/bugs/nest-core.ly b/input/bugs/nest-core.ly
deleted file mode 100644 (file)
index c8ebfe3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-\header{
-texidoc="running this through ly2dvi, or with -Hheader dumps core"
-tagline="{"
-}
-
-\score {
-  \notes c
-}
\ No newline at end of file
diff --git a/input/bugs/newgrace.ly b/input/bugs/newgrace.ly
deleted file mode 100644 (file)
index 9db2a2b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-\score {  \notes {
-  \clef bass
-  <{ 
-    \grace { [c16  ] }
-    \relative b,  b2  
-   } >
-}
-}
diff --git a/input/bugs/sbug.ly b/input/bugs/sbug.ly
deleted file mode 100644 (file)
index fae779b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-%  the \stopped collides with the
-%beam.
-
-
-% stopped disappeared ?? 
-\score { \notes {
-\clef "G"; \stemUp [a''8^\stopped a''8_\stopped]
-}}
diff --git a/input/bugs/triplet.ly b/input/bugs/triplet.ly
deleted file mode 100644 (file)
index 9992897..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-\header {
-texidoc="manual beam override is ignored in first triplet"
-}
-
-\score {
-  \context Voice \notes\relative c'' {
-    \times 2/3 { < [ a8 c > < a c > < a c ] > }
-    \times 2/3 < { [ a8 a a ] } { c c c ] } >
-  }
-}
diff --git a/input/regression/grace-nest.ly b/input/regression/grace-nest.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 1094d3b5fd484db9c15de00d4b0b912ae6784d03..5c0c5dff6701a9fdf653ac8a3b6d1a8a333d012a 100644 (file)
@@ -3,7 +3,9 @@ texidoc = "Pieces may begin with grace notes."
 }
 \score  {\notes \relative c' \context Staff  { 
  \grace { [a'16 f]  } g1
+ \bar "||"  % test if | and || are synced.
  \grace { [a16 bes]  }  c1
+ \bar "||"  % test if | and || are synced. 
   }
   \paper { linewidth = -1. }
 }
index 0ddcdf37f81d8bb172c3f9b791a50559c91c281a..419ccdeb14ca82082fa77d84b54728e5954dda68 100644 (file)
@@ -3,10 +3,10 @@
 }
 
 \score  {\notes < \context Staff  { c2
\ngrace  c8
- c2 c4 }
       \grace  c8
 c2 c4 }
                \context Staff = SB { c2 \clef bass
%\ngrace { [dis8 ( d8] }
\grace { [dis8 ( d8] }
 
   ) c2 c4 }
                \context Staff = SC { c2 c2 c4 }
index 94671aabf05b43b3a9dbc2aa418c16d6e2799704..781f03393fdf7df09676a2d4d9edf658ce6fd66e 100644 (file)
@@ -399,7 +399,7 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
       /*
        ignore grace notes.
        */
-      if (bool (beam_start_location_.grace_mom_) != bool (now_mom ().grace_mom_))
+      if (bool (beam_start_location_.grace_part_) != bool (now_mom ().grace_part_))
        return ;
        
       
index 7b506953c8eb1904381b761bbffae8119f0462a5..122a7ecd3c28369f0c11b928870709d74f9827ea 100644 (file)
@@ -242,7 +242,7 @@ Beam_engraver::acknowledge_grob (Grob_info info)
        {
          Moment now = now_mom();
 
-         if(bool (now.grace_mom_ ) != bool (beam_start_mom_.grace_mom_))
+         if(bool (now.grace_part_ ) != bool (beam_start_mom_.grace_part_))
            return ;
          
          Item *stem_l = dynamic_cast<Item*> (info.elem_l_);
index 9248e071f8c218301669fb6cf144ff90baa2f37a..fde8167730ed9ea7e9f4d74ee3b4ab20881d6790 100644 (file)
@@ -22,10 +22,10 @@ Grace_iterator::~Grace_iterator ()
 
 
 void
-Grace_iterator::process (Moment m )
+Grace_iterator::process (Moment m)
 {
   Moment main ;
-  main.main_part_ = m.grace_mom_;
+  main.main_part_ = music_length_.grace_part_ + m.grace_part_;
   Music_wrapper_iterator::process (main);
 }
 
@@ -43,7 +43,7 @@ Grace_iterator::pending_moment () const
   Moment cp =Music_wrapper_iterator::pending_moment();
 
   Moment pending;
-  pending.grace_mom_ = - music_length_.main_part_  + cp.main_part_;
+  pending.grace_part_ =  cp.main_part_- music_length_.grace_part_ ;
 
   return pending;
 }
index 9e88f7b835cb21d35933b7e8c969f618c2643b90..27c88c6f7b66ab283946a1b23ca5ee1dad9f9c34 100644 (file)
@@ -21,7 +21,7 @@ Grace_music::length_mom () const
 {
   Moment l = Music_wrapper::length_mom ();
   Moment gl;
-  gl.grace_mom_ = l.main_part_ + l.grace_mom_ ;
+  gl.grace_part_ = l.main_part_ + l.grace_part_ ;
   return gl;
 }
 
@@ -29,7 +29,7 @@ Grace_music::length_mom () const
 Moment
 Grace_music::start_mom () const
 {
-  return Music::start_mom ();
+  return - length_mom ();
 }
 
 Grace_music::Grace_music ()
index fca85bb458be577be03c091af6bd018db67982fe..a882bb098623e2c2bceb319db137d8344aaac5e8 100644 (file)
@@ -14,7 +14,8 @@
 #include "rational.hh"
 
 /**
-   Rationals with glue for Guilification;
+   Musical timing (Main-timing, grace-timing) with glue for
+   Guilification;
 */
 class Moment
 {
@@ -26,7 +27,8 @@ public:
 
   Moment (Rational m);
 
-
+  Moment operator - () const;
+  
   void operator += (Moment const &m);
   void operator -= (Moment const &m);  
 
@@ -34,7 +36,7 @@ public:
   void operator /= (Moment const &m);  
 
   Rational main_part_;
-  Rational grace_mom_;
+  Rational grace_part_;
 
   void set_infinite (int k);
   
index 6f13f441411e78d526a613da6d28b12db3c1d628..fcedb517f77ddbdca36de33ed0c24d6ea11bc254 100644 (file)
 #include "music-iterator.hh"
 
 
+/*
+
+  This is a lookahead list for grace notes.
+
+   {  ... X \grace Y  Z ... }
+
+   normally, the ending of X is the start of Z. In case of a grace
+   note, we take off a little at the end of X. What is stored: START
+   (start point of X), LENGTH (length of X), GRACE_START (start_music
+   of Y), and the next fixup element.
+
+  This is also done for nested musics, i.e.
+
+  voiceA = \notes { \grace b16 c'2 }
+  voiceB = \notes { c'2 \voiceA }
+
+  the iterator for voiceB will contain a fixup entry with (START=0/1,
+  LENGTH=2/1, GRACE_START=(0G-1/16) ) 
+   
+  Graces at the start of a sequential music iterator are handled
+  by initting here_mom_ with Music::start_music (); no fixups are needed.
+
+*/
 struct Grace_skip 
 {
   Moment start_;
   Rational length_;
-  Rational grace_length_;  
+
+  Rational grace_start_;  
   Grace_skip *next_;
 };
 
index 2e9d260163360664da8f1a388ce59d348e471272..11f6bd559fa57659a28524887e6645e6adb38d68 100644 (file)
@@ -98,7 +98,7 @@ String
 Midi_event::str () const
 {
   Rational rat_dt = (delta_mom_.main_part_ * Rational (384) +
-    delta_mom_.grace_mom_ * Rational (100))*Rational (4);
+    delta_mom_.grace_part_ * Rational (100))*Rational (4);
   int delta_i = int (rat_dt);
 
   String delta_str = Midi_item::i2varint_str (delta_i);
index ca6188f94489417296959dc4b287ebd75cfdaf85..5a3ff5f8fc238924fcd20f4dd7dd976d6b7d4afa 100644 (file)
@@ -98,7 +98,7 @@ Moment::compare (Moment const &a, Moment const &b)
   if (c)
     return c;
 
-  return Rational::compare (a.grace_mom_, b.grace_mom_);
+  return Rational::compare (a.grace_part_, b.grace_part_);
 }
 
 Moment::Moment ()
@@ -109,32 +109,32 @@ Moment::Moment ()
 Moment::Moment (int m)
 {
   main_part_ = Rational(m);
-  grace_mom_  = Rational( 0);
+  grace_part_  = Rational( 0);
 }
 
 Moment::Moment (int m, int n)
 {
   main_part_ = Rational (m,n);
-  grace_mom_  = Rational (0);
+  grace_part_  = Rational (0);
 }
 
 Moment::Moment (Rational m)
 {
   main_part_ = m;
-  grace_mom_  = Rational (0);
+  grace_part_  = Rational (0);
 }
 
 void
 Moment::operator += (Moment const &src)
 {
   main_part_ +=src.main_part_ ;
-  grace_mom_ += src.grace_mom_;
+  grace_part_ += src.grace_part_;
 }
 void
 Moment::operator -= (Moment const &src)
 {
   main_part_ -= src.main_part_ ;
-  grace_mom_ -= src.grace_mom_;
+  grace_part_ -= src.grace_part_;
 }
 
 /*
@@ -144,7 +144,7 @@ void
 Moment::operator *= (Moment const &src)
 {
   main_part_ *= src.main_part_ ;
-  grace_mom_ *= src.main_part_;
+  grace_part_ *= src.main_part_;
 }
 
 /*
@@ -154,7 +154,7 @@ void
 Moment::operator /= (Moment const &src)
 {
   main_part_ /= src.main_part_ ;
-  grace_mom_ /= src.main_part_;
+  grace_part_ /= src.main_part_;
 }
 
 
@@ -174,7 +174,7 @@ Moment::num () const { return main_part_.num (); }
 
 Moment::operator bool ()
 {
-  return main_part_ || grace_mom_;
+  return main_part_ || grace_part_;
 }
 
 void
@@ -187,5 +187,19 @@ Moment::set_infinite (int k)
 String
 Moment::str () const
 {
-  return main_part_.str ();
+  String s =  main_part_.str ();
+  if (grace_part_)
+    {
+      s += "G" + grace_part_.str ();
+    }
+  return s;
+}
+
+Moment
+Moment::operator - ( ) const
+{
+  Moment m;
+  m.grace_part_ = -grace_part_;
+  m.main_part_ = -main_part_;
+  return m;
 }
index 47927f6cb90244c8851144d09f79e1454573b28c..17da5f46746ed0b99ab9193a071192e3f3328656 100644 (file)
@@ -75,15 +75,15 @@ Music_sequence::cumulative_length () const
   for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
     {
       Moment l = unsmob_music (gh_car (s))->length_mom ();
-      if (last_len.grace_mom_ && l.main_part_)
+      if (last_len.grace_part_ && l.main_part_)
        {
-         last_len.grace_mom_ = Rational (0);
+         last_len.grace_part_ = Rational (0);
        }
       cumulative += last_len;
       last_len = l;
     }
 
-  last_len.grace_mom_ = Rational (0);
+  last_len.grace_part_ = Rational (0);
   cumulative += last_len;
   
   return  cumulative;
@@ -170,9 +170,9 @@ Music_sequence::first_start () const
 
       if (l.main_part_)
        return mus->start_mom ();
-      else if (l.grace_mom_)
+      else if (l.grace_part_)
        {
-         m.grace_mom_ = - l.grace_mom_; 
+         m.grace_part_ = - l.grace_part_; 
          return m;
        }
     }
index ba3c9ee11555880dc806fe16f87385f5a687d562..d2bbeb3f9ca676d2fc2bf2ab3f40af21c09d162e 100644 (file)
@@ -71,7 +71,8 @@ Paper_stream::Paper_stream (String filename)
 Paper_stream::~Paper_stream ()
 {
   close_file_stream (os_);
-  assert (nest_level == 0);
+  if (nest_level != 0)
+    programming_error ("Brace nesting in paper output doesn't match");
 }
 
 // print string. don't forget indent.
index 4f4747ab5a0d41edfd1ebe050219bb9203e54df6..b9f4793d2c50450cad3c7c9bd15b1d567ff385f2 100644 (file)
@@ -806,7 +806,7 @@ Composite_music:
                chm->set_spot (*$3->origin ());
        }
        | GRACE Music {
-#if 1
+#if 0
        /*
                The other version is for easier debugging  of
                Sequential_music_iterator in combination with grace notes.
index 70844dc5b6f62558d834012dc7c24330e92c4830..17aec42ba026c0a13f44c1a353ca8da22e4aaf05 100644 (file)
@@ -139,8 +139,10 @@ Script_engraver::acknowledge_grob (Grob_info inf)
            }
          if (Side_position_interface::get_axis (e) == X_AXIS
              && !e->parent_l (Y_AXIS))
-           e->set_parent (inf.elem_l_, Y_AXIS);
-         
+           {
+             e->set_parent (inf.elem_l_, Y_AXIS);
+             e->add_dependency (inf.elem_l_); // ??
+           }
          Side_position_interface::add_support (e,inf.elem_l_);
        }
     }  
index b5642dbc268796839a4d742e3acbd7c243349138..522cde9ac162a6a3324610c2aaac920a86350d8b 100644 (file)
@@ -60,6 +60,14 @@ Separation_item::my_width (Grob *me)
        }
     }
 
+  SCM pad = me->get_grob_property ("padding");
+
+  if (gh_number_p (pad))
+  {
+    w[RIGHT] += gh_scm2double (pad)/2;
+    w[LEFT] -= gh_scm2double (pad)/2;    
+  }
+  
   return w;
  // add this->offset_ ? this-> relative_coordinate ()? 
 }
index e02847f991f3cbdb18683cfacc47518d362313f9..7a6b240a155dc2aca487afd0838f0e24fd65b27f 100644 (file)
@@ -27,8 +27,6 @@
   here_mom_  = sum (length (musiclist [start ... cursor>))  %)  
   
  */
-
-
 Sequential_music_iterator::Sequential_music_iterator ()
 {
   cursor_ = SCM_EOL;
@@ -59,33 +57,33 @@ Grace_skip *
 get_grace_skips (SCM cursor)
 {
   Moment here (0);
-  Moment last (here);
+  Moment last (-1);
   Grace_skip *head = 0;
   Grace_skip **tail = &head;
-  bool first = true; 
-
   
   for (; gh_pair_p (cursor); cursor = gh_cdr (cursor))
     {
       Music * mus = unsmob_music (gh_car (cursor));
       Moment l =mus->length_mom ();
-      if (l.main_part_)
-       {
-         first = false;
-         last = here;
-         here += l;
-       }
-      else if(l.grace_mom_ && !first)
+      Moment s = mus->start_mom ();
+
+      if (s.grace_part_ && last >= Moment (0))
        {
-         assert (!l.main_part_);
          Grace_skip *p =new Grace_skip;
          p->start_ = last;
          p->length_ = (here - last).main_part_;
-         p->grace_length_ = l.grace_mom_;
+         p->grace_start_ = s.grace_part_;
          p->next_ = 0;
          *tail = p;
          tail = &(*tail)->next_; 
        }
+      
+      if (l.main_part_)
+       {
+         l.grace_part_ = Rational (0);
+         last = here;
+         here += l;
+       }
     }
   return  head;
 }
@@ -123,24 +121,31 @@ Sequential_music_iterator::next_element ()
   Moment len =iter_p_->music_length_mom ();
   Moment start  = iter_p_->music_start_mom ();
   assert (!grace_skips_  || grace_skips_->start_ >= here_mom_);
-
+  
   if (len.main_part_ && grace_skips_ && grace_skips_->start_ == here_mom_)
     {
       Moment sk;
       sk.main_part_ = grace_skips_->length_;
       here_mom_ +=  sk;
-      here_mom_.grace_mom_ = - grace_skips_->grace_length_;
+      here_mom_.grace_part_ = grace_skips_->grace_start_;
 
       Grace_skip * n =grace_skips_->next_;
-      delete       grace_skips_;
+      delete grace_skips_;
       grace_skips_ = n;
     }
-  else if (len.grace_mom_)
+  else if (len.grace_part_ && !len.main_part_)
     {
-      here_mom_.grace_mom_ =0;
+      here_mom_.grace_part_ =0;
     }
   else
     {
+      /*
+       !len.grace_part_ || len.main_part_
+
+       We skip over a big chunk (mainpart != 0). Any starting graces
+       in that chunk are compensated by subtracting START.
+
+      */
       here_mom_ += len - start;
     }
   
@@ -157,7 +162,6 @@ Sequential_music_iterator::next_element ()
   move to context of child iterator if it is deeper down in the
   hierarchy.
   */
-
 void
 Sequential_music_iterator::descend_to_child ()
 {
@@ -254,7 +258,7 @@ Sequential_music_iterator::process (Moment until)
            do the stuff/note/rest preceding a grace.
           */
          Moment u = until;
-         u.grace_mom_ = 0;
+         u.grace_part_ = 0;
          iter_p_->process (u - here_mom_);
        }
       else
@@ -279,16 +283,22 @@ Sequential_music_iterator::pending_moment () const
 {
   Moment cp = iter_p_->pending_moment ();
 
-  if (grace_skips_
-      && here_mom_ == grace_skips_->start_
+  /*
+    Fix-up a grace note halfway in the music.
+  */
+  if (grace_skips_ && here_mom_ == grace_skips_->start_
       && cp.main_part_ >=  grace_skips_->length_)
     {
-      cp += here_mom_ ;
-      cp.grace_mom_ = - grace_skips_->grace_length_;
-      return cp;
+         cp += here_mom_ ;
+         cp.grace_part_ = grace_skips_->grace_start_;
+         return cp;
+
     }
-  else
-    return cp + here_mom_ - iter_p_->music_start_mom ();
+
+    /*
+      Fix-up a grace note at  the start of the music.
+     */
+  return cp + here_mom_ - iter_p_->music_start_mom ();
 }
 
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..636757b94d611417921ce30880521fbb6d5f0b24 100644 (file)
@@ -0,0 +1,616 @@
+/*   
+  spacing-spanner.cc --  implement Spacing_spanner
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "spacing-spanner.hh"
+#include "paper-column.hh"
+#include "dimensions.hh"
+#include "paper-def.hh"
+#include "warn.hh"
+#include "paper-score.hh"
+#include "line-of-score.hh"
+#include "misc.hh"
+
+void
+Spacing_spanner::set_interface (Grob*me)
+{
+  me->set_extent_callback (SCM_EOL, X_AXIS);
+  me->set_extent_callback (SCM_EOL, Y_AXIS) ; 
+}
+
+#if 0  
+struct Note_run
+{
+  Array<int> idxes;
+  int start, end;
+  Moment duration;
+  int count;
+};
+
+int
+column_compare (Grob  *const &t1, Grob *const &t2)
+{
+  return Moment::compare (Paper_column::when_mom (t1),
+                         Paper_column::when_mom (t2));
+}
+
+
+Note_run
+run_length (Moment dt, int i, Array<Moment> const &moms,
+           Link_array<Note_run> runs)
+{
+  int k = 0;
+  Array<int> idxes;
+
+  idxes.push (i);
+  while (1)
+    {
+      Moment next = moms[i] + dt;
+      while (i < moms.size () && moms[i] < next)
+       i++;
+      if (i == moms.size () || moms[i] != next)
+       break;
+
+      idxes.push (i);
+      k++;
+    }
+
+  Moment dur = idxes.size ()
+}
+
+void
+find_runs (Grob*me, Link_array<Grob> cols) 
+{
+  Link_array<Grob> filter_cols;
+  Array<Moment> col_moments;
+  for (int i = 0; i < cols.size (); i++)
+    {
+      Moment w =  Paper_column::when_mom (cols[i]);
+      
+      if (!w.grace_part_ && Paper_column::musical_b (cols[i]))
+       {
+         filter_cols.push (cols[i]);
+         col_moments.push (w);
+       }
+    }
+
+  Moment end_mom = col_moments.top ();
+  for (int i = 0; i < col_moments.size () ; i++)
+    {
+      for (int j = i+1; j < col_moments.size (); j++)
+       {
+         Moment dt = Paper_column::col_momentsfilter_cols 
+       }
+    }
+}
+#endif  
+
+/*
+
+  The algorithm is partly taken from :
+
+  John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+  OSU-CISRC-10/87-TR35, Department of Computer and Information
+  Science, The Ohio State University, 1987.
+
+  TOO HAIRY.
+
+  TODO: write comments 
+  
+ */
+void
+Spacing_spanner::do_measure (Grob*me, Link_array<Grob> const & cols) 
+{
+  Moment shortest;
+  Moment mean_shortest;
+
+  /*
+    space as if this duration  is present. 
+   */
+  Moment base_shortest_duration = *unsmob_moment (me->get_grob_property ("maximum-duration-for-spacing"));
+  shortest.set_infinite (1);
+
+  int n = 0;
+  for (int i =0 ; i < cols.size (); i++)  
+    {
+      if (Paper_column::musical_b (cols[i]))
+       {
+         Moment *when = unsmob_moment (cols[i]->get_grob_property  ("when"));
+
+         /*
+           ignore grace notes for shortest notes.
+          */
+         if (when && when->grace_part_)
+           continue;
+         
+         SCM  st = cols[i]->get_grob_property ("shortest-starter-duration");
+         Moment this_shortest = *unsmob_moment (st);
+         shortest = shortest <? this_shortest;
+         if (!mean_shortest.main_part_.infty_b ())
+           {
+             n++;
+             mean_shortest += this_shortest;
+           }
+       }
+    }
+  mean_shortest /= n;
+
+  Array<Spring> springs;
+  for (int i= 0; i < cols.size () - 1; i++)
+    {
+      Item * l = dynamic_cast<Item*> (cols[i]);
+      Item * r =  dynamic_cast<Item*> (cols[i+1]);
+      Item * lb = dynamic_cast<Item*> (l->find_prebroken_piece (RIGHT));
+      Item * rb = dynamic_cast<Item*> (r->find_prebroken_piece (LEFT));
+
+      Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}};
+
+
+      /*
+       left refers to the space that is associated with items of the left column, so you have
+
+         LC  <- left_space -><- right_space -> RC
+              <-    total space              ->
+             
+
+        typically, right_space is non-zero when there are
+        accidentals in RC
+         
+       */
+      for (int j=0; j < 4; j++)
+       {
+         Paper_column * lc = dynamic_cast<Paper_column*> (combinations[j][0]);
+         Paper_column *rc = dynamic_cast<Paper_column*> (combinations[j][1]);
+         if (!lc || !rc)
+           continue;
+
+         Spring s;
+         s.item_l_drul_[LEFT] = lc;
+         s.item_l_drul_[RIGHT] = rc;
+         
+         SCM hint = lc->get_grob_property ("extra-space");
+         SCM next_hint = rc->get_grob_property ("extra-space");
+         SCM stretch_hint = lc->get_grob_property ("stretch-distance");
+         SCM next_stretch_hint = rc->get_grob_property ("stretch-distance");     
+
+         Real left_distance = 0;
+         if (gh_pair_p (hint))
+           {
+             left_distance = gh_scm2double (gh_cdr (hint)); 
+           }
+          // 2nd condition should be (i+1 < col_count ()), ie. not the last column in score.  FIXME
+         else if (!Paper_column::musical_b (lc) && i+1 < cols.size ()) 
+           {
+             left_distance= default_bar_spacing (me,lc,rc,shortest <? base_shortest_duration);
+           }
+         else if (Paper_column::musical_b ( lc))
+           {
+             left_distance  = note_spacing (me,lc, rc, shortest <? base_shortest_duration);
+           }
+         else
+             programming_error ("uninitialised left_distance");
+         
+         s.distance_f_ = left_distance;
+
+         /*
+           Only do tight spaces *after* barlines (breakable columns),
+           not before.
+
+           We want the space before barline to be like the note
+           spacing in the measure.
+         */
+         SCM sfac =lc->get_grob_property ("space-factor");
+         if (gh_number_p (lc->get_grob_property ("column-space-strength"))
+             && (Item::breakable_b (lc) || lc->original_l_))
+           {
+             s.strength_f_ =
+               gh_scm2double (lc->get_grob_property ("column-space-strength"));
+           }
+         else if (gh_number_p (sfac))
+           left_distance *= gh_scm2double (sfac);
+
+         
+         Real right_dist = 0.0;
+         if (gh_pair_p (next_hint))
+           {
+             right_dist += - gh_scm2double (gh_car (next_hint));
+           }
+         else
+           {
+             Interval ext (rc->extent (rc, X_AXIS));
+             right_dist =  ext.empty_b () ? 0.0 : - ext [LEFT];
+           }
+
+         /*
+           don't want to create too much extra space for accidentals
+         */
+         if (Paper_column::musical_b (rc))
+          {
+             if (to_boolean (rc->get_grob_property ("contains-grace")))
+               right_dist *= gh_scm2double (rc->get_grob_property ("before-grace-spacing-factor")); // fixme.
+             else
+               right_dist *= gh_scm2double (lc->get_grob_property ("before-musical-spacing-factor"));
+          }
+
+         s.distance_f_ = left_distance + right_dist;
+           
+         Real stretch_dist = 0.;
+         if (gh_number_p (stretch_hint))
+           stretch_dist += gh_scm2double (stretch_hint);
+         else
+           stretch_dist += left_distance;
+         
+         if (gh_pair_p (next_stretch_hint))
+           // see regtest spacing-tight
+           stretch_dist += - gh_scm2double (gh_car (next_stretch_hint));
+         else
+           stretch_dist += right_dist;
+
+         if (s.distance_f_ <0)
+           {
+             programming_error ("Negative dist, setting to 1.0 PT");
+             s.distance_f_ = 1.0;
+           }
+         if (stretch_dist == 0.0)
+           {
+             /*
+               \bar "".  We give it 0 space, with high strength. 
+              */
+             s.strength_f_ = 20.0; 
+           }
+         else
+           s.strength_f_ /= stretch_dist;
+         
+         springs.push (s);
+       }
+    }
+
+  Spacing_spanner::stretch_to_regularity (me, &springs, cols);
+  for (int i=springs.size (); i --;)
+    springs[i].add_to_cols ();
+}
+
+/*
+  Look at COLS, searching for columns that have 'regular-distance-to
+  set. A sequence of columns that have this property set should have
+  an equal distance (an equispaced run). Extract the projected
+  distance from SPRINGS, and scale SPRINGS for the equispaced run, to the
+  widest space necessary.
+
+
+  TODO:
+  
+  -- inefficient code; maybe it is easier to twiddle with the springs
+  after they've become grob properties (ie. have their
+  minimum-distances set)
+
+  -- does not adjust strength field of the springs very well: result
+  awkward spacing at the start of a line. (?)
+
+  -- will be confused when there are multiple equispaced runs in a measure.
+
+  -- dealing with springs for line breaks is a little tricky; in any
+  case, we will only space per measure.
+
+  -- we scale to actual distances, not to optical effects. Eg. if the
+  equispaced run contains optical corrections, then the scaling will
+  cancel those.
+
+  -- Regular_spacing_engraver doesn't mark the first column of the
+  next bar, making the space before a barline too short, in this case
+
+
+       x<- 16ths--> x(8th)
+       x(8th)       x(8th)      <- equispaced run.      
+  
+*/
+
+void
+Spacing_spanner::stretch_to_regularity (Grob *me,
+                                       Array<Spring> * springs,
+                                       Link_array<Grob> const & cols)
+{
+  /*
+    Find the starting column of the run. REGULAR-DISTANCE-TO points
+    back to a previous column, so we look ahead to find a column
+    pointing back to the first one.
+    
+   */
+  Grob    * first_regular_spaced_col = 0;
+  for (int i = 0 ;  i <  cols.size () && !first_regular_spaced_col; i++)
+    {
+      SCM rdt = cols[i]->get_grob_property ("regular-distance-to");
+      if (cols.find_l (unsmob_grob (rdt)))
+       first_regular_spaced_col = unsmob_grob (rdt);
+    }
+  for (int i = springs->size ();  i-- ;)
+    springs->elem (i).set_to_cols ();
+  
+  int i;
+  for (i = 0; i < springs->size ()
+        && springs->elem (i).item_l_drul_[RIGHT] != first_regular_spaced_col;
+       i++)
+    ;
+
+
+  if (i==springs->size ())
+    return ;
+    
+  Real maxdist = 0.0;
+  Real dist  =0.0;
+  Grob *last_col = first_regular_spaced_col;
+  Grob *last_regular_spaced_col = first_regular_spaced_col;
+  
+
+  /*
+    find the max distance for this run. 
+   */
+  for (int j = i;  j < springs->size (); j++)
+    {
+      Spring *s = &(springs->elem_ref (j));
+      if (s->item_l_drul_[LEFT] != last_col)
+       continue;
+      
+      dist += s->distance_f_;
+
+      last_col = s->item_l_drul_[RIGHT];
+      SCM rdt = last_col->get_grob_property ("regular-distance-to");
+      if (unsmob_grob (rdt) == last_regular_spaced_col)
+       {
+         maxdist = maxdist >? dist;
+         dist = 0.0;
+         last_regular_spaced_col = last_col;
+       }
+
+    }
+
+  /*
+    Scale the springs
+   */
+  dist =0.0;
+  last_col =  first_regular_spaced_col;
+  last_regular_spaced_col = first_regular_spaced_col;
+  for (int j = i;   j < springs->size (); j++)
+    {
+      Spring *s = &springs->elem_ref (j);
+      if (s->item_l_drul_[LEFT] != last_col)
+       continue;
+      dist += s->distance_f_;
+
+      last_col = s->item_l_drul_[RIGHT];
+      SCM rdt = last_col->get_grob_property ("regular-distance-to");
+      if (unsmob_grob (rdt) == last_regular_spaced_col)
+       {
+         do {
+           springs->elem_ref (i).distance_f_ *= maxdist / dist;
+           springs->elem_ref (i).strength_f_ *= dist / maxdist;            
+         } while (i++ < j);
+         last_regular_spaced_col = last_col;
+         dist =0.0;
+       }
+    }
+}
+
+/**
+   Do something if breakable column has no spacing hints set.
+ */
+Real
+Spacing_spanner::default_bar_spacing (Grob*me, Grob *lc, Grob *rc,
+                                     Moment shortest) 
+{
+  Real symbol_distance = lc->extent (lc,X_AXIS)[RIGHT] ;
+  Real durational_distance = 0;
+  Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc);
+
+  /*
+               ugh should use shortest_playing distance
+  */
+  if (delta_t)
+    {
+      durational_distance =  get_duration_space (me, delta_t, shortest);
+    }
+
+  return  symbol_distance >? durational_distance;
+}
+
+
+/**
+  Get the measure wide ant for arithmetic spacing.
+
+  @see
+  John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+  OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+  The Ohio State University, 1987.
+
+  */
+Real
+Spacing_spanner::get_duration_space (Grob*me, Moment d, Moment shortest) 
+{
+  Real log =  log_2 (shortest);
+  Real k = gh_scm2double (me->get_grob_property ("arithmetic-basicspace"))
+    - log;
+  
+  return (log_2 (d) + k) * gh_scm2double (me->get_grob_property ("arithmetic-multiplier"));
+}
+
+
+Real
+Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
+                              Moment shortest) 
+{
+  Moment shortest_playing_len = 0;
+  SCM s = lc->get_grob_property ("shortest-playing-duration");
+
+  //  SCM s = lc->get_grob_property ("mean-playing-duration");  
+  if (unsmob_moment (s))
+    shortest_playing_len = *unsmob_moment (s);
+  
+  if (! shortest_playing_len)
+    {
+      programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).str ());
+      shortest_playing_len = 1;
+    }
+  
+  if (! shortest)
+    {
+      programming_error ("no minimum in measure at " + Paper_column::when_mom (lc).str ());
+      shortest = 1;
+    }
+  Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc);
+  Real dist = get_duration_space (me, shortest_playing_len, shortest);
+
+
+  /*
+    ugh: 0.1 is an arbitrary distance.
+   */
+  dist *= (double) (delta_t.main_part_ / shortest_playing_len.main_part_)
+    + 0.1 * (double) (delta_t.grace_part_ / shortest_playing_len.main_part_);
+
+
+
+  /*
+    UGH: KLUDGE!
+  */
+  
+  if (delta_t > Moment (1,32))
+    dist += stem_dir_correction (me, lc,rc);
+
+
+  Moment *lm = unsmob_moment (lc->get_grob_property ("when"));
+  Moment *rm = unsmob_moment (rc->get_grob_property ("when"));
+
+  if (lm && rm)
+    {
+      if (lm->grace_part_ && rm->grace_part_)
+       dist *= 0.5;
+      else if (!rm->grace_part_ && lm->grace_part_)
+       dist *= 0.7;
+    }
+
+  
+  return dist;
+}
+
+
+/**
+   Correct for optical illusions. See [Wanske] p. 138. The combination
+   up-stem + down-stem should get extra space, the combination
+   down-stem + up-stem less.
+
+   This should be more advanced, since relative heights of the note
+   heads also influence required correction.
+
+   Also might not work correctly in case of multi voices or staff
+   changing voices
+
+   TODO: lookup correction distances?  More advanced correction?
+   Possibly turn this off?
+
+   TODO: have to check wether the stems are in the same staff.
+
+   This routine reads the DIR-LIST property of both its L and R arguments.  */
+Real
+Spacing_spanner::stem_dir_correction (Grob*me, Grob*l, Grob*r) 
+{
+  SCM dl = l->get_grob_property ("dir-list");
+  SCM dr = r->get_grob_property ("dir-list");
+  
+  if (scm_ilength (dl) != 1 || scm_ilength (dr) != 1)
+    return 0.;
+
+  dl = gh_car (dl);
+  dr = gh_car (dr);
+
+  assert (gh_number_p (dl) && gh_number_p (dr));
+  int d1 = gh_scm2int (dl);
+  int d2 = gh_scm2int (dr);
+
+  if (d1 == d2)
+    return 0.0;
+
+
+  Real correction = 0.0;
+  Real ssc = gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+
+  if (d1 && d2 && d1 * d2 == -1)
+    {
+      correction = d1 * ssc;
+    }
+  else
+    programming_error ("Stem directions not set correctly for optical correction");
+  return correction;
+}
+  
+
+MAKE_SCHEME_CALLBACK (Spacing_spanner, set_springs,1);
+SCM
+Spacing_spanner::set_springs (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Link_array<Grob> all (me->pscore_l_->line_l_->column_l_arr ()) ;
+
+  int j = 0;
+
+  for (int i = 1; i < all.size (); i++)
+    {
+      Grob *sc = all[i];
+      if (Item::breakable_b (sc))
+        {
+         Link_array<Grob> measure (all.slice (j, i+1));          
+          do_measure (me, measure);
+         j = i;
+        }
+    }
+
+  /*
+    farewell, cruel world
+   */
+  me->suicide ();
+  return SCM_UNSPECIFIED;
+}
+
+
+
+/*
+  maximum-duration-for-spacing
+From: bf250@freenet.carleton.ca (John Sankey)
+To: gnu-music-discuss@gnu.org
+Subject: note spacing suggestion
+Date: Mon, 10 Jul 2000 11:28:03 -0400 (EDT)
+
+Currently, Lily spaces notes by starting with a basic distance,
+arithmetic_multiplier, which it applies to the minimum duration note
+of the bar. Then she adds a logarithmic increment, scaled from
+arithmetic_basicspace, for longer notes. (Then, columns are aligned
+and justified.) Fundamentally, this matches visual spacing to musical
+weight and works well.
+
+A lot of the time in music, I see a section basically in melodic
+notes that occasionally has a rapid ornamental run (scale). So, there
+will be a section in 1/4 notes, then a brief passage in 1/32nds, then
+a return to long notes. Currently, Lily gives the same horizontal
+space to the 1/32nd notes in their bar (even if set in small size as
+is commonly done for cadenzii) as she gives to 1/4 notes in bars
+where 1/4 note is the minimum duration. The resulting visual weight
+does not match the musical weight over the page.
+
+Looking at the music I am typesetting, I feel that Lily's spacing
+could be significantly improved if, with no change in the basic
+method used, arithmetic_multiplier could be applied referred to the
+same duration throughout a piece. Of course, the current method
+should be retained for those who have already set music in it, so I
+suggest a property called something like arithmetic_base=16 to fix
+1/16 duration as the reference for arithmetic_multiplier; the default
+would be a dynamic base is it is now.
+
+Does anyone else feel that this would be a useful improvement for
+their music? (Of course, if arithmetic_multiplier became a regular
+property, this could be used to achieve a similar result by
+tweaking.)
+  
+ */
index c8ec356f527378c7b01178266a02a6dd6f873ce0..729a926b01def3ef362756f99645fbcaa0bdbf02 100644 (file)
@@ -381,7 +381,9 @@ ScoreContext = \translator {
        keyAccidentalOrder = #'(
          (6 . -1) (2  . -1) (5 . -1 ) (1  . -1) (4  . -1) (0  . -1) (3  . -1)
         (3  . 1) (0 . 1) (4 . 1) (1 . 1) (5 . 1) (2 . 1) (6 . 1)
-       )
+         (6 . -2) (2  . -2) (5 . -2 ) (1  . -2) (4  . -2) (0  . -2) (3 . -2)
+         (3  . 2) (0 . 2) (4 . 2) (2 . 2) (5 . 2) (2 . 2) (6 . 2)
+        )
        breakAlignOrder = #'(
          Instrument_name
          Left_edge_item
index 92e9c30c2f3374235815a9229eef25a2ddce0f9d..b9a895cdc40f4f163ffe9a0a7f283526ecc89d39 100644 (file)
@@ -18,8 +18,11 @@ startGraceMusic = {
     \property Voice.Beam \override #'space-function = #grace-beam-space-function
     \property Voice.Beam \override #'thickness = #0.3
     
-    % must use staff. Accidentals should also be smaller. 
-    \property Staff.fontSize = #-2
+    % 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
 }
 
 stopGraceMusic = {
@@ -34,5 +37,9 @@ stopGraceMusic = {
     \property Voice.Stem \revert #'length
     \property Voice.Stem \revert #'direction    
     
-    \property Staff.fontSize \unset
+    % Can't use Staff.fontSize, since time sigs, keys sigs, etc. will
+    % be smaller as well.
+
+    \property Voice.fontSize \unset
+    \property Staff.LocalKeyItem \revert #'font-relative-size
 }
index 59caa945c286c14f980a52ede99c4ee8c81fb8d7..6a6618c207110dc643b16b4d0d8a873d50a2e8fc 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.5.3
-Entered-date: 29JUL01
+Version: 1.5.4
+Entered-date: 06AUG01
 Description: @BLURB@
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.5.3.tar.gz 
+       1000k lilypond-1.5.4.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.5.3.tar.gz 
+       1000k lilypond-1.5.4.tar.gz 
 Copying-policy: GPL
 End
index d703e0339fad1ed7bc3964b00014e0b1e1b8009d..1aaf025a8dba5bf5ce2ec731c39f47977b7fffc9 100644 (file)
@@ -1,11 +1,11 @@
 %define info yes
 
 Name: lilypond
-Version: 1.5.3
+Version: 1.5.4
 Release: 1
 License: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.3.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.4.tar.gz
 Summary: Create and print music notation 
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 BuildRoot: /tmp/lilypond-install
index 4ee22f615fef45b830e5851811ebb8eb9cf6cb76..60b01fe3c3134c47872894f03a923a15f60e6b28 100644 (file)
 
 Distribution: SuSE Linux 7.0 (i386)
 Name: lilypond
-Version: 1.5.3
+Version: 1.5.4
 Release: 2
 Copyright:    GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.3.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.4.tar.gz
 # music notation software for.. ?
 Summary: A program for printing sheet music.
 URL: http://www.lilypond.org/
index 4c3830a63722e2e8a939954058721f02eb35be5e..977f44e70e1065ad4181632c99f5e4f4030fa8ab 100644 (file)
@@ -311,7 +311,7 @@ Lilypond_skip::str ()
     return "";
 
   String str = "\\skip ";
-  str += Duration_convert::dur2_str (dur) + "; ";
+  str += Duration_convert::dur2_str (dur);
 
   return str;
 }
index aee29cef2b8d6cf4710b8750d77fcc8680e6b515..1f476649a6fd81b09d8fec5e65265a7244a76a82 100644 (file)
@@ -100,7 +100,7 @@ Lilypond_stream::header()
   *os_p_ << filename_str_g;
   *os_p_ << "\n\n";
   // ugh
-  *os_p_ << "\\version \"1.4.0\";\n";
+  *os_p_ << "\\version \"1.4.0\"\n";
 }
 
 void
index 1c9487df19505691e25596816b0ab2a2b09b04b7..7b902765f2ae48e1465af8a2a6ca5a99203b45c4 100644 (file)
@@ -174,16 +174,7 @@ def lily_notename (tuple2):
        (n, a) = tuple2
        nn = chr ((n+ 2)%7 + ord ('a'))
 
-       if a == -1:
-               nn = nn + 'es'
-       elif a == -2:
-               nn = nn + 'eses'
-       elif a == 1:
-               nn = nn + 'is'
-       elif a == 2:
-               nn = nn + 'isis'
-
-       return nn
+       return nn + {-2:'eses', -1:'es', 0:'', 1:'is', 2:'isis'}[a]
 
 
 class Tuplet:
@@ -729,6 +720,10 @@ Add None to LIST until it contains entry number NO.
        return list
 
 def read_finale_value (str):
+       """
+Pry off one value from STR. The value may be $hex, decimal, or "string".
+Return: (value, rest-of-STR)
+       """
        while str and str[0] in ' \t\n':
                str = str[1:]
 
index 1e9a7329b32ac968d6c4c6cea4085434977d5a8a..63ded478b57b27057ea84e88b69dfe8929f3b0d6 100644 (file)
@@ -538,7 +538,8 @@ lily output file in TFILES after that, and return the Latex file constructed.  '
 '''
        
        if extra['pagenumber'] and extra['pagenumber'][-1] and extra['pagenumber'][-1] != 'no':
-               s = s + '\\pagestyle{plain}\n'
+               s = s + '\setcounter{page}{%s}\n' % (extra['pagenumber'][-1])
+                s = s + '\\pagestyle{plain}\n'
        else:
                s = s + '\\pagestyle{empty}\n'