+pl 18.jcn5
+ - bf: beamtrend
+ - bf: vv-duet
+
+pl 18.mb1
+ - \mark now works, using G_staff_side_item.
+ - Improved layout of multi-bar rests, including a new
+ font symbol.
+
+pl 18.jcn4
+ - beam length adjustments
+ - ugly beamtrend fix: input/test/beam-trend.ly
+
+pl 18.jcn3
+ - bf: (beamed) forced stem shorten
+ - bf: broken slurs and ties; minimal slur/tie length setting ignored
+ - bf: separators on cygwin
+
+pl 18.jcn2
+ - bf: stem-length algorithm
+ - bf: beam direction algorithm
+ - bf's: wtk1-fugue2.ly
+
+pl 18.jcn1
+ - stepmake update
+ - small fixes: spacing.ly, wtk1-fugue2-ly, violino-viola duet.
+
+*******
+pl 18 (jan 4 '99)
+
pl 17.jbr2
- Documentation/README-W32: Brought my stuff up to date
- Documentation/ntweb: updated for realease
%
% enum Dir_algorithm { DOWN=-1, UP=1, MAJORITY=2, MEAN, MEDIAN };
%
-beam_dir_algorithm = 2.0;
+DOWN = -1.0;
+UP = 1.0;
+MAJORITY = 2.0;
+MEAN = 3.0;
+MEDIAN = 4.0;
+% [Ross]: majority
+beam_dir_algorithm = \MAJORITY;
%
%
% beam_*2 : multiplicity >= beam_multiple_break
%
beam_multiple_break = 3.0;
-beam_minimum_stem1 = 1.5 * \interline;
-beam_minimum_stem2 = 1.0 * \interline;
-beam_ideal_stem1 = 2.0 * \interline;
-beam_ideal_stem2 = 1.5 * \interline;
+beam_minimum_stem1 = 0.75 * \interline;
+beam_ideal_stem1 = 1.75 * \interline;
+beam_minimum_stem2 = 0.75 * \interline;
+beam_ideal_stem2 = 1.25 * \interline;
% beam_slope_damp_correct_factor = 2.0;
beam_slope_damp_correct_factor = 0.0;
--- /dev/null
+\score{
+ \notes\relative c'' {
+ <
+ \property Voice.textstyle = "large" s4^"Moderato"
+ r4
+ >
+ }
+}
#include "paper-def.hh"
#include "lookup.hh"
#include "grouping.hh"
-#include "stem-info.hh"
-
-
-
Beam::Beam ()
{
transparent_b_ = true;
return ;
}
- solve_slope ();
+ calculate_slope ();
set_stemlens ();
}
} while (flip(&d) != DOWN);
+#if 0
+ /*
+ urg? consider [b''16 a]: will get stem down!
+ i'll leave this 'fix' commented-out in case something breaks.
+ jcn
+ */
do {
if (!total[d])
count[d] = 1;
} while (flip(&d) != DOWN);
+#endif
/*
[Ross] states that the majority of the notes dictates the
/*
See Documentation/tex/fonts.doc
*/
+
void
-Beam::solve_slope ()
+Beam::solve_slope (Array<Stem_info>& sinfo)
{
/*
should use minimum energy formulation (cf linespacing)
*/
-
- assert (multiple_i_);
- Array<Stem_info> sinfo;
+ assert (sinfo.size () > 1);
DOUT << "Beam::solve_slope: \n";
- for (int j=0; j <stems_.size (); j++)
- {
- Stem *i = stems_[j];
- i->mult_i_ = multiple_i_;
- i->set_default_extents ();
- if (i->invisible_b ())
- continue;
+ Real staffline_f = paper ()->rule_thickness ();
+ Real epsilon_f = staffline_f / 8;
- Stem_info info (i);
- sinfo.push (info);
- }
- if (! sinfo.size ())
- slope_f_ = left_y_ = 0;
- else if (sinfo.size () == 1)
+ Real leftx = sinfo[0].x_;
+ Least_squares l;
+ for (int i=0; i < sinfo.size (); i++)
{
- slope_f_ = 0;
- left_y_ = sinfo[0].idealy_f_;
+ sinfo[i].x_ -= leftx;
+ l.input.push (Offset (sinfo[i].x_, sinfo[i].idealy_f_));
}
- else
- {
- Real leftx = sinfo[0].x_;
- Least_squares l;
- for (int i=0; i < sinfo.size (); i++)
- {
- sinfo[i].x_ -= leftx;
- l.input.push (Offset (sinfo[i].x_, sinfo[i].idealy_f_));
- }
- l.minimise (slope_f_, left_y_);
-
- }
+ // l.input[0].y () += left_y_;
+ l.input[0].y () += left_y_ / 2;
+ l.minimise (slope_f_, left_y_);
solved_slope_f_ = dir_ * slope_f_;
perhaps only if slope = 0 ?
*/
-// left_y_ = sinfo[0].minyf_;
+ if (abs (slope_f_) < epsilon_f)
+ left_y_ = (sinfo[0].idealy_f_ + sinfo.top ().idealy_f_) / 2;
+ else
+ /*
+ symmetrical, but results often in having stemlength = minimal
+
+ left_y_ = sinfo[0].dir_ == dir_ ? sinfo[0].miny_f_ : sinfo[0].maxy_f_;
- if (sinfo.size () >= 1)
+ what about
+ */
{
- Real staffline_f = paper ()->rule_thickness ();
- Real epsilon_f = staffline_f / 8;
- if (abs (slope_f_) < epsilon_f)
- left_y_ = (sinfo[0].idealy_f_ + sinfo.top ().idealy_f_) / 2;
+ Real dx = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
+ if (sinfo[0].dir_ == sinfo.top ().dir_)
+ left_y_ = sinfo[0].idealy_f_ >? sinfo.top ().idealy_f_ - slope_f_ * dx;
+ // knee
else
- /*
- symmetrical, but results often in having stemlength = minimal
-
- left_y_ = sinfo[0].dir_ == dir_ ? sinfo[0].miny_f_ : sinfo[0].maxy_f_;
-
- what about
- */
- {
- Real dx = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
- if (sinfo[0].dir_ == sinfo.top ().dir_)
- left_y_ = sinfo[0].idealy_f_ >? sinfo.top ().idealy_f_ - slope_f_ * dx;
- // knee
- else
- left_y_ = sinfo[0].idealy_f_;
- }
+ left_y_ = sinfo[0].idealy_f_;
}
+}
- // uh?
+Real
+Beam::check_stemlengths_f (Array<Stem_info>& sinfo)
+{
+ /*
+ find shortest stem and adjust left_y accordingly
+ */
Real dy = 0.0;
for (int i=0; i < sinfo.size (); i++)
{
if (my - y > dy)
dy = my -y;
}
- left_y_ += dy;
+ return dy;
+}
+
+void
+Beam::calculate_slope ()
+{
+ Real interline_f = paper ()->interline_f ();
+ Real staffline_f = paper ()->rule_thickness ();
+ Real epsilon_f = staffline_f / 8;
+
+ assert (multiple_i_);
+ Array<Stem_info> sinfo;
+ for (int i=0; i < stems_.size (); i++)
+ {
+ Stem *s = stems_[i];
+
+ s->mult_i_ = multiple_i_;
+ s->set_default_extents ();
+ if (s->invisible_b ())
+ continue;
+
+ Stem_info info (s);
+ sinfo.push (info);
+ }
+
+ if (! sinfo.size ())
+ slope_f_ = left_y_ = 0;
+ else if (sinfo.size () == 1)
+ {
+ slope_f_ = 0;
+ left_y_ = sinfo[0].idealy_f_;
+ }
+ else
+ {
+ Real y;
+ Real s;
+ Array <Stem_info> local_sinfo;
+ local_sinfo = sinfo;
+ for (int i = 0; i < 5; i++)
+ {
+ y = left_y_;
+ solve_slope (sinfo);
+ Real dy = check_stemlengths_f (sinfo);
+ left_y_ += dy;
+
+ // only consider recalculation if long stem adjustments
+ if (!i && (left_y_ - sinfo[0].idealy_f_ < 0.5 * interline_f))
+ break;
+
+ if (!i)
+ s = slope_f_;
+ // never allow slope to tilt the other way
+ else if (sign (slope_f_) != sign (s))
+ {
+ left_y_ = 0;
+ slope_f_ = 0;
+ sinfo = local_sinfo;
+ Real dy = check_stemlengths_f (sinfo);
+ left_y_ += dy;
+ break;
+ }
+ // or become steeper
+ else if (abs (slope_f_) > abs (s))
+ {
+ slope_f_ = s;
+ sinfo = local_sinfo;
+ Real dy = check_stemlengths_f (sinfo);
+ left_y_ += dy;
+ break;
+ }
+ if (abs (dy) < epsilon_f)
+ break;
+ }
+ }
+
left_y_ *= dir_;
slope_f_ *= dir_;
void
G_staff_side_item::do_post_processing ()
{
+ if (!support_l_arr_.size ())
+ return ;
+
Dimension_cache *common = common_group (typecast_array (support_l_arr_, (Graphical_element*)0),
Y_AXIS);
#include "engraver.hh"
+class G_staff_side_item;
+class G_text_item;
+
/**
*/
class Mark_engraver : public Engraver
virtual bool do_try_music (Music *req_l);
virtual void do_process_requests ();
virtual void do_pre_move_processing ();
+ virtual void acknowledge_element (Score_element_info);
private:
Mark_req * mark_req_l_;
- Script* script_p_;
+ G_staff_side_item* staff_side_p_;
+ G_text_item* text_p_;
};
#endif // MARK_ENGRAVER_HH
#include "command-request.hh"
#include "time-description.hh"
#include "engraver-group.hh"
-
+#include "staff-sym.hh"
+#include "g-text-item.hh"
+#include "g-staff-side.hh"
+#include "stem.hh"
+#include "rhythmic-head.hh"
ADD_THIS_TRANSLATOR (Mark_engraver);
Mark_engraver::Mark_engraver ()
{
mark_req_l_ = 0;
- script_p_ = 0;
+ staff_side_p_ = 0;
+ text_p_ = 0;
}
bool
void
Mark_engraver::do_process_requests ()
{
- if (!mark_req_l_ || script_p_)
+ if (!mark_req_l_ || staff_side_p_)
return;
- script_p_ = new Script;
- script_p_->breakable_b_ = true;
+ staff_side_p_ = new G_staff_side_item;
- Text_def *td_p = new Text_def;
+ text_p_ = new G_text_item;
- td_p->text_str_ = mark_req_l_->str_;
- td_p->align_dir_ = CENTER;
+ text_p_->text_str_ = mark_req_l_->str_;
+ // text_p_->align_dir_ = CENTER;
- td_p->style_str_ = td_p->text_str_.index_any_i ("0123456789") >= 0
+ text_p_->style_str_ = text_p_->text_str_.index_any_i ("0123456789") >= 0
? "mark" : "Large";
- script_p_->dir_ = LEFT;
- script_p_->specs_p_ = td_p->clone ();
- script_p_->postbreak_only_b_ = true;
-
- Scalar padding = get_property ("markScriptPadding", 0);
- if (padding.length_i() && padding.isnum_b ())
+ Scalar prop = get_property ("markdir", 0);
+ if (prop.isnum_b ())
{
- script_p_->padding_f_ = Real(padding);
+ staff_side_p_->dir_ = (Direction) (int) prop;
}
- Scalar break_priority = get_property ("markBreakPriority", 0);
- if (break_priority.length_i() && break_priority.isnum_b ())
+ else
{
- script_p_->break_priority_i_ = int(break_priority);
+ staff_side_p_->dir_ = UP;
}
+ staff_side_p_->set_victim(text_p_);
- announce_element (Score_element_info (script_p_, mark_req_l_));
+ // Scalar padding = get_property ("markScriptPadding", 0);
+ // if (padding.length_i() && padding.isnum_b ())
+ // {
+ // script_p_->padding_f_ = Real(padding);
+ // }
+ // Scalar break_priority = get_property ("markBreakPriority", 0);
+ // if (break_priority.length_i() && break_priority.isnum_b ())
+ // {
+ // staff_side_p_->break_priority_i_ = int(break_priority);
+ // }
+
+
+ announce_element (Score_element_info (text_p_, mark_req_l_));
+ announce_element (Score_element_info (staff_side_p_, mark_req_l_));
}
void
Mark_engraver::do_pre_move_processing ()
{
- if (script_p_)
+ if (staff_side_p_)
{
- typeset_element (script_p_);
- script_p_ = 0;
+ Staff_symbol* s_l = get_staff_info().staff_sym_l_;
+ staff_side_p_->add_support (s_l);
+ typeset_element (text_p_);
+ typeset_element (staff_side_p_);
+ text_p_ = 0;
+ staff_side_p_ = 0;
mark_req_l_ = 0;
}
}
+void
+Mark_engraver::acknowledge_element (Score_element_info i)
+{
+ if (staff_side_p_)
+ {
+ if (dynamic_cast<Stem *> (i.elem_l_) ||
+ dynamic_cast<Rhythmic_head *> (i.elem_l_))
+ {
+ staff_side_p_->add_support (i.elem_l_);
+ }
+ }
+}
#include "script.hh"
#include "text-def.hh"
#include "molecule.hh"
-
+#include "misc.hh"
Multi_measure_rest::Multi_measure_rest ()
* make real multi-measure rest symbol: |---|
* make two,four,eight-measure-rest symbols
*/
-
- Atom s (lookup_l ()->rest (0, 0));
+ Atom s;
+ if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
+ {
+ s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+ }
+ else
+ {
+ s = (lookup_l ()->rest (-4, 0));
+ }
Molecule* mol_p = new Molecule ( Atom (s));
Real interline_f = paper ()->interline_f ();
- mol_p->translate_axis (interline_f, Y_AXIS);
+ if (measures_i_ == 1)
+ {
+ mol_p->translate_axis (interline_f, Y_AXIS);
+ }
if (measures_i_ > 1)
{
Text_def text;
text.text_str_ = to_str (measures_i_);
text.style_str_ = "number";
+ text.align_dir_ = CENTER;
Atom s = text.get_atom (paper (), UP);
s.translate_axis (3.0 * interline_f, Y_AXIS);
mol_p->add_atom (s);
breve_rest_y# = interline#;
breve_rest_x# = 3/5 interline#;
+multi_rest_x# = 2 interline#;
+multi_rest_y# = 1/3 interline#;
-define_pixels(breve_rest_y, breve_rest_x);
+define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
fet_beginchar("breve rest", "-1", "breverest");
set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
fet_endchar;
+fet_beginchar("multi rest", "-4", "multirest");
+ set_char_box(multi_rest_x#, multi_rest_x#,
+ breve_rest_y#, breve_rest_y#);
+ draw_block ((-multi_rest_x, -multi_rest_y),
+ (multi_rest_x, multi_rest_y));
+ draw_block ((-multi_rest_x,-breve_rest_y),
+ (rthin-multi_rest_x, breve_rest_y));
+ draw_block ((multi_rest_x-rthin,-breve_rest_y),
+ (multi_rest_x, breve_rest_y));
+fet_endchar;
fet_beginchar("Quarter rest","2","quartrest");
save alpha;
--- /dev/null
+\header{
+filename = "viola-part.ly";
+title = "Vier Duette";
+description = "Four duets for Violino and Violoncello (Viola)";
+opus = "BWV";
+composer = "Johann Sebastian Bach (1685-1750)";
+enteredby = "jcn";
+copyright = "Public Domain";
+}
+
+\include "global-i.ly"
+\include "viola-i.ly"
+
+\score{
+ \$viola_i_staff
+ \paper{
+ \translator { \BarNumberingStaffContext }
+ }
+ \midi{
+%urg
+% \tempo 4. = 69;
+ \tempo 4 . = 69;
+ }
+}
+
\header{
filename = "violino-i.ly";
title = "Vier Duette";
-description = "For duets for Violino and Violoncello (Viola)";
+description = "Four duets for Violino and Violoncello (Viola)";
opus = "BWV";
composer = "Johann Sebastian Bach (1685-1750)";
enteredby = "jcn";
$violino_i_staff = \type Staff = violino <
<
- \notes\property Voice.textstyle = "large" s4^"Moderato"
+ %urg
+ % \notes\property Voice.textstyle = "large" s4^"Moderato"
+ % \notes {s4. \property Voice.textstyle = "large" s4^"Moderato"}
\$violino_i
>
\$global_i
--- /dev/null
+\header{
+filename = "violino-part.ly";
+title = "Vier Duette";
+description = "Four duets for Violino and Violoncello (Viola)";
+opus = "BWV";
+composer = "Johann Sebastian Bach (1685-1750)";
+enteredby = "jcn";
+copyright = "Public Domain";
+}
+
+\include "global-i.ly"
+\include "violino-i.ly"
+
+\score{
+ \$violino_i_staff
+ \paper{
+ \translator { \BarNumberingStaffContext }
+ }
+ \midi{
+%urg
+% \tempo 4. = 69;
+ \tempo 4 . = 69;
+ }
+}
+
--- /dev/null
+\header{
+filename = "violoncello-part.ly";
+title = "Vier Duette";
+description = "Four duets for Violino and Violoncello (Viola)";
+opus = "BWV";
+composer = "Johann Sebastian Bach (1685-1750)";
+enteredby = "jcn";
+copyright = "Public Domain";
+}
+
+\include "global-i.ly"
+\include "violoncello-i.ly"
+
+\score{
+ \$violoncello_i_staff
+ \paper{
+ \translator { \BarNumberingStaffContext }
+ }
+ \midi{
+%urg
+% \tempo 4. = 69;
+ \tempo 4 . = 69;
+ }
+}
+
\include "nederlands.ly" % for correct parsing of note names
global = \notes {
+ \key c \minor;
\time 4/4;
- \keysignature bes es as;
+ \property Staff.timeSignatureStyle = "C"
\skip 1*31;
\bar "|."; |
}
-dux = \notes \relative c'' {
+dux = \notes \relative c''{
+ \voicetwo
\clef violin;
\property Voice.ydirection = "-1"
comes = \notes \relative c'' {
- \stemup
-
+ \voiceone
r1 |
r1 |
r8 [g'16 fis] [g8 c,] [es g16 fis] [g8 a] |
%%10
[f f16 e] [f8 c8] d4 r8 d |
[es8 es16 d] [es8 bes ] [c es16 d] [es8 f] |
- \stemboth [bes, es16 d] [es8 f] [as,16 bes ] c4 [bes16 as ] |
- [g16 es f g] [as bes c d] [es d c d] [es f g a] |
+ [bes, es16 d] [es8 f] [as,16 bes ] c4 [bes16 as ] |
+ \stemboth [g16 es f g] [as bes c d] [es d c d] [es f g a] |
[bes f, g as] [bes c d e] [f es d es] [ f g a b] |
%%15
\stemup [c8 b16 a] [g f! es d] [c8 es d c] |
g4 r4 r16 [g a b] [c d es f] |
[g f as g] [f es d c] [b8 c16 b] [c8 g] |
[as c16 b] [c8 d] [g, c16 b] [c8 d] |
- [f16 g] as4 [g16 f] es4 r8 es |
- [d c g g]
+ [f,16 g] as4 [g16 f] es4 r8 es' |
+ [d c g' g,]
%%30
+ %urg
+ %using only \type Staff or \voiceone/two don't work anymore?
+ %moreover, the ties are not fooled by this anymore
\type Staff <
- { \stemup c2 ~ | c1 ~ | c1 }
- { \stemdown c,2 ~ | c1 ~ | c1 }
+ {\voiceone c2 ~ | c1 ~ | c1 }
+ {\voicetwo c,2 ~ | c1 ~ | c1 }
>
}
>
\paper {
- gourlay_maxmeasures =5.;
-% castingalgorithm = \Wordwrap;
-
+ gourlay_maxmeasures = 4.;
+ indent = 8.\mm;
+ textheight = 295.\mm;
+
+ %hmm
+% \translator { \BarNumberingScoreContext }
+% \translator { \BarNumberingStaffContext }
+ \translator{ \OrchestralScoreContext }
+ }
+ \header{
+ opus = "BWV 847";
}
\midi {
(define (settypewriter s) (text "typewriter" s))
(define (setnumber s) (text "number" s))
(define (setbold s) (text "bold" s))
+(define (setlarge s) (text "large" s))
+(define (setLarge s) (text "Large" s))
+(define (setmark s) (text "mark" s))
(define (setfinger s) (text "finger" s))
(define (setitalic s) (text "italic" s))
(define (setnumber-1 s) (text "numberj" s))