From: fred Date: Tue, 26 Mar 2002 22:26:33 +0000 (+0000) Subject: lilypond-1.2.10 X-Git-Tag: release/1.5.59~2141 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=89d2e0d4f6d1dcbb69abf80e25b4259be07e06aa;p=lilypond.git lilypond-1.2.10 --- diff --git a/TODO b/TODO index 48a1b49235..694d39e90e 100644 --- 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.". diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 0b9a638ae5..b1e83ef1bd 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -16,7 +16,7 @@ inline char* gettext (char const* s) { - return s; + return (char*)s; } #else #include diff --git a/flower/include/scalar.hh b/flower/include/scalar.hh index e76841b561..b389277bc3 100644 --- a/flower/include/scalar.hh +++ b/flower/include/scalar.hh @@ -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. */ diff --git a/flower/international.cc b/flower/international.cc index f677ef72b3..6734a49bff 100644 --- a/flower/international.cc +++ b/flower/international.cc @@ -16,7 +16,7 @@ inline char* gettext (char const* s) { - return s; + return (char*)s; } #else #include diff --git a/input/bugs/monstrous.ly b/input/bugs/monstrous.ly new file mode 100644 index 0000000000..52ca68966f --- /dev/null +++ b/input/bugs/monstrous.ly @@ -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 index 0000000000..fb5acbf510 --- /dev/null +++ b/input/bugs/p.ly @@ -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 index 0000000000..f7d7624d57 --- /dev/null +++ b/input/test/different-time-signatures.ly @@ -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; + } + } +} diff --git a/input/test/hara-kiri.ly b/input/test/hara-kiri.ly index 6d22d559b4..46e7a59981 100644 --- a/input/test/hara-kiri.ly +++ b/input/test/hara-kiri.ly @@ -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 } diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index 1fa40edda0..a0ea8abb99 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -35,6 +35,7 @@ Axis_group_element::get_children () { Link_array childs; Link_array elems = elem_l_arr (); + elems.concat (extra_elems_ ); for (int i=0; i < elems.size (); i++) { diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index 53721f811f..f5bfcacd91 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -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_); diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index 32450301f8..51486412c9 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -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"); diff --git a/lily/column-x-positions.cc b/lily/column-x-positions.cc index 988cf4f054..15fc02faae 100644 --- a/lily/column-x-positions.cc +++ b/lily/column-x-positions.cc @@ -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() diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index de9da6836d..562d06391e 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -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" diff --git a/lily/graphical-element.cc b/lily/graphical-element.cc index ca2cec9137..d0e55a553d 100644 --- a/lily/graphical-element.cc +++ b/lily/graphical-element.cc @@ -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) { diff --git a/lily/hara-kiri-vertical-group-spanner.cc b/lily/hara-kiri-vertical-group-spanner.cc index 1c05020ec3..4b09a5d8a7 100644 --- a/lily/hara-kiri-vertical-group-spanner.cc +++ b/lily/hara-kiri-vertical-group-spanner.cc @@ -33,8 +33,12 @@ Hara_kiri_group_spanner::do_post_processing () Link_array 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 (o)) interesting_items_.substitute (it, dynamic_cast (n)); } diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh index 254ae882a7..2807eca851 100644 --- a/lily/include/column-x-positions.hh +++ b/lily/include/column-x-positions.hh @@ -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; diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh index 41c9e0994c..eeb2582688 100644 --- a/lily/include/graphical-element.hh +++ b/lily/include/graphical-element.hh @@ -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 (); diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index e516b2cdc5..7f792787db 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -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 (); diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index c64381c8d5..f768269c5b 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -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 */ diff --git a/lily/note-column.cc b/lily/note-column.cc index da70a533f1..ab26d7b48d 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -51,7 +51,7 @@ Note_column::head_positions_interval() const iv.set_empty (); for (int i=0; i position_i (); + int j = int (head_l_arr_[i]->position_f ()); iv.unite (Slice (j,j)); } return iv; diff --git a/lily/note-head.cc b/lily/note-head.cc index 8ea7cb460d..3c13d1ae1c 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -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 index 0000000000..f31d29d30e --- /dev/null +++ b/lily/paper-column.cc @@ -0,0 +1,144 @@ +/* + paper-column.cc -- implement Paper_column + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#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); +} diff --git a/lily/rest.cc b/lily/rest.cc index af38a2b0d3..daa9ceb5dd 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -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 (); diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 00f6cb1df4..61ae70ffac 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -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 (); } diff --git a/lily/staff-side.cc b/lily/staff-side.cc index b0cefd1e1b..bd4d062a98 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -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) diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index aad498bce3..813d8a8b17 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -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 (); } diff --git a/lily/stem.cc b/lily/stem.cc index 15e9fa7ecc..f6f18abbbf 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -57,7 +57,7 @@ Stem::head_positions () const Interval_t 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] 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 ()); } } diff --git a/lily/tie.cc b/lily/tie.cc index eeaf89fa98..bdc3089f64 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -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")) { diff --git a/lily/word-wrap.cc b/lily/word-wrap.cc index 7091b65980..cf6a95e9fe 100644 --- a/lily/word-wrap.cc +++ b/lily/word-wrap.cc @@ -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. diff --git a/midi2ly/mudela-staff.cc b/midi2ly/mudela-staff.cc index edba0e1bc4..6440d180b9 100644 --- a/midi2ly/mudela-staff.cc +++ b/midi2ly/mudela-staff.cc @@ -72,22 +72,26 @@ Mudela_staff::eat_voice (Cons_list& items) for (Cons *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 (voice_p->last_item_l_); + Link_array 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 (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 (now_items[i]); if (!nt) @@ -104,28 +108,25 @@ Mudela_staff::eat_voice (Cons_list& 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* 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* c = items.remove_cons (pp); - voice_p->add_item (c->car_); - delete c; } }