From 4031afe52cc75723f1e757924302331f1c169a20 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 22:23:33 +0000 Subject: [PATCH] lilypond-1.1.57 --- Documentation/metadoc/musicnotes.sty | 1 + Documentation/tex/lilypond-regtest.doc | 16 +++ input/test/beam-extreme.ly | 12 ++ input/test/chord-table.ly | 2 +- input/test/rhythm-melody.fly | 3 +- input/test/rhythm.ly | 4 +- input/test/slur-symmetry-1.ly | 21 ++-- input/test/slur-symmetry-2.ly | 16 +++ input/test/slur-symmetry-3.ly | 15 +++ input/test/slur-symmetry.ly | 22 ++-- input/test/tie.ly | 26 ++--- lily/parser.yy | 20 ++-- lily/sequential-music-iterator.cc | 10 +- lily/tie.cc | 151 +++++++++++++++---------- scm/lily.scm | 4 +- tex/fetdefs.tex | 15 +++ tex/lilyponddefs.tex | 2 + 17 files changed, 222 insertions(+), 118 deletions(-) create mode 100644 input/test/beam-extreme.ly create mode 100644 input/test/slur-symmetry-2.ly create mode 100644 input/test/slur-symmetry-3.ly create mode 100644 tex/fetdefs.tex diff --git a/Documentation/metadoc/musicnotes.sty b/Documentation/metadoc/musicnotes.sty index bc4a69f543..31d2f83a9c 100644 --- a/Documentation/metadoc/musicnotes.sty +++ b/Documentation/metadoc/musicnotes.sty @@ -4,6 +4,7 @@ \def\fetdef#1#2{% \def#1{\hbox{\char#2}}} +% huh? from where \input feta20.sty \font\fetasixteenfont=feta16 diff --git a/Documentation/tex/lilypond-regtest.doc b/Documentation/tex/lilypond-regtest.doc index d774479de6..a92910cdee 100644 --- a/Documentation/tex/lilypond-regtest.doc +++ b/Documentation/tex/lilypond-regtest.doc @@ -70,6 +70,22 @@ hidden just as with breakable bar lines. % % \mud elafile{beam-repeat.ly} +Beams should behave reasonably well, even under extreme circumstances. +Stems may be short, but noteheads should never touch the beam. + +\mudelafile{beam-extreme.ly} + +Slurs should look nice and symmetric. The curvature may increase +only to avoid noteheads, and as little as possible. + +\mudelafile{slur-symmetry.ly} +\mudelafile{slur-symmetry-1.ly} + +Ties are strictly horizontal. They are placed in between note heads. +The horizontal middle should not overlap with a staffline. + +\mudelafile{tie.ly} + Beams can be typeset over fixed distance aligned staffs, beam beautification doesn't really work, but knees do. Beams should be behave well, wherever the switching point is. diff --git a/input/test/beam-extreme.ly b/input/test/beam-extreme.ly new file mode 100644 index 0000000000..4bdb1b0bc7 --- /dev/null +++ b/input/test/beam-extreme.ly @@ -0,0 +1,12 @@ +\score{ + \notes\relative c''{ + [g8 c c,] + [c16 c'' a f] + \stemup + [c,,32 c'' a f] + + } + \paper{ + linewidth=-1.; + } +} diff --git a/input/test/chord-table.ly b/input/test/chord-table.ly index c2b30c2c92..907782915f 100644 --- a/input/test/chord-table.ly +++ b/input/test/chord-table.ly @@ -5,7 +5,7 @@ enteredby = "jcn"; } tab = \notes\transpose c'''\chords{ - c1 c-m c-4 c-m.4 c-5+ c-5- c-m.5- c-5-.5+ c-6\break %c-m6\break + c1 c-m c-4 c-m4 c-5+ c-5- c-m5- c-5-.5+ c-6\break %c-m6\break } \score{ diff --git a/input/test/rhythm-melody.fly b/input/test/rhythm-melody.fly index 7365625e35..9ccd77a4bf 100644 --- a/input/test/rhythm-melody.fly +++ b/input/test/rhythm-melody.fly @@ -1 +1,2 @@ -\rhythm { 4. 8 8. 16 } { c'' d e f } +%\rhythm { 4. 8 8. 16 } { c'' d e f } +\rhythm { c4. c8 c8. c16 } { c'' d e f } diff --git a/input/test/rhythm.ly b/input/test/rhythm.ly index c4125e26a3..4fe37cb585 100644 --- a/input/test/rhythm.ly +++ b/input/test/rhythm.ly @@ -1,5 +1,7 @@ \score{ \context Voice \notes\relative c''{ - c4. 8 4. 8 + % still thinking 'bout this + %c4. 8 4. 8 + c4. c8 c4. c8 } } diff --git a/input/test/slur-symmetry-1.ly b/input/test/slur-symmetry-1.ly index 4811a63d4c..6e2ea7c67b 100644 --- a/input/test/slur-symmetry-1.ly +++ b/input/test/slur-symmetry-1.ly @@ -1,15 +1,14 @@ -\header{ -% should look the same -title="symmetry"; -} \score{ - \notes\relative c'{ - [g'8( e )c' g,] r2 - \break - [d''8( f )a, d'] r2 - } + \notes\relative c''< + \time 4/4; + \context Staff{ + f8(f f)f f(g g)f f(a a)f f(b b)f + } + \context Staff=x{ + e,(e e)e e(d d)e e(c c)e e(b b)e + } + > \paper{ - castingalgorithm = \Wordwrap; - linewidth = 50.0\mm; + linewidth=-1.; } } diff --git a/input/test/slur-symmetry-2.ly b/input/test/slur-symmetry-2.ly new file mode 100644 index 0000000000..93c2df1825 --- /dev/null +++ b/input/test/slur-symmetry-2.ly @@ -0,0 +1,16 @@ +\header{ +% should look the same +title="symmetry"; +} +\score{ + \notes\relative c'{ + [g'8( e )c' g,] + [d'( f' )a, a] + [d( f )a, d'] + [g,( e, )c' c] + } + \paper{ + castingalgorithm = \Wordwrap; + linewidth = 50.0\mm; + } +} diff --git a/input/test/slur-symmetry-3.ly b/input/test/slur-symmetry-3.ly new file mode 100644 index 0000000000..4811a63d4c --- /dev/null +++ b/input/test/slur-symmetry-3.ly @@ -0,0 +1,15 @@ +\header{ +% should look the same +title="symmetry"; +} +\score{ + \notes\relative c'{ + [g'8( e )c' g,] r2 + \break + [d''8( f )a, d'] r2 + } + \paper{ + castingalgorithm = \Wordwrap; + linewidth = 50.0\mm; + } +} diff --git a/input/test/slur-symmetry.ly b/input/test/slur-symmetry.ly index 93c2df1825..41ebe836b3 100644 --- a/input/test/slur-symmetry.ly +++ b/input/test/slur-symmetry.ly @@ -1,16 +1,14 @@ -\header{ -% should look the same -title="symmetry"; -} \score{ - \notes\relative c'{ - [g'8( e )c' g,] - [d'( f' )a, a] - [d( f )a, d'] - [g,( e, )c' c] - } + \notes\relative c'< + \time 6/8; + \context Staff{ + e8(e)e e(d)e e(c)e e(b)e + } + \context Staff=x{ + f'8(f)f f(g)f f(a)f f(b)f + } + > \paper{ - castingalgorithm = \Wordwrap; - linewidth = 50.0\mm; + linewidth=-1.; } } diff --git a/input/test/tie.ly b/input/test/tie.ly index 90e9389b40..36998a23f5 100644 --- a/input/test/tie.ly +++ b/input/test/tie.ly @@ -1,20 +1,12 @@ -\version "1.1.52"; - -tie = \notes\transpose c''{ - - e4 ~ e e e ~ | - e ~ a a a ~ | - a d d d ~ | - e e e e | - g,, g,, g,, g,, ~ | - g,, g,, g,, g,, | -} - \score{ - \tie - \paper{ - indent = 0.0\pt; - linewidth= 30.\mm; - castingalgorithm = \Wordwrap; + \notes\relative c''{ + %b2~b4~b8~b16~b32~b64 r64\break + %a2~a4~a8~a16~a32~a64 r64 + d2~d4~d8~d16~d32~d64 r64\break + a2~a4~a8~a16~a32~a64 r64 + %c2~c4~c8~c16~c32~c64 r64 + } + \paper{ + linewidth=0.; } } diff --git a/lily/parser.yy b/lily/parser.yy index 7973a73d6b..bc65f297bd 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -241,7 +241,7 @@ yylex (YYSTYPE *s, void * v_l) %type pitch_list %type chord %type chord_additions chord_subtractions chord_notes -%type chord_addsub chord_note chord_inversion +%type chord_note chord_inversion %type midi_block midi_body %type duration_length @@ -1451,14 +1451,22 @@ chord_additions: | '-' chord_notes { $$ = $2; } + | '-' CHORDMODIFIER_PITCH { + $$ = new Array; + $$->push (*$2); + } + | '-' CHORDMODIFIER_PITCH chord_notes { + $$ = $3; + $$->push (*$2); + } ; chord_notes: - chord_addsub { + chord_note { $$ = new Array; $$->push (*$1); } - | chord_notes '.' chord_addsub { + | chord_notes '.' chord_note { $$ = $1; $$->push (*$3); } @@ -1478,12 +1486,6 @@ chord_subtractions: forevery : X : optional_X sucks. Devise a solution. */ - -chord_addsub: - chord_note - | CHORDMODIFIER_PITCH - ; - chord_inversion: { $$ = 0; diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index a6602b7709..eb572cd817 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -10,6 +10,9 @@ #include "debug.hh" #include "sequential-music-iterator.hh" #include "music-list.hh" +// hmm +//#include "request-chord-iterator.hh" +#include "request-iterator.hh" void Sequential_music_iterator::do_print() const @@ -141,9 +144,10 @@ Sequential_music_iterator::next_music_l () } else { - // urg FIXME: grace-iterator::next_music_l () fools me! - if (dynamic_cast (iter_p_)) - iter_p_ = 0; + // urg FIXME: sequential children should be iterated to finish + if (dynamic_cast (iter_p_)) + delete iter_p_; + iter_p_ = 0; leave_element (); if (cursor_) diff --git a/lily/tie.cc b/lily/tie.cc index dc7ac39b9c..86eab96d1d 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -35,11 +35,15 @@ Tie::Tie() ugh: direction of the Tie is more complicated. See [Ross] p136 and further */ Direction -Tie::get_default_dir() const +Tie::get_default_dir () const { - int m= (head_l_drul_[LEFT]->position_i_ + int m = (head_l_drul_[LEFT]->position_i_ + head_l_drul_[RIGHT]->position_i_) /2; - return(m < 0)? DOWN : UP; + /* + If dir is not determined: inverse of stem: down + (see stem::get_default_dir ()) + */ + return (m <= 0)? DOWN : UP; } void @@ -60,91 +64,116 @@ Tie::do_add_processing() void Tie::do_post_processing() { - // URG: share code with slur! assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]); - // URG - Real notewidth = paper_l ()->note_width () * 0.8; Real interline_f = paper_l ()->get_realvar (interline_scm_sym); + Real internote_f = interline_f / 2; + Real x_gap_f = paper_l ()->get_var ("tie_x_gap"); + Real y_gap_f = paper_l ()->get_var ("tie_y_gap"); /* - [OSU]: slur and tie placement + Slur and tie placement [OSU] + + Ties: - ties: - * x = inner raakpunt - d * gap + * x = inner vertical tangent - d * gap - * y = length < 5ss : horizontal raakpunt - y = length >= 5ss : y next interline - d * 0.25 ss - --> height <= 5 length ?? we use <= 3 length, now... */ - Real gap_f = paper_l ()->get_var ("slur_x_gap"); + /* + OSU: not different for outer notes, so why all this code? + ie, can we drop this, or should it be made switchable. + */ +#if 0 Direction d = LEFT; do { - dy_f_drul_[d] = .5 * interline_f * (head_l_drul_[d] - ? head_l_drul_[d]->position_i_ - : head_l_drul_[(Direction)-d]->position_i_); - } - while (flip(&d) != LEFT); - - do - { - // tie attached to outer notehead + Real head_width_f = head_l_drul_[d] + ? head_l_drul_[d]->extent (X_AXIS).length () + : 0; + /* + side attached to outer (upper or lower) notehead of chord + */ if (head_l_drul_[d] - && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F) - { - if (d == LEFT) - dx_f_drul_[d] += notewidth; - dx_f_drul_[d] += -d * gap_f; - /* attach to outer 3/4 end of head */ - dy_f_drul_[d] += dir_ * 0.25 * interline_f; - } - // tie attached to inner notehead - else if (head_l_drul_[d] && d == LEFT) + /* + && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F) + ugh, ugh: + + a~a~a; + + to second tie, middle notehead seems not extremal + + Getting scared a bit by score-element's comment: + // is this a good idea? + */ + && (head_l_drul_[d]->get_elt_property (extremal_scm_sym) + != SCM_BOOL_F)) { - dx_f_drul_[d] += -d * notewidth; + if (d == LEFT) + dx_f_drul_[d] += head_width_f; + dx_f_drul_[d] += -d * x_gap_f; } - // uhm? loose end of tie // tie attached to stem + /* + side attached to inner notehead + */ else { - dx_f_drul_[d] = -d * (spanned_drul_[d]->extent (X_AXIS).length () - -0.5 * notewidth); + dx_f_drul_[d] += -d * head_width_f; } - } - while (flip(&d) != LEFT); + } while (flip (&d) != LEFT); - // now that both are set, do dependent - do - { - // tie attached to outer notehead - if (!head_l_drul_[d]) - { - dy_f_drul_[d] = dy_f_drul_[(Direction) -d]; - } - } - while (flip(&d) != LEFT); +#else - /* - Avoid too steep ties - * slur from notehead to stemend: c''()b'' + if (head_l_drul_[LEFT]) + dx_f_drul_[LEFT] = head_l_drul_[LEFT]->extent (X_AXIS).length (); + dx_f_drul_[LEFT] += x_gap_f; + dx_f_drul_[RIGHT] -= x_gap_f; + +#endif + + /* + Slur and tie placement [OSU] -- check this + + Ties: + + * y = dx < 5ss: horizontal tangent + y = dx >= 5ss: y next interline - d * 0.25 ss + + which probably means that OSU assumes that + + dy <= 5 dx + + for smal slurs */ - Real damp_f = paper_l ()->get_var ("tie_slope_damping"); - Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT], - dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]); - d_off.x () += extent (X_AXIS).length (); - - Real ratio_f = abs (d_off.y () / d_off.x ()); - if (ratio_f > damp_f) - dy_f_drul_[(Direction)(- dir_ * sign (d_off.y ()))] += - dir_ * (ratio_f - damp_f) * d_off.x (); + + 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 dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; + if (dx_f < paper_l ()->get_var ("tie_staffspace_length")) + { + if (abs (ypos_i) % 2) + y_f += dir_ * internote_f; + y_f += dir_ * y_gap_f; + } + else + { + if (! (abs (ypos_i) % 2)) + y_f += dir_ * internote_f; + y_f += dir_ * internote_f; + y_f -= dir_ * y_gap_f; + } + + dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = y_f; } void Tie::do_substitute_element_pointer (Score_element*o, Score_element*n) { - Note_head *new_l =n?dynamic_cast (n):0; + Note_head *new_l = n ? dynamic_cast (n) : 0; if (dynamic_cast (o) == head_l_drul_[LEFT]) head_l_drul_[LEFT] = new_l; else if (dynamic_cast (o) == head_l_drul_[RIGHT]) diff --git a/scm/lily.scm b/scm/lily.scm index 5914bf1f8f..139b94cfa8 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -94,8 +94,8 @@ (("" "Span_bar") . (extra_space 0.0)) (("" "Time_signature") . (extra_space 0.0)) (("" "begin-of-note") . (minimum_space 1.5)) - (("Clef_item" "Key_item") . (minimum_space 3.5)) - (("Key_item" "Time_signature") . (extra_space 2.0)) + (("Clef_item" "Key_item") . (minimum_space 4.0)) + (("Key_item" "Time_signature") . (extra_space 1.0)) (("Clef_item" "Time_signature") . (minimum_space 3.5)) (("Staff_bar" "Clef_item") . (minimum_space 1.0)) (("Clef_item" "Staff_bar") . (minimum_space 3.7)) diff --git a/tex/fetdefs.tex b/tex/fetdefs.tex new file mode 100644 index 0000000000..076cee8885 --- /dev/null +++ b/tex/fetdefs.tex @@ -0,0 +1,15 @@ +% fetdefs.tex +% encapsulating tex backend for auto-generated feta definitions + +% fix chord.cc::banter_str before removing these +\def\fetdef#1#2{% + \def#1{\hbox{\char#2}}} + +\fetdef\sharp{16} +\fetdef\flat{18} +\font\fetasixteenfont=feta16 +\def\fetafont{\fetasixteenfont} +\def\textflat{{\fetafont\raise 1ex\hbox{\flat}}} +\def\textsharp{{\fetafont\raise1ex\hbox{\sharp}}} + +\endinput diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 696bf389a3..ada0b6442d 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -57,5 +57,7 @@ nolilyfooter\texsuffix\endcsname \fi +% fix chord.cc::banter_str before removing these +\input fetdefs \endinput -- 2.39.5