.* 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
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.".
inline char*
gettext (char const* s)
{
- return s;
+ return (char*)s;
}
#else
#include <libintl.h>
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.
*/
inline char*
gettext (char const* s)
{
- return s;
+ return (char*)s;
}
#else
#include <libintl.h>
--- /dev/null
+
+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;
+ }
+}
--- /dev/null
+\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; }
+}
--- /dev/null
+\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;
+ }
+ }
+}
\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
}
\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
}
\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;
}
>
>
\paper{
- linewidth = 40.0\mm;
+ linewidth = 80.0\mm;
\translator { \HaraKiriStaffContext }
%uh?
\translator { \OrchestralScoreContext }
{
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++)
{
/*
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_);
#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"
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");
#include "column-x-positions.hh"
#include "real.hh"
#include "debug.hh"
-#include "vector.hh"
#include "line-spacer.hh"
Column_x_positions::Column_x_positions()
#ifndef NPRINT
DOUT << "energy : " << energy_f_ << '\n';
DOUT << "line of " << config_.size() << " cols\n";
- Vector v (config_);
- DOUT << v;
#endif
}
#endif
}
-void
-Column_x_positions::set_stupid_solution(Vector v)
-{
- energy_f_ = infinity_f;
- config_ = v;
-}
void
Column_x_positions::stupid_solution()
#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"
}
/**
- 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
#endif
}
-
-
void
Graphical_element::invalidate_cache (Axis a)
{
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);
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));
}
/** 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;
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 ();
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 ();
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 */
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;
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 ());
}
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 ());
}
/**
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;
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;
= 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++)
{
--- /dev/null
+/*
+ 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);
+}
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 ();
{
if (dots_l_)
{
- dots_l_->position_i_ = position_i ();
+ dots_l_->position_i_ = int (position_f ());
}
}
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 ();
}
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 ())
: Interval(0,0);
Real off = relative_coordinate (common, axis_);
-
-
SCM pad = remove_elt_property (padding_scm_sym);
if (pad != SCM_BOOL_F)
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;
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 ();
}
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;
}
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)
{
}
else
parity = 1;
- lastpos = head_l_arr_[i]->position_i ();
+ lastpos = int (head_l_arr_[i]->position_f ());
}
}
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
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"))
{
#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.
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)
{
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;
}
}