]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.19.jcn5: isb
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 10 Jan 1999 21:45:18 +0000 (22:45 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 10 Jan 1999 21:45:18 +0000 (22:45 +0100)
pl 19.jcn5
- interstaff beams v0: see beam-interstaff.ly and wtk1-fugue2.ly

---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.19.jcn4, To = lilypond-1.1.19.jcn5

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.19.jcn5.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.19.jcn4
1.1.19.jcn5
++state

12 files changed:
NEWS
VERSION
input/test/beam-interstaff.ly [new file with mode: 0644]
input/test/beam-isknee.ly [new file with mode: 0644]
lily/beam-engraver.cc
lily/beam.cc
lily/include/beam.hh
lily/include/stem-info.hh
lily/include/stem.hh
lily/stem-engraver.cc
lily/stem-info.cc
mutopia/J.S.Bach/wtk1-fugue2.ly

diff --git a/NEWS b/NEWS
index c394b259e768ca5b6abef845b8a0adff2ad85f0f..7baf3c440b68cff00083c0c7dba3354fac6d2f0b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,12 @@
---- ../lilypond-1.1.19.jcn3/NEWS       Sat Jan  9 16:03:22 1999
+--- ../lilypond-1.1.19.jcn4/NEWS       Sat Jan  9 21:11:06 1999
+++ b/NEWS      Sun Jan 10 22:05:13 1999
+@@ -1,3 +1,6 @@
+pl 19.jcn5
+       - interstaff beams v0: see beam-interstaff.ly and wtk1-fugue2.ly
+
+ pl 19.jcn4
+       - new stem/beam parameters
+       - bf: forced stem shorten--- ../lilypond-1.1.19.jcn3/NEWS       Sat Jan  9 16:03:22 1999
 ++ b/NEWS      Sat Jan  9 21:11:06 1999
 @@ -1,3 +1,7 @@
 pl 19.jcn4
diff --git a/VERSION b/VERSION
index 198de8d0d55b36a2327a64eaa5d42d43247bd043..705b1d3fb39a162708f2fd17e80992be62cdfbe8 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=19
-MY_PATCH_LEVEL=jcn4
+MY_PATCH_LEVEL=jcn5
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/beam-interstaff.ly b/input/test/beam-interstaff.ly
new file mode 100644 (file)
index 0000000..65e0a5d
--- /dev/null
@@ -0,0 +1,31 @@
+\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{
+               \translator{
+                       \GrandStaffContext
+                       minVerticalAlign = 2.5*\staffheight;
+                       maxVerticalAlign = 2.5*\staffheight;
+               }
+               linewidth=-1.;
+       }
+}
diff --git a/input/test/beam-isknee.ly b/input/test/beam-isknee.ly
new file mode 100644 (file)
index 0000000..45a5e4b
--- /dev/null
@@ -0,0 +1,22 @@
+\score{
+       \type GrandStaff <
+       \type Staff=one \notes\relative c'{
+               s1
+       }
+       \type Staff=two \notes\relative c'{
+               \clef bass;
+% no knee
+               \stemup [c8 \translator Staff=one \stemdown g'16 f]
+               s8
+               s2
+       }
+       >
+       \paper{
+               \translator{
+                       \GrandStaffContext
+                       minVerticalAlign = 2.8*\staffheight;
+                       maxVerticalAlign = 2.8*\staffheight;
+               }
+               linewidth=-1.;
+       }
+}
index 7353da47f8738ce684fef026628b0307646a2520..a2f315962b75ccaba6cd1a1231737de76ae32cdd 100644 (file)
@@ -63,6 +63,20 @@ 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;
+
+      prop = get_property ("maxVerticalAlign", 0);
+      if (prop.isnum_b ())
+       {
+         beam_p_->vertical_align_f_ += (Real)prop;
+         beam_p_->vertical_align_f_ /= (Real)2;
+       }
+
       announce_element (Score_element_info (beam_p_, reqs_drul_[START]));
     }
 }
index 6e2e3b4641e778d6b0cc4f3e685c1f99f313c31b..af118cb5dddc8ee3b339b4cb628278f42ab76822 100644 (file)
@@ -77,6 +77,10 @@ Beam::do_brew_molecule_p () const
   mol_p->translate_axis (x0 
     - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
 
+  // correct if last note (and therefore reference point of beam)
+  // is on different staff
+  mol_p->translate_axis (- sinfo_.top ().interstaff_f_ * internote_f, Y_AXIS);
+
   return mol_p;
 }
 
@@ -229,13 +233,20 @@ Beam::check_stemlengths_f (bool set_b)
   for (int i=0; i < sinfo_.size (); i++)
     {
       Real y = sinfo_[i].x_ * slope_f_ + left_y_;
+
       // correct for knee
       if (dir_ != sinfo_[i].dir_)
-       y -= dir_ * (beam_f / 2
-                     + (sinfo_[i].mult_i_ - 1) * interbeam_f) / internote_f;
+       {
+         y -= dir_ * (beam_f / 2
+                      + (sinfo_[i].mult_i_ - 1) * interbeam_f) / internote_f;
+         if (!i && sinfo_[i].stem_l_->staff_sym_l_ !=
+             sinfo_.top ().stem_l_->staff_sym_l_)
+           y += dir_ * (multiple_i_ - (sinfo_[i].stem_l_->flag_i_ - 2) >? 0)
+             * interbeam_f / internote_f;
+       }
 
       if (set_b)
-       sinfo_[i].stem_l_->set_stemend (y);
+       sinfo_[i].stem_l_->set_stemend (y - sinfo_[i].interstaff_f_);
        
       y *= dir_;
       if (y > sinfo_[i].maxy_f_)
index fa26038d0809cc6a5bccbc229f401f1ae9e441cd..a94b0eba908ae61782ac1841540d6693362da578 100644 (file)
@@ -40,6 +40,9 @@ public:
   /// maximum number of beams (for opening-up of beam-spacing)
   int multiple_i_;
 
+  /// vertical align distance between staffs
+  Real vertical_align_f_;
+
   Array<Stem_info> sinfo_;
   
   Beam();
index 695a2c88fc9cd91eb3ee3445147997aedb86dcc8..14d39426e3167317958d40a656c12b4b57f92ec6 100644 (file)
@@ -20,6 +20,7 @@ struct Stem_info {
   Real miny_f_;
   Real maxy_f_;
   int mult_i_;
+  Real interstaff_f_;
   Stem* stem_l_;
 
   Stem_info ();
index 267be4f67a217639f58ba514679d57ae3c87d4b8..81f4617bf94d7b62d7ab1ba282ca360f579d5916 100644 (file)
@@ -76,7 +76,10 @@ public:
 
   /// direction of the beam
   Direction beam_dir_;
-    
+
+  /// what staff am i on?
+  Staff_symbol* staff_sym_l_;    
+
   Stem ();
     
   /// ensure that this Stem also encompasses the Notehead #n#
index ae32b12ba185af882beb69b7c9895c5aae0b6c4d..07998e448f26573002792eedc9ca4aa622e7b382 100644 (file)
@@ -13,6 +13,7 @@
 #include "duration-convert.hh"
 #include "misc.hh"
 #include "abbrev.hh"
+#include "staff-info.hh"
 
 Stem_engraver::Stem_engraver()
 {
@@ -45,6 +46,7 @@ Stem_engraver::acknowledge_element(Score_element_info i)
          int durlog_i = r->duration_.durlog_i_;
          stem_p_->flag_i_ = durlog_i;
 
+         stem_p_->staff_sym_l_ = get_staff_info ().staff_sym_l_;
          
          if (abbrev_req_l_)
            {
index 370efcfadc42526359cef4f2b441aa556d663cf7..a25535b8dc0df82c94ec337c4e2bc6d224ff73a9 100644 (file)
@@ -15,6 +15,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "stem-info.hh"
+#include "beam.hh"
 
 Stem_info::Stem_info ()
 {
@@ -27,6 +28,7 @@ Stem_info::Stem_info (Stem*s)
   dir_ = stem_l_->dir_;
   beam_dir_ = stem_l_->beam_dir_;
   mult_i_ = stem_l_->mult_i_;
+  interstaff_f_ = 0;
 
   Paper_def* paper_l = stem_l_->paper ();
   Real internote_f = paper_l->internote_f ();
@@ -77,6 +79,8 @@ Stem_info::Stem_info (Stem*s)
     /* knee */
     {
       idealy_f_ -= beam_f;
+      // idealy_f_ -= (mult_i_ - 1) * interbeam_f;
+      // idealy_f_ += (mult_i_ - stem_l_->flag_i_ >? 0) * interbeam_f;
       maxy_f_ = idealy_f_;
       miny_f_ = -INT_MAX;
 
@@ -97,5 +101,21 @@ Stem_info::Stem_info (Stem*s)
 
   idealy_f_ = maxy_f_ <? idealy_f_;
   idealy_f_ = miny_f_ >? idealy_f_;
+
+  // interstaff beam
+  Beam* beam_l_ = stem_l_->beam_l_;
+  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;
+      idealy_f_ += interstaff_f_ * beam_dir_;
+      miny_f_ += interstaff_f_ * beam_dir_;
+      maxy_f_ += interstaff_f_ * beam_dir_;
+    }
 }
 
index 7d2239f96864f2c213c13a7ba0fc349e02c75708..946ffbe4d795a07dce0d3b385cb03a6168c0c949 100644 (file)
@@ -45,20 +45,22 @@ dux = \notes \relative c''{
 %%10   
   as4 r8 a [bes bes16 a] [bes8 f] |
   g4 r8 g [as as g f] |
+  r8 
   \translator Staff = bass \stemup 
-   r8 [as, bes c ] r8 [as16 g] [as8 f8] |
+  [as, bes c ] r8 [as16 g] [as8 f8] |
   [bes8 c  bes as] [bes g f es] |
   [f des'  c  bes] [c  as g f] |
 %%15
   g8
-   \translator Staff = treble \stemdown
-   [g'16 fis] [g8 c,] [es g16 fis!] [g8 a] |
+  [g'16 fis] [g8 c,] 
+  [es \translator Staff = treble \stemdown g16 fis!] [g8 a] |
   [d, g16 fis] [g8 a!] [c,16 d] es4 [d16 c] |         % forced accident!
   bes8 r8 r16 [d e fis] [g a bes8] ~ [bes16 e, f g] |
   [a bes c8] ~ [c16 fis,16 g a] [bes8 es,!16 d] [es8 g, ] |
   [as  f'16 es] [f8 a,8] [bes  g'16 f] [g8 b, ] |
 %%20
-  [c16 f es d] [c bes! as g] [f8 as' g f] |
+  [c16 f \translator Staff = bass \stemup es d] [c bes! as g] 
+  [f8 \translator Staff = treble \stemdown as' g f] |
   [es d es f] [b, c d b] |
   c4 r8 e8 [f f16 e] [f8 c] |
   d4 r8 d8 [es8 es16 d] [es8 bes] |
@@ -144,7 +146,8 @@ bassdux = \notes \relative c' {
   [f d'16 c ] [d8 fis,] g4 r16 [g, a b] |
   [c16 d es8~] [es16 a, bes c] [d es f8~] [f16 b,  c d] |
 %%20    
-  es8 r r e [f f, es! d] |                           % -> \classic_accidentals
+%   es8 r r e [f f, es! d] |                           % -> \classic_accidentals
+  es8 r r e \stemdown [f f, es! d] \stemboth |
   r [as' g f] [g f16 es] [f8 g] |
   [c16 d  es d] [c bes as g] [f bes' as g] [f es d c] |
   [bes c d c] [bes as g f] [es as' g f] [es d c bes] |
@@ -188,7 +191,13 @@ bassdux = \notes \relative c' {
     %hmm
 %    \translator { \BarNumberingScoreContext }
 %    \translator { \BarNumberingStaffContext }
-  \translator{ \OrchestralScoreContext }
+%  \translator{ \OrchestralScoreContext }
+    \translator{ \OrchestralScoreContext }
+    \translator{ 
+      \GrandStaffContext
+      minVerticalAlign = 3.0*\staffheight;
+      maxVerticalAlign = 3.0*\staffheight;
+    }
   }
   \header{
          opus = "BWV 847";