]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.20.jcn1: patsje
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 11 Jan 1999 17:02:53 +0000 (18:02 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 11 Jan 1999 17:02:53 +0000 (18:02 +0100)
pl 20.jcn1
- interstaff slurs v0: preludes-1.ly
- warnings for silly interbeam settings

18 files changed:
NEWS
TODO
VERSION
input/test/beam-interstaff.ly
input/test/slur-interstaff.ly [new file with mode: 0644]
lily/beam-engraver.cc
lily/beam.cc
lily/bow.cc
lily/encompass-info.cc
lily/include/beam.hh
lily/include/bow.hh
lily/include/direction.hh
lily/include/slur.hh
lily/include/stem.hh
lily/slur-engraver.cc
lily/slur.cc
lily/stem-info.cc
mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly

diff --git a/NEWS b/NEWS
index 5df616f269f75219977acd39d246cffa8bdd8b57..50c2ba76d9b000e8ea9469087283fb8625b7ab20 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+pl 20.jcn1
+       - interstaff slurs v0: preludes-1.ly
+       - warnings for silly interbeam settings
+
 pl 20
 
 
diff --git a/TODO b/TODO
index f01020231fc983a1dd2a926509386a0c999b93fd..31ee656807a304b91eb52e14f57e87f8667e3a47 100644 (file)
--- a/TODO
+++ b/TODO
@@ -47,10 +47,16 @@ BUGS:
 
        * fix:  cello suites
 
+       * fix:  petites preludes (rediculous dims)
+
        * fix extender
 
+       * fix fingering 'a-5': font direction broken *again*
+
        * fix braces
 
+       * multibar rests: SkipBars=0
+
        * ly2dvi barfs on linewidth = -1.
 
        * fix midi output.
@@ -585,10 +591,6 @@ SMALLISH PROJECTS
 
        * handle EOF graciously in error messages.
 
-       * really centered whole rest
-
-       * centered multi-bar-rest
-
        * declare notenametab?
 
        * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
diff --git a/VERSION b/VERSION
index d648aa51004efbf4dd570f66d9896d7d9e5e11b4..f5155c60a8688fd3be255eefd0dc9661b2362a25 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=20
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 65e0a5d2c2b4c83b2c4f827266dbda265c31dc89..d09e796c21d9d89849788fcf2f1b2b2426619605 100644 (file)
@@ -23,8 +23,8 @@
        \paper{
                \translator{
                        \GrandStaffContext
-                       minVerticalAlign = 2.5*\staffheight;
-                       maxVerticalAlign = 2.5*\staffheight;
+                       minVerticalAlign = 3.0*\staffheight;
+                       maxVerticalAlign = 3.0*\staffheight;
                }
                linewidth=-1.;
        }
diff --git a/input/test/slur-interstaff.ly b/input/test/slur-interstaff.ly
new file mode 100644 (file)
index 0000000..2d6ccbf
--- /dev/null
@@ -0,0 +1,33 @@
+\score{
+       \type GrandStaff <
+       \type Staff=one \notes\relative c'{
+               \stemup c8( c \translator Staff=two \stemup c )c
+               r2
+               \translator Staff=one
+               \stemdown c8( c \translator Staff=two \stemup c )c
+               r2
+               \stemdown c8( c \translator Staff=one \stemdown c )c
+               r2
+               \translator Staff=two
+               \stemup c8( c \translator Staff=one \stemdown c )c
+               r2
+       }
+       \type Staff=two \notes\relative c'{
+               \clef bass;
+               s1
+               s1
+               s1
+               s1
+       }
+       >
+       \paper{
+               % no slur damping
+               slur_slope_damping = 10.0;
+               \translator{
+                       \GrandStaffContext
+                       minVerticalAlign = 3.0*\staffheight;
+                       maxVerticalAlign = 3.0*\staffheight;
+               }
+               linewidth=-1.;
+       }
+}
index 3165cf66607c863992c029adb4a2182d3526ae41..0b2e9af0919ff87a7db3c198e82f71b72ebb80c7 100644 (file)
@@ -63,19 +63,15 @@ Beam_engraver::do_process_requests ()
       if (prop.isnum_b ()) 
        beam_p_->quantisation_ = (Beam::Quantisation)(int)prop;
  
-      // silly try at interstaff beam
       // must set minVerticalAlign == maxVerticalAlign to get sane results
       // see input/test/beam-interstaff.ly
       prop = get_property ("minVerticalAlign", 0);
       if (prop.isnum_b ())
-       beam_p_->vertical_align_f_ = prop;
+       beam_p_->vertical_align_drul_[MIN] = prop;
 
       prop = get_property ("maxVerticalAlign", 0);
       if (prop.isnum_b ())
-       {
-         beam_p_->vertical_align_f_ += (Real)prop;
-         beam_p_->vertical_align_f_ /= (Real)2;
-       }
+       beam_p_->vertical_align_drul_[MAX] = prop;
 
       announce_element (Score_element_info (beam_p_, reqs_drul_[START]));
     }
index af118cb5dddc8ee3b339b4cb628278f42ab76822..90476e1e9f4b3acaed60ffe8341a0482f199a557 100644 (file)
@@ -41,6 +41,8 @@ Beam::Beam ()
   damping_i_ = 1;
   quantisation_ = NORMAL;
   multiple_i_ = 0;
+  vertical_align_drul_[MIN] = 0;
+  vertical_align_drul_[MAX] = -1;
 }
 
 void
index 935eae60b3930c28a8c0020c54b9211d61c1bd79..66c1bfd5628eae1df82174df2c98ad3c2575a2e6 100644 (file)
@@ -22,6 +22,9 @@ Bow::Bow ()
   dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
   dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
   dash_i_ = 0;
+  interstaff_f_ = 0;
+  vertical_align_drul_[MIN] = 0;
+  vertical_align_drul_[MAX] = -1;
 }
 
 Molecule*
@@ -54,6 +57,7 @@ Bow::do_brew_molecule_p () const
 
   Molecule* mol_p = new Molecule;
   mol_p->add_atom (a);
+  mol_p->translate_axis (-interstaff_f_, Y_AXIS);
 
   return mol_p;
 }
index 1a352c49a76c677c876482babe55414830695135..f8854f0292dd91443fcf8e6987efac77a03799ea 100644 (file)
@@ -12,6 +12,9 @@
 #include "note-column.hh"
 #include "paper-def.hh"
 #include "encompass-info.hh"
+#include "slur.hh"
+#include "staff-sym.hh"
+#include "debug.hh"
 
 Encompass_info::Encompass_info ()
 {
@@ -26,15 +29,15 @@ Encompass_info::Encompass_info (Note_column const* note, Direction dir)
   Real notewidth = paper->note_width () * 0.8;
   Real internote = interline / 2;
 
-  Stem* stem = note->stem_l_;
+  Stem* stem_l_ = note->stem_l_;
   /* 
     set o_.x () to middle of notehead or on the exact position of stem,
     according to slur direction
    */
-  o_.x () = stem->hpos_f ();
+  o_.x () = stem_l_->hpos_f ();
 
   /*
-     stem->dir == dir
+     stem_l_->dir == dir
                       ________
            |   |     /        \
           x|  x|       |x  |x
@@ -42,16 +45,39 @@ Encompass_info::Encompass_info (Note_column const* note, Direction dir)
 
    */
 
-  if (stem->dir_ != dir)
-    o_.x () -= 0.5 * notewidth * stem->dir_;
+  if (stem_l_->dir_ != dir)
+    o_.x () -= 0.5 * notewidth * stem_l_->dir_;
 
-  o_.y () = stem->extent (Y_AXIS)[dir];
+  o_.y () = stem_l_->extent (Y_AXIS)[dir];
   /*
    leave a gap: slur mustn't touch head/stem
    */
   o_.y () += 2.5 * internote * dir;
 
-  if (stem->dir_ != dir)
+  if (stem_l_->dir_ != dir)
     o_.y () += 1.0 * internote * dir;
-}
 
+  Slur* slur_l_ = stem_l_->slur_l_;
+  if (slur_l_->encompass_arr_.size ()
+      && stem_l_->staff_sym_l_ != slur_l_->encompass_arr_[0]->stem_l_->staff_sym_l_)
+    {
+      if (stem_l_->staff_sym_l_->dim_cache_[Y_AXIS].valid_b ())
+       {
+         slur_l_->interstaff_f_ = stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS)
+           - slur_l_->encompass_arr_[0]->stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS);
+       }
+      else
+       {
+         warning (_ ("invalid dimension cache: guessing staff position"));
+         if (slur_l_->vertical_align_drul_[MIN] != 
+             slur_l_->vertical_align_drul_[MAX])
+           warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff slurs may be broken"));
+         slur_l_->interstaff_f_ = slur_l_->vertical_align_drul_[MIN];
+         // urg, guess staff order:
+         // if our stem ends higher, our staff is probably lower...
+         if (stem_l_->chord_start_f () > slur_l_->encompass_arr_[0]->stem_l_->chord_start_f ())
+           slur_l_->interstaff_f_ *= -1;
+       }
+      o_.y () += slur_l_->interstaff_f_;
+    }
+}
index a94b0eba908ae61782ac1841540d6693362da578..1e4bf9d0b9e1d5180d80b05ff618834363b99131 100644 (file)
@@ -41,7 +41,7 @@ public:
   int multiple_i_;
 
   /// vertical align distance between staffs
-  Real vertical_align_f_;
+  Drul_array<Real> vertical_align_drul_;
 
   Array<Stem_info> sinfo_;
   
index e8e8d54dc9d9b1c94bfb03431b88857744b31aac..7a59b7fdf45a226a39d62522b9fe475592010ed2 100644 (file)
@@ -26,6 +26,8 @@ public:
   
 
   int dash_i_;
+  Real interstaff_f_;
+  Drul_array<Real> vertical_align_drul_;
 
 protected:
   virtual Molecule* do_brew_molecule_p () const;
index 45f574b83a8bc83e8db9f7c3dc484971cc7cf460..ea6adf88c0eb3d99ba45b41ebcba22d6f1ae8830 100644 (file)
@@ -18,6 +18,8 @@ enum Direction
   DOWN=-1,
   LEFT=-1,
   RIGHT=1,
+  MIN=-1,
+  MAX=1,
   CENTER=0,
   SMALLER=-1,
   BIGGER=1,
index 491150c877d1b3f531fd8a7e7d4f6dbdb8d71632..30123a335b1a23b8de06ee112c5d55c06755e947 100644 (file)
 class Slur : public Bow
 {
 public:
-  Link_array<Note_column> encompass_arr_;
-  void add_column (Note_column*);
-
   Slur ();
-
   VIRTUAL_COPY_CONS(Score_element);
+
+  void add_column (Note_column*);
   
+  Link_array<Note_column> encompass_arr_;
 
 protected:
   virtual Array<Offset> get_encompass_offset_arr () const;
index 81f4617bf94d7b62d7ab1ba282ca360f579d5916..34e829d634ae8a00d1b13faac35ced2a8936b44f 100644 (file)
@@ -63,6 +63,9 @@ public:
    */
   Beam* beam_l_;
 
+  /// our slur (urg)
+  Slur* slur_l_;
+
   Drul_array<int> beams_i_drul_;
 
   /// maximum number of beams
index e0e4253f8601508cf925bb759d717bd4f6158989..9a6b20b38cc540c623dffaba1adaa43b664f20fd 100644 (file)
@@ -78,6 +78,15 @@ Slur_engraver::do_process_requests()
          Scalar prop = get_property ("slurdash", 0);
          if (prop.isnum_b ()) 
            s_p->dash_i_ = prop;
+
+         prop = get_property ("minVerticalAlign", 0);
+         if (prop.isnum_b ())
+           s_p->vertical_align_drul_[MIN] = prop;
+
+         prop = get_property ("maxVerticalAlign", 0);
+         if (prop.isnum_b ())
+           s_p->vertical_align_drul_[MAX] = prop;
+
          requests_arr_.push (slur_req_l);
          start_slur_l_arr_.push (s_p);
          announce_element (Score_element_info (s_p, slur_req_l));
index b88c4b5614f3fca46828d040f44c4fc4ba814414..f8a0fc3672654490bc0a9ac953128b7672af47e9 100644 (file)
@@ -30,7 +30,6 @@
 #include "main.hh"
 
 
-
 Slur::Slur ()
 {
 }
@@ -41,6 +40,7 @@ Slur::add_column (Note_column*n)
   if (!n->head_l_arr_.size ())
     warning (_ ("Putting slur over rest."));
   encompass_arr_.push (n);
+  n->stem_l_->slur_l_ = this;
   add_dependency (n);
 }
 
@@ -280,6 +280,7 @@ Slur::get_encompass_offset_arr () const
       Encompass_info info (encompass_arr_[i], dir_);
       notes.push (info.o_ - left);
     }
+  d.y () += interstaff_f_;
   notes.push (d);
 
   return notes;
index a25535b8dc0df82c94ec337c4e2bc6d224ff73a9..dec7ead2f1fc35cd58b473572c426201dff805ed 100644 (file)
@@ -16,6 +16,7 @@
 #include "lookup.hh"
 #include "stem-info.hh"
 #include "beam.hh"
+#include "staff-sym.hh"
 
 Stem_info::Stem_info ()
 {
@@ -107,12 +108,23 @@ Stem_info::Stem_info (Stem*s)
   if (beam_l_->sinfo_.size ()
       && stem_l_->staff_sym_l_ != beam_l_->sinfo_[0].stem_l_->staff_sym_l_)
     {
-      // hmm, perhaps silly now to have vertical_align in Beam
-      interstaff_f_ = beam_l_->vertical_align_f_ / internote_f;
-      // urg, guess staff order:
-      // if our stem ends higher, our staff is probably lower...
-      if (idealy_f_ * beam_dir_ > beam_l_->sinfo_[0].idealy_f_ * beam_dir_)
-       interstaff_f_ *= -1;
+      if (stem_l_->staff_sym_l_->dim_cache_[Y_AXIS].valid_b ())
+       {
+         interstaff_f_ = stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS)
+           - beam_l_->sinfo_[0].stem_l_->staff_sym_l_->absolute_coordinate (Y_AXIS) / internote_f;
+       }
+      else
+       {
+         warning (_ ("invalid dimension cache: guessing staff position"));
+         if (beam_l_->vertical_align_drul_[MIN] != 
+             beam_l_->vertical_align_drul_[MAX])
+           warning (_ ("minVerticalAlign != maxVerticalAlign: interstaff slurs may be broken"));
+         interstaff_f_ = beam_l_->vertical_align_drul_[MIN] / internote_f;
+         // urg, guess staff order:
+         // if our stem ends higher, our staff is probably lower...
+         if (idealy_f_ * beam_dir_ > beam_l_->sinfo_[0].idealy_f_ * beam_dir_)
+           interstaff_f_ *= -1;
+       }
       idealy_f_ += interstaff_f_ * beam_dir_;
       miny_f_ += interstaff_f_ * beam_dir_;
       maxy_f_ += interstaff_f_ * beam_dir_;
index 1c00016cae435a2b6cf9077d2eb2cbde496c0059..bc7bd540d0021e9fa3ab6b0581ffd0e7befc28de 100644 (file)
@@ -14,7 +14,13 @@ copyright =   "public domain";
 
 \version "1.0.14";
 
-one = \notes\relative c {
+% urg, this all changed and was never fixed
+% howto get rid of these ridiculous dimensions????
+% to view the output, subsitute 0.0 with 0.0 in the .tex file...
+
+% one = \type Voice=one \notes\relative c {
+% one = \notes\relative c {
+one = \type Staff=treble \notes\relative c {
        \property Voice . textstyle =  "italic"
        r16\p_"legato"\< [g''-1( c-3 )e-5] r [g,-1( c )e]
        r [g,( c )d] r [b-1( d-2 \!)g-5] |
@@ -34,15 +40,32 @@ one = \notes\relative c {
        r [a, c g'-5] r [a, c f!-4] |
        % ugh arpeggio
        <
-               { \voiceone  f4 r }
-               { \voicetwo  <g,4 d'> r }
+               { \voiceone  f4 r }
+               { \voicetwo  <g,4 d'> r }
        >
        \onevoice 
+       % s
        % ugh beam across staffs slur starts at lower staff
-       r16 [g,-1( b d] |
-       \voiceone 
-       )b s4 [g'16-1( b-2 d] )b s s s [f'-2 g-3 b-5 f-2] |
-       \onevoice 
+%      r16 [g,-1( b d] |
+%      \voiceone 
+%      )b s4 [g'16-1( b-2 d] )b s s s [f'-2 g-3 b-5 f-2] |
+%      \onevoice 
+       \translator Staff=bass\stemup
+       r16 [g,,-5( b-4 d ] 
+       [f-1 \translator Staff=treble\stemdown g16-1 b d] | \stemup )b
+       \translator Staff=bass\stemdown
+       [g-5( b-4 d-2] f-1 
+       \translator Staff=treble\stemup
+       [g16-1 b-2 d] )b
+       \translator Staff=bass\stemup
+       \clef "violin"; 
+       [g-4 b-2 d-1] 
+       \stemup
+       % urg, below translator change affects previous beam too!?
+       % howto separate translator command from previous beam end?
+       \skip 4*0;
+        [\translator Staff=treble f-2 g-3 b-5 f-2] |
+       \stemboth
        [e-1\f c'-5( g-3 f-2] [e-1 c'-5 g-3 e-2] 
        [)d c'-5( f,-3 e-2] [d-1 b'-5 f-3 d-2] |
        [)c b'-5( e,-3 d-2] [c-1 a'-5 e-3 c-2] 
@@ -59,14 +82,16 @@ one = \notes\relative c {
        [es-2 fis-3 a-4 c-5] 
        < 
                { \voiceone  r [c8 b16] }
-               { \voicetwo  [d,8 f-2] }
+               %%% urg urg ?{ \voicetwo  [d,8 f-2] }
        >
        \onevoice  |
        <c1\mf g e>
        \bar "|.";
 }
 
-two = \notes\relative c{
+% two = \notes\relative c{
+% two = \type Voice=three \notes\relative c{
+two = \type Staff=bass \notes\relative c{
        \property Voice . textstyle =  "roman"
        c4-5 e-3 g-\mordent^"(\\textsharp)" g,4 |
        d'-\mordent-5 f-3 a-\mordent^"(\\textsharp)" a,4 |
@@ -76,13 +101,18 @@ two = \notes\relative c{
        f4-1 e d-3-\prall c |
        g'-\mordent^"(\\textsharp)" g, g'-\mordent g, |
        g'-\mordent g, g'-\mordent g, |
-       % ugh f should be at upper staff
-       g'-\mordent r r16 [g,-5( b-4 d] )f-1 s s s |
-       s [g-5( b-4 d-2] )f-1 s s s s \clef "violin"; [g-4 b-2 d-1] 
-       s s s s \clef bass; |
+%      % ugh f should be at upper staff
+%      g'-\mordent r r16 [g,-5( b-4 d] )f-1 s s s |
+%      g'-\mordent r r16 [g,-5( b-4 d \translator Staff=treble )f-1 ] s s s |
+%      \translator Staff=bass
+%      s [g-5( b-4 d-2] )f-1 s s s s \clef "violin"; [g-4 b-2 d-1] 
+%      s s s s \clef bass; |
+       g' r s s | s s s s \clef bass; |
        <
-               { \voiceone  g,,1 ~ g ~ g ~ g ~ g ~ g ~ g }
-               { \voicetwo  g,1 ~ g ~ g ~ g ~ g ~ g ~ g }
+%              { \voiceone  g,,1 ~ g ~ g ~ g ~ g ~ g ~ g }
+%              { \voicetwo  g,1 ~ g ~ g ~ g ~ g ~ g ~ g }
+               { \voicethree  g1 ~ g ~ g ~ g ~ g ~ g ~ g }
+               { \voicefour  g,1 ~ g ~ g ~ g ~ g ~ g ~ g }
        >
        <c,1 c,>
        \bar "|.";
@@ -112,7 +142,19 @@ grand_staff = \type GrandStaff <
 \score{
         % Moderato
        \grand_staff
-       \include "preludes-paper.ly";
+%      \include "preludes-paper.ly";
+       \paper{
+               % no slur damping
+               slur_slope_damping = 10.0;
+       %       linewidth= 193.\mm;
+               linewidth= 180.\mm;
+               gourlay_maxmeasures = 4.0;
+               \translator{ 
+                 \GrandStaffContext
+                 minVerticalAlign = 3.0*\staffheight;
+                 maxVerticalAlign = 3.0*\staffheight;
+               }
+       }
        \midi{ \tempo 4 = 80; }
        \header {
                opus = "BWV 924";