]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.2.10
authorfred <fred>
Tue, 26 Mar 2002 22:26:33 +0000 (22:26 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:26:33 +0000 (22:26 +0000)
30 files changed:
TODO
flower/getopt-long.cc
flower/include/scalar.hh
flower/international.cc
input/bugs/monstrous.ly [new file with mode: 0644]
input/bugs/p.ly [new file with mode: 0644]
input/test/different-time-signatures.ly [new file with mode: 0644]
input/test/hara-kiri.ly
lily/axis-group-element.cc
lily/bar-script-engraver.cc
lily/break-algorithm.cc
lily/column-x-positions.cc
lily/gourlay-breaking.cc
lily/graphical-element.cc
lily/hara-kiri-vertical-group-spanner.cc
lily/include/column-x-positions.hh
lily/include/graphical-element.hh
lily/include/rhythmic-head.hh
lily/include/staff-symbol-referencer.hh
lily/note-column.cc
lily/note-head.cc
lily/paper-column.cc [new file with mode: 0644]
lily/rest.cc
lily/rhythmic-head.cc
lily/staff-side.cc
lily/staff-symbol-referencer.cc
lily/stem.cc
lily/tie.cc
lily/word-wrap.cc
midi2ly/mudela-staff.cc

diff --git a/TODO b/TODO
index 48a1b492359920a06dade2bb4f24abbcc44fb7fa..694d39e90e7c40734549c13c3952fd42b72665f7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,12 +10,35 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 
 .* TODO
 . * use Rhythmic_head::position_i () for all Staff_referenced 
-. * sleur.ly. * rerun profile
-. * mmrests
+. * Depracate Wordwrap
+. * rerun profile
 . * Break_req handling is silly (break_forbid () + \break fucks up.)
 . * script engraver
 . * HaraKiriStaffContext removes bar lines and doesn't remove
     staff margin text on removed staff lines.
+. * Chords:
+.  * Bass/inversion pitch when not part of Chord
+Sometimes a series of changing chords will be blocked out over a static tone
+in the bass, usually this was referred to as a pedal tone (and it's been
+continued to be used, even in contemporary music).  Another less frequently
+used practice is putting a non-chordal tone in the bass (that is not acting
+as a pedal tone) in order to create tension or make a more colorful sound.
+There are examples of this in the classsical literature, but its use is much
+more prevalent today.  For example, the chord sequence Dm7 - Dm7/G is such a
+sequence, and the Dm7/G defies easy classification.  Is it a G7(no 3rd)add
+9/11?  Or is it a G7(no 3rd)add2/4?  Or perhaps Dm7 add11?  It's a heck of a
+lot easier to read to just leave it as Dm7/G!
+.  * Diminished does not mean 5-
+When speaking of a chord, dimished can mean one of two things:  A diminished
+triad or a dimished seventh chord (which is distinctly different from what's
+known as the 'half-diminished' chord).  The triad is a root with a flat
+third and flat fifth, and is notated (at least in America, someone else will
+have to fill me in on other countries) as (using C as the root) Cdim, or Co.
+The diminished seventh has a root with a flat third, flat fifth, and a
+doubly flatted seventh (which is enharmonically equivalent to a sixth, and
+from which comes tons of confusion).  It is usually notated as (again, using
+C as the root) Cdim7 or Co7.
+
 . * Mondrup:
 
 - I would like the possibility of forcing clef- and key- changes to be
@@ -42,8 +65,9 @@ the mensural music notation.
 bar line fully drawn across the staves and after that keep to the
 ChoirStaff bar line types in the rest of the scores
 
-- autoBeamMelisma: if I explicitly beam notes in a staff with auto beaming disabled I
-would like to have these beams also to be melismatic.
+- autoBeamMelisma: if I explicitly beam notes in a staff with auto
+beaming disabled I would like to have these beams also to be
+melismatic.
 
 . * make all Feta (including dynamics) available to the user in
     textual scripts. Examples: "D.S. al \coda", "\mf espress.".
index 0b9a638ae5c8cba34fdcc5e6f894cba94eef26e7..b1e83ef1bd7ad5f1d1fc583901572ed3056bb229 100644 (file)
@@ -16,7 +16,7 @@
 inline char*
 gettext (char const* s)
 {
-  return s;
+  return (char*)s;
 }
 #else
 #include <libintl.h>
index e76841b561099b16b6e27f358702461e9dbc4a9f..b389277bc3bafcae8a49d056b51d1758e54e8a9e 100644 (file)
@@ -35,12 +35,6 @@ struct Scalar : public String
   int to_i () const;
   Real to_f () const;
 
-  /*
-    urg, these are bit silly; perhaps should make "Print_string" class
-    (derive from Scalar?)
-   */
-  Scalar (Vector const &v);
-  Scalar (Matrix const &m);
 
   /**   perl -like string to bool conversion.
    */
index f677ef72b39f45c075f0bbf1a95b95ef8b3604da..6734a49bff81cff2a28997d086ea31650f1e3d39 100644 (file)
@@ -16,7 +16,7 @@
 inline char*
 gettext (char const* s)
 {
-  return s;
+  return (char*)s;
 }
 #else
 #include <libintl.h>
diff --git a/input/bugs/monstrous.ly b/input/bugs/monstrous.ly
new file mode 100644 (file)
index 0000000..52ca689
--- /dev/null
@@ -0,0 +1,20 @@
+
+monstrous= \chords{
+    \property Score.chordInversion = "1"
+
+    % /c is missing:
+    bes-6/c
+
+    % Cdim7 ??
+    cis-3-.5-.6 
+}
+
+\score{
+    <
+       \context ChordNames \monstrous
+       \context Staff \monstrous
+    >
+    \paper{
+       linelength=-1.0\mm;
+    }
+}
diff --git a/input/bugs/p.ly b/input/bugs/p.ly
new file mode 100644 (file)
index 0000000..fb5acbf
--- /dev/null
@@ -0,0 +1,239 @@
+\header {
+  filename =    "praeludium-fuga-E.ly";
+  title =       "praeludium and fuga in E-major";
+  opus =        "BWV 566";
+  composer =    "Johann Sebastian Bach (1685-1750)";
+  enteredby =   "JCN";
+  copyright =   "public domain";
+}
+%{
+  description
+
+  Praeludium 3 bar excerpt,
+       2nd fuga transposed subject -- 4 bar excerpt. 
+        We try to imitate the Griepenkerl/Keller edition which
+       gives the best approximation to Bach's original layout
+
+%}
+%{
+ Tested Features:
+ purpose of this file is testing: 
+   * real-life collisions
+   * multi-voice input --- splitting?
+   * organ staff...
+%}
+
+\version "1.2.0";
+
+
+
+praeludium_commands = \notes {
+  \time 4/4;
+   \key e;
+}
+
+praeludium_right =  \notes {
+  \$praeludium_commands
+  \clef violin;
+
+  % 13 -- how to type -- where to split -- this more neatly?
+  \context Staff <
+    \context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ |
+      \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] |
+      fis4 ~ [fis8 e16 dis] e4 r8 e8 }
+    \context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis |
+      a' ~ [a16 gis a b] \shifton dis,4 cis ~ |
+      [cis8 dis16 ais] bis4 cis r8 b }
+    \context Voice = IV \relative c'' {
+
+      %\stemup
+      %{
+      this is a diversion from the Griepenkerl/Keller
+       edition; a hack to avoid collisions
+      %}
+      \stemdown
+      \shifton s4 gis }
+      
+    \context Voice =  II \relative c' { \stemdown
+%      \shifton       % idem
+
+      r4 fis \shiftoff gis gis |
+      a4. cis8 gis2 |
+      fis4 gis gis r8 e8 }
+  > |
+  % 16
+}
+
+praeludium_left = \notes \relative c {
+  \$praeludium_commands
+  \clef bass;
+
+  % 13
+  \context Staff <
+    \context VoiceTwo { r4 }
+    \context VoiceOne { \stemup s4 dis' cis cis ~ |
+      [cis8 a d cis] [bis gis] cis4 |
+      dis2 cis4 r8 cis }
+    \context VoiceOne { \stemup bis2 }
+    \context VoiceThree { \stemup \shifton r4 gis ~ [gis8 gis] ~ \stemdown \shiftoff gis4 |
+      a4. fis8 gis4. a8 ~ |
+      a4 gis4 gis r8 gis }
+%    { \stemup \shifton s4 fis4 e}
+% a quick hack to avoid some collisons
+    \context VoiceFour { \stemdown \shifton s4 fis4 e}
+    \context VoiceTwo { \stemdown s4 dis4 cis4 }
+  > |
+  %16
+}
+
+praeludium_pedal = \notes \relative c{
+  \$praeludium_commands  
+  \clef bass;
+
+  %13
+  r4 fis,4-\ltoe e4.-\lheel e'8-\rheel | 
+  fis4.-\rtoe fis8-\rtoe fis4-\rtoe [e8-\ltoe a-\rtoe] | 
+  dis,4-\ltoe gis-\rtoe [cis,8-\ltoe b!-\lheel ais-\rtoe gis-\ltoe] |
+  %16
+}
+
+
+fugaII_commands = \notes{
+  \time3/4;
+  \key e;              % E-major
+}
+
+fugaII_right = \notes   \relative c''   {
+  \$fugaII_commands
+  \clef violin;
+
+  %15
+  \context Staff <
+    \context Voice = VA { \stemup [b8 fis8] b4 }
+    \context Voice = VB {  \stemdown fis2 }
+  >
+
+  % Wadieuw
+  \context Staff \notes\relative c''<
+       \context Voice=one {
+         \property Voice.horizontalNoteShift=0
+         \property Voice.verticalDirection=1 
+         e4 
+       }
+       \context Voice=two {
+         \property Voice.verticalDirection=1 
+         \property Voice.horizontalNoteShift=1
+         cis
+       }
+       \context Voice=three {
+         \property Voice.horizontalNoteShift=2
+         \property Voice.verticalDirection=1 
+         ais
+       }
+       \context Voice=four {
+         \property Voice.verticalDirection=-1 
+         \property Voice.horizontalNoteShift=-1
+         fis
+       }
+  >
+
+    %16
+    \context Staff <
+      \context VoiceOne {  dis2 dis4 |
+      cis2 cis4 |
+      b4. [cis8 dis e] }
+    \context VoiceThree {  \stemup \shifton [b8 fis] b2 ~ |
+      [b8 a!16 gis] a2 ~ |
+      a4 gis2 }
+    \context VoiceTwo {  \stemdown fis2. ~ |
+      fis ~ |
+      fis4 e2 }
+  > |
+  %19
+}
+
+fugaII_left = \notes {
+  \$fugaII_commands  
+  \clef bass;
+
+  %15
+  \context Staff < 
+    \context VoiceTwo { \stemdown b2 \stemup ais4 |
+      b2 b4 }
+    \context VoiceTwo { \stemdown s2 e4 |
+      fis2 fis4 }
+  >
+  \stemdown cis2 e4 |
+  b4. b8 b4 |
+  %19
+}
+
+fugaII_pedal = \notes \relative c {
+  \$fugaII_commands  
+  \clef bass;
+
+  %15
+  dis4.-\ltoe e8-\rtoe cis4 |
+  b4.-\lheel [cis8-\ltoe dis8-\rtoe e8-\rheel] |
+  fis4.-\rtoe [e8-\rheel dis8-\rtoe cis8-\ltoe] |
+  dis4-\rtoe e4-\rheel e,4-\ltoe |
+  %19
+}
+
+breakmusic = \notes { 
+  %\time4/4;
+  r1
+}
+
+
+% these should be two separate scores...
+\score{
+  \context Score <
+    \context PianoStaff <
+      \context Staff = treble {
+        \praeludium_right \breakmusic \fugaII_right }
+      \context Staff = bass { 
+        \praeludium_left \breakmusic \fugaII_left }
+    > 
+    \context Staff = pedal {
+      \praeludium_pedal \breakmusic \fugaII_pedal }
+  >
+
+  \paper {
+    \translator {
+    \VoiceContext
+    \name "VoiceOne";
+    verticalDirection = "1";
+    }
+    \translator {
+    \VoiceContext
+    \name "VoiceTwo";
+    verticalDirection = "-1";
+    }
+    \translator {
+    \VoiceContext
+    \name "VoiceThree";
+    verticalDirection = "1";
+    horizontalNoteShift = "1";
+    }
+    \translator {
+    \VoiceContext
+    \name "VoiceFour";
+    verticalDirection = "-1";
+    horizontalNoteShift = "1";
+    }
+   \translator { 
+     \StaffContext 
+     
+     \accepts VoiceFour;
+     \accepts VoiceThree;
+     \accepts VoiceTwo;
+     \accepts VoiceOne;
+   }
+   \translator { \OrchestralScoreContext }
+castingalgorithm = \Wordwrap;
+  }
+
+  \midi {
+    \tempo 4 =96; }
+}
diff --git a/input/test/different-time-signatures.ly b/input/test/different-time-signatures.ly
new file mode 100644 (file)
index 0000000..f7d7624
--- /dev/null
@@ -0,0 +1,24 @@
+\score{
+    <
+       \context Staff=a \notes{
+           \time 3/4;
+           c4 c c | c c c |
+       }
+       \context Staff=b \notes{
+           \time 2/4;
+           c4 c | c c | c c
+       }
+    >
+
+    \paper{
+       linelength = -1.0\cm;
+       \translator{
+           \ScoreContext
+           \remove Timing_engraver;
+       }
+       \translator{
+           \StaffContext
+           \consists Timing_engraver;
+       }
+    }
+}
index 6d22d559b4cf47592c5d10def61afa18f9fcec67..46e7a599816f4b67ae54ea8b11bc3eabf62d5ac5 100644 (file)
@@ -7,24 +7,24 @@ toeter_i = \notes\relative c <{
        \context Voice = upper { \stemup s1*6 }
        \context Voice = together  { 
 
-       c'''4 c c c \break
+       c'''4^"toet I" c c c 
        d d d d \break
-       R1 \break 
+       R1 
        \context Voice = upper {
                e4 e e e \break }
-       f f f f \break
+       f f f f
        g g g g 
 }>
 
 toeter_ii = \notes \relative c \context Voice = together { 
-       c''4 c c c \break
-       d d d d \break
-       R1 \break
+       c''4^"toet II" c c c 
+       d d d d 
+       R1 
        \context Voice = lower {
                \stemdown 
-               e4 e e e \break
+               e4 e e e 
         }
-       f f f f \break
+       f f f f 
        g g g g
 }
 
@@ -37,14 +37,14 @@ zager = \context Staff = zager \notes \relative c'' {
        \clef treble;
        \property Staff.instrument = "Zager"
        \property Staff.instr = "Zag."
-       c4 d e f \break
+       c4^"zag" d e f 
        \property Staff.instr = "Zag. \& Zog."
-       f e d c \break
-       c d e f \break
+       f e d c 
+       c d e f 
        \property Staff.instr = "Zag."
        \stemup
-       f e d c \break
-       c d e f \break
+       f e d c 
+       c d e f 
        f e d c
 }
 
@@ -52,14 +52,14 @@ zoger = \context Staff = zoger \notes \relative c'' {
        \clef treble;
        \property Staff.instrument = "Zoger"
        \property Staff.instr = "Zog."
-       c4 d e f \break
+       c4^"zog" d e f 
        \skip 1*2;
 
        \translator Staff=zager
        \stemdown 
        c2 g2
        
-       a4 b c d \break
+       a4 b c d 
        \skip 1*1;
 }
 
@@ -78,7 +78,7 @@ zagers = \context GrandStaff <
                >
        >
        \paper{
-               linewidth = 40.0\mm;
+               linewidth = 80.0\mm;
                \translator { \HaraKiriStaffContext }
 %uh?
                \translator { \OrchestralScoreContext }
index 1fa40edda0842fcf6911b04cc4e4be052c548214..a0ea8abb995594add49b27ec4856dc08cd1b7496 100644 (file)
@@ -35,6 +35,7 @@ Axis_group_element::get_children ()
 {
   Link_array<Score_element> childs;
   Link_array<Score_element> elems = elem_l_arr ();
+
   elems.concat (extra_elems_ );
   for (int i=0; i < elems.size (); i++) 
     {
index 53721f811fb91cdf324eb4e356ad0d10f4db0a14..f5bfcacd91748766e9f451d6a2a4a2089c0101d0 100644 (file)
@@ -59,7 +59,7 @@ Bar_script_engraver::do_acknowledge_element (Item *i)
 
       /*
        How do we make sure that staff_side_p_ has a dependency from
-       someone else? We can't use i for that,  so we use some other element.
+       someone else? We can't use I for that,  so we use some other element.
        */
       // staff_side_p_->set_elt_property (dangling_scm_sym, SCM_BOOL_T)
       get_staff_info ().command_pcol_l ()->add_dependency (staff_side_p_);
index 32450301f83389ccbca4afc2d7fd28ef9148a5a5..51486412c9bcbe3612d0b129c08a82e43ffaa901 100644 (file)
@@ -9,14 +9,12 @@
 #include "score-column.hh"
 #include "break.hh"
 #include "paper-def.hh"
-#include "spring-spacer.hh"
 #include "debug.hh"
 #include "line-of-score.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
 #include "cpu-timer.hh"
 #include "command-request.hh"
-#include "spring-spacer.hh"
 #include "simple-spacer.hh"
 
 
@@ -62,13 +60,7 @@ Break_algorithm::find_breaks () const
 Line_spacer*
 Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) const
 {
-  Real r = pscore_l_->paper_l_->get_var ("simple_spacing_solver");
-    
-  Line_spacer * sp = 0;
-  if (r)
-    sp = new Simple_spacer;
-  else
-    sp = new Spring_spacer;
+  Line_spacer * sp =  new Simple_spacer;
   
   sp->default_space_f_ = pscore_l_->paper_l_->get_var ("loose_column_distance");
 
index 988cf4f054e2410d2b5685821dfc57026726b70c..15fc02faae90f0af949258ff955424ea68f2cbb3 100644 (file)
@@ -9,7 +9,6 @@
 #include "column-x-positions.hh"
 #include "real.hh"
 #include "debug.hh"
-#include "vector.hh"
 #include "line-spacer.hh"
 
 Column_x_positions::Column_x_positions()
@@ -36,8 +35,6 @@ Column_x_positions::print() const
 #ifndef NPRINT
   DOUT << "energy : " << energy_f_ << '\n';
   DOUT << "line of " << config_.size() << " cols\n";
-  Vector v (config_);
-  DOUT << v;
 #endif
 }
 
@@ -49,12 +46,6 @@ Column_x_positions::OK() const
 #endif
 }
 
-void
-Column_x_positions::set_stupid_solution(Vector v)
-{
-  energy_f_ = infinity_f;
-  config_ = v;
-}
 
 void
 Column_x_positions::stupid_solution()
index de9da6836d6a0e02cd5067e7a1b057a3adef0e56..562d06391e94b8a004426a35bfd16973b2bc1f4a 100644 (file)
@@ -8,11 +8,11 @@
 
 #include "gourlay-breaking.hh"
 #include "column-x-positions.hh"
-#include "spring-spacer.hh"
 #include "debug.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
 #include "paper-def.hh"
+#include "line-spacer.hh"
 
 #include "killing-cons.tcc"
 
index ca2cec91376292f3da251ce3d9df61cb393d38fb..d0e55a553d259c9bf57eff86e7e6f6fd1f1bc815 100644 (file)
@@ -71,17 +71,12 @@ Graphical_element::set_empty (bool b, Axis a1, Axis a2)
 }
 
 /**
-   Return true if empty in either direction.
+   Return true if empty in both A1  direction and A2 dir.
  */
 bool
-Graphical_element::empty_b (Axis a1, Axis a2)
+Graphical_element::empty_b (Axis a)
 {
-  bool b = false;
-  if (a1 != NO_AXES)
-    b = b || dim_cache_[a1]->empty_b ();
-  if (a2 != NO_AXES)
-    b = b || dim_cache_[a2]->empty_b ();
-  return b;
+  return dim_cache_[a]->empty_b ();
 }
 
 Interval
@@ -104,8 +99,6 @@ Graphical_element::do_print () const
 #endif
 }
 
-
-
 void
 Graphical_element::invalidate_cache (Axis a)
 {
index 1c05020ec3a1fb59d6851e8e5acc10ee2e55bb7b..4b09a5d8a76efc183152923166c087c998099f4d 100644 (file)
@@ -33,8 +33,12 @@ Hara_kiri_group_spanner::do_post_processing ()
   Link_array<Score_element> childs = get_children ();
   for (int i = 0; i < childs.size (); i++)
     {
-      childs[i]->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-      childs[i]->set_empty (true, X_AXIS, Y_AXIS);
+      Score_element* s = childs[i];
+
+      if ( line_l () != s->line_l ())
+       programming_error ("Killing other children too");
+      s->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+      s->set_empty (true, X_AXIS, Y_AXIS);
 
     }
   set_empty (true);
@@ -43,6 +47,7 @@ Hara_kiri_group_spanner::do_post_processing ()
 void
 Hara_kiri_group_spanner::do_substitute_element_pointer (Score_element*o, Score_element*n)
 {
+  Axis_group_spanner::do_substitute_element_pointer (o,n);
   if (Item *it = dynamic_cast<Item *> (o))
     interesting_items_.substitute (it, dynamic_cast<Item *> (n));
 }
index 254ae882a7ce4b209d3997398633f2ebbfbdb531..2807eca851a84d790f75afd09704d63d54398cea 100644 (file)
@@ -27,7 +27,6 @@ struct Column_x_positions {
   /** generate a solution with no regard to idealspacings or
     constraints.  should always work */
   void stupid_solution();
-  void set_stupid_solution (Vector);
   Column_x_positions();
   void add_paper_column (Paper_column*c);
   void print() const;
index 41c9e0994c28b51e091712452d260ee90853b9f6..eeb2582688e929c131373ee4c192b70f2301383f 100644 (file)
@@ -33,7 +33,7 @@ public:
      Set empty in direction a1 and a2.  If an argument is NO_AXES, it is ignored.
    */
   void set_empty (bool b, Axis a1 = NO_AXES, Axis a2 = NO_AXES);
-  bool empty_b (Axis a1 = NO_AXES, Axis a2 = NO_AXES);
+  bool empty_b (Axis a1);
   Graphical_element ();
   Graphical_element (Graphical_element const&);
   virtual ~Graphical_element ();
index e516b2cdc5ac16f6eed518fe126e1eebdb288c08..7f792787dba2555b682333ec1560970598d8e2f0 100644 (file)
@@ -26,7 +26,7 @@ public:
   Rhythmic_head ();
 
   int dots_i ()const;
-  virtual int position_i () const;
+  virtual Real position_f () const;
 protected:
   virtual void do_post_processing ();
   virtual void do_pre_processing ();
index c64381c8d52f2e67d718c389156e8550c76e4849..f768269c5b90d57e33d1b532c50054a846de00a0 100644 (file)
@@ -30,7 +30,7 @@ public:
   int lines_i () const;
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
 
-  virtual int position_i () const;
+  virtual Real position_f () const;
 };
 
 #endif /* STAFF_SYM_REFERENCER_HH */
index da70a533f13c228e42e2a4d713240db6fccd1c8e..ab26d7b48d25e596807056087bf096909061e580 100644 (file)
@@ -51,7 +51,7 @@ Note_column::head_positions_interval() const
   iv.set_empty ();
   for (int i=0; i <head_l_arr_.size ();i ++)
     {
-      int j = head_l_arr_[i]->position_i ();
+      int j = int (head_l_arr_[i]->position_f ());
       iv.unite (Slice (j,j));
     }
   return iv;
index 8ea7cb460dc1d4ea95c9390c6f2770b79cff30d6..3c13d1ae1c128b242c043ca2ff8196e3d0b84024 100644 (file)
@@ -33,7 +33,7 @@ Note_head::do_pre_processing ()
   if (balltype_i_ > 2)
     balltype_i_ = 2;
   if (dots_l_)                 // move into Rhythmic_head?
-    dots_l_->position_i_ = position_i ();
+    dots_l_->position_i_ = int (position_f ());
 }
 
 
@@ -41,7 +41,7 @@ Note_head::do_pre_processing ()
 int
 Note_head::compare (Note_head *const  &a, Note_head * const &b)
 {
-  return a->position_i () - b->position_i ();
+  return sign(a->position_f () - b->position_f ());
 }
 
 /**
@@ -61,9 +61,9 @@ Note_head::do_brew_molecule_p() const
   Real inter_f = staff_line_leading_f ()/2;
   int sz = lines_i ()-1;
 
-  int streepjes_i = abs (position_i ()) < sz 
+  int streepjes_i = abs (position_f ()) < sz 
     ? 0
-    : (abs(position_i ()) - sz) /2;
+    : (abs(position_f ()) - sz) /2;
 
 
   String type; 
@@ -79,7 +79,7 @@ Note_head::do_brew_molecule_p() const
 
   if (streepjes_i) 
     {
-      Direction dir = (Direction)sign (position_i ());
+      Direction dir = (Direction)sign (position_f ());
       Interval hd = out->dim_[X_AXIS];
       Real hw = hd.length ()/4;
       
@@ -87,7 +87,7 @@ Note_head::do_brew_molecule_p() const
        = lookup_l ()->ledger_line  (Interval (hd[LEFT] - hw,
                                               hd[RIGHT] + hw));
       
-      int parity =  abs(position_i ()) % 2;
+      int parity =  abs(int (position_f ())) % 2;
       
       for (int i=0; i < streepjes_i; i++)
        {
diff --git a/lily/paper-column.cc b/lily/paper-column.cc
new file mode 100644 (file)
index 0000000..f31d29d
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+  paper-column.cc -- implement Paper_column
+
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "paper-column.hh"
+#include "paper-score.hh"
+#include "debug.hh"
+
+void
+Paper_column::add_rod (Paper_column * p, Real d)
+{
+  Direction dir =  Direction (sign (p->rank_i ()  - rank_i ()));
+  
+  if (!dir)
+    {
+      programming_error ("Must set minimum distance between differing columns.");
+      return;
+    }
+  
+  for (int i=0; i < minimal_dists_arr_drul_[dir].size (); i++)
+    {
+      Column_rod &rod = minimal_dists_arr_drul_[dir][i];
+      if (rod.other_l_ == p)
+       {
+         rod.distance_f_ = rod.distance_f_ >? d;
+         return ;
+       }
+    }
+
+  Column_rod cr;
+  cr.distance_f_ = d;
+  cr.other_l_ = p;
+
+  minimal_dists_arr_drul_[dir].push (cr);
+}
+
+void
+Paper_column::add_spring (Paper_column * p, Real d, Real s)
+{
+  Direction dir =  Direction (sign (p->rank_i ()  - rank_i ()));
+  
+  if (!dir)
+    {
+      warning (_ ("Must set spring between differing columns"));
+      return;
+    }
+  
+  for (int i=0; i < spring_arr_drul_[dir].size (); i++)
+    {
+      Column_spring &spring = spring_arr_drul_[dir][i];
+      if (spring.other_l_ == p)
+       {
+         spring.distance_f_ = spring.distance_f_ >? d;
+         return ;
+       }
+    }
+
+  Column_spring cr;
+  cr.distance_f_ = d;
+  cr.strength_f_ = s;  
+  cr.other_l_ = p;
+
+  spring_arr_drul_[dir].push (cr);
+}
+
+int
+Paper_column::rank_i() const
+{
+  return rank_i_;
+}
+
+void
+Paper_column::set_rank (int i)
+{
+  rank_i_ = i;
+}
+
+void
+Paper_column::do_print() const
+{
+#ifndef NPRINT
+  DOUT << "rank: " << rank_i_ << '\n';
+  Direction d = LEFT;
+  do
+    {
+      for (int i=0; i < minimal_dists_arr_drul_[d].size (); i++)
+       {
+         minimal_dists_arr_drul_[d][i].print ();
+       }
+      for (int i=0; i < spring_arr_drul_[d].size (); i++)
+       {
+         spring_arr_drul_[d][i].print ();
+       }
+      
+    }
+  while ((flip (&d))!=LEFT);
+  Item::do_print ();
+#endif 
+}
+
+bool
+Paper_column::breakpoint_b() const
+{
+  return !line_l_;
+}
+
+Paper_column::Paper_column()
+{
+  set_axes (X_AXIS, X_AXIS);
+
+  line_l_=0;
+  rank_i_ = -1;
+}
+
+Line_of_score*
+Paper_column::line_l() const
+{
+  return line_l_;
+}
+
+
+
+
+Paper_column*
+Paper_column::column_l () const
+{
+  return (Paper_column*)(this);
+}
+
+/*
+  ugh.
+ */
+void
+Paper_column::preprocess ()
+{
+  minimal_dists_arr_drul_[LEFT].sort (Column_rod::compare);
+  minimal_dists_arr_drul_[RIGHT].sort (Column_rod::compare);  
+  spring_arr_drul_[LEFT].sort (Column_spring::compare);
+  spring_arr_drul_[RIGHT].sort (Column_spring::compare);  
+}
index af38a2b0d384e3225772f88645d9f2254d3dc003..daa9ceb5ddfe2780c19559292e340a2d190bb78a 100644 (file)
@@ -46,7 +46,7 @@ Rest::do_brew_molecule_p () const
   bool ledger_b =false;
 
   if (balltype_i_ == 0 || balltype_i_ == 1)
-    ledger_b = abs(position_i ()  - (2* balltype_i_ - 1)) > lines_i (); 
+    ledger_b = abs(position_f ()  - (2* balltype_i_ - 1)) > lines_i (); 
       
 
   
index 00f6cb1df48954b2bb19196e7b00bd748619a239..61ae70ffac1f3039710820d647c20b4f5e2732da 100644 (file)
@@ -30,7 +30,7 @@ Rhythmic_head::do_post_processing ()
 {
   if (dots_l_)
     {
-      dots_l_->position_i_ = position_i ();
+      dots_l_->position_i_ = int (position_f ());
     }
 }
 
@@ -41,10 +41,10 @@ Rhythmic_head::do_pre_processing ()
   position_i_ = 0;
 }
 
-int
-Rhythmic_head::position_i () const
+Real
+Rhythmic_head::position_f () const
 {
-  return position_i_ +  Staff_symbol_referencer::position_i ();
+  return position_i_ +  Staff_symbol_referencer::position_f ();
 }
 
 
index b0cefd1e1b76f5a8f321dc86e50802b21d00884b..bd4d062a98217bab1ec7f5768b0586ffecaebe5e 100644 (file)
@@ -72,6 +72,17 @@ Staff_side_element::position_self ()
       to_position_l_->get_elt_property (transparent_scm_sym) != SCM_BOOL_F)
     return;
 
+  Axis other = Axis ((axis_ + 1) % NO_AXES);
+  if (parent_l (axis_)->empty_b (axis_)
+      &&parent_l (axis_)->empty_b (other)) // guh
+    {
+      warning (_("No support; erasing script"));
+      to_position_l_->set_empty (X_AXIS,Y_AXIS);
+      to_position_l_->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+      set_empty (X_AXIS, Y_AXIS);
+      return ;
+    }
+  
   Interval dim;
   Graphical_element *common = 0;
   if (support_l_arr_.size ())
@@ -102,8 +113,6 @@ Staff_side_element::position_self ()
     : Interval(0,0);
 
   Real off =  relative_coordinate (common, axis_);
-
 
   SCM pad = remove_elt_property (padding_scm_sym);
   if (pad != SCM_BOOL_F)
index aad498bce3b24fb009e90d10c773adf3e5814764..813d8a8b17abd21335f0272724aa0d96dbf1f0e5 100644 (file)
@@ -52,9 +52,8 @@ Staff_symbol_referencer::staff_line_leading_f () const
   return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_realvar (interline_scm_sym);
 }
 
-
-int
-Staff_symbol_referencer::position_i () const
+Real
+Staff_symbol_referencer::position_f () const
 {
   if (!staff_sym_l_ )
     return 0;
@@ -62,5 +61,5 @@ Staff_symbol_referencer::position_i () const
   Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
   Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
 
-  return int (2.0 * y / staff_line_leading_f ());
+  return 2.0 * y / staff_line_leading_f ();
 }
index 15e9fa7ecc417484ee5f436b0da144eecaa5b879..f6f18abbbfc2073ba05166e957f1cb6ac11ede90 100644 (file)
@@ -57,7 +57,7 @@ Stem::head_positions () const
   Interval_t<int> r;
   for (int i =0; i < head_l_arr_.size (); i++)
     {
-      int p = head_l_arr_[i]->position_i ();
+      int p = (int)head_l_arr_[i]->position_f ();
       r[BIGGER] = r[BIGGER] >? p;
       r[SMALLER] = r[SMALLER] <? p;
     }
@@ -229,10 +229,10 @@ Stem::set_noteheads ()
     head_l_arr_.top ()->set_elt_property (extremal_scm_sym, SCM_BOOL_T);
   
   int parity=1;
-  int lastpos = beginhead->position_i ();
+  int lastpos = int (beginhead->position_f ());
   for (int i=1; i < head_l_arr_.size (); i ++)
     {
-      int dy =abs (lastpos- head_l_arr_[i]->position_i ());
+      int dy =abs (lastpos- (int)head_l_arr_[i]->position_f ());
 
       if (dy <= 1)
        {
@@ -242,7 +242,7 @@ Stem::set_noteheads ()
        }
       else
        parity = 1;
-      lastpos = head_l_arr_[i]->position_i ();
+      lastpos = int (head_l_arr_[i]->position_f ());
     }
 }
 
index eeaf89fa984794989c00582f6d0fa78476aa82e4..bdc3089f64749fba3bf69b824961a9ca70f8eaf9 100644 (file)
@@ -37,8 +37,8 @@ Tie::Tie()
 Direction
 Tie::get_default_dir () const
 {
-  int m = (head_l_drul_[LEFT]->position_i () 
-         + head_l_drul_[RIGHT]->position_i ()) /2;
+  int m = int (head_l_drul_[LEFT]->position_f () 
+              + head_l_drul_[RIGHT]->position_f ()) /2;
 
   /*
     If dir is not determined: inverse of stem: down
@@ -151,11 +151,12 @@ Tie::do_post_processing()
         for smal slurs
    */
 
-  int ypos_i = head_l_drul_[LEFT] ? head_l_drul_[LEFT]->position_i ()
-    : head_l_drul_[RIGHT]->position_i ();
-
-  Real y_f = internote_f * ypos_i; 
+  Real ypos = head_l_drul_[LEFT] ? head_l_drul_[LEFT]->position_f ()
+    : head_l_drul_[RIGHT]->position_f ();
 
+  Real y_f = internote_f * ypos; 
+  int ypos_i = int (ypos);
   Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
   if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
     {
index 7091b65980df17f07199783685dbbf59b61d5232..cf6a95e9febcba39e3280f8608ce2b27a1a7ed6b 100644 (file)
@@ -11,7 +11,7 @@
 #include "paper-score.hh"
 #include "debug.hh"
 #include "paper-column.hh"
-#include "spring-spacer.hh"
+#include "line-spacer.hh"
 
 
 /** El stupido.  Add a measure until we're past the optimum.
index edba0e1bc4e586a2f647430038fc8dee4faef5b3..6440d180b94de64e817f7a1d4d630c941f0c47a6 100644 (file)
@@ -72,22 +72,26 @@ Mudela_staff::eat_voice (Cons_list<Mudela_item>& items)
       for (Cons<Mudela_item> *cp = i; cp && cp->car_->at_mom () == mom; cp = cp->next_)
        now_items.push (i->car_);
 
-      Mudela_item * which = 0;
       Mudela_note * last_note = dynamic_cast<Mudela_note*> (voice_p->last_item_l_);
+      Link_array<Mudela_item> candidates; 
 
-      for (int i=0; !which && last_note && i < now_items.size (); i++)
+      for (int i=0; last_note && i < now_items.size (); i++)
        {
          Mudela_note * now_note = dynamic_cast<Mudela_note*> (now_items[i]);
          if (now_note && last_note->channel_i_ != now_note->channel_i_)
-           which = now_note;
+           candidates.push (now_note);
+       }
+
+      if (candidates.size())
+       {
+         now_items = candidates;
        }
 
-#if 0
-      // use pitch difference for determining which item to pick.
-      if (!which)
+      Mudela_item * which = 0;
+      if (now_items.size () > 1)
        {
          int mindiff = 100000; // ugh
-         for (int i=0; !which && last_note && i < now_items.size (); i++)
+         for (int i=0; last_note && i < now_items.size (); i++)
            {
              Mudela_note *nt = dynamic_cast<Mudela_note*> (now_items[i]);
              if (!nt)
@@ -104,28 +108,25 @@ Mudela_staff::eat_voice (Cons_list<Mudela_item>& items)
            {
              which =0;
            }
-
        }
-#endif
-      
-      if (!which && now_items.size ())
+      else if (now_items.size () == 1)
        which = now_items[0];
-
       
-
-      if (!which)
+      if (which)
+       {
+         while ((*pp)->car_ != which)
+           pp = &(*pp)->next_;
+      
+         mom += (*pp)->car_->duration_mom ();
+         Cons<Mudela_item>* c = items.remove_cons (pp);
+         voice_p->add_item (c->car_);
+         delete c;
+       }
+      else 
        {
          pp = &(*pp)->next_;
          continue;
        }
-      
-      while ((*pp)->car_ != which)
-       pp = &(*pp)->next_;
-      
-      mom += (*pp)->car_->duration_mom ();
-      Cons<Mudela_item>* c = items.remove_cons (pp);
-      voice_p->add_item (c->car_);
-      delete c;
     }
 }