From 3891dd64cb38f034d2cf4696a9bace5f739c07c0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 29 Aug 2004 08:42:17 +0000 Subject: [PATCH] * input/regression/slur-stem-broken.ly: remove. * lily/slur.cc: add quant-score. * input/regression/slur-staccato.ly (texidoc): remove * make/lilypond.redhat.spec.in (Group): remove musedata2ly --- ChangeLog | 15 +++- Documentation/topdocs/NEWS.texi | 4 + input/regression/slur-broken-trend.ly | 4 - input/regression/slur-staccato.ly | 18 ----- input/regression/slur-stem-broken.ly | 17 ---- lily/dynamic-engraver.cc | 4 +- lily/include/slur-bezier-bow.hh | 43 ---------- lily/include/{new-slur.hh => slur.hh} | 7 +- lily/phrasing-slur-engraver.cc | 2 +- lily/script-engraver.cc | 6 +- lily/slur-engraver.cc | 12 +-- lily/slur-scoring.cc | 19 ++--- lily/slur.cc | 34 ++++---- make/lilypond.redhat.spec.in | 2 - scm/define-grobs.scm | 16 ++-- scm/document-backend.scm | 5 +- scm/safe-lily.scm | 6 +- scm/slur.scm | 108 +------------------------- 18 files changed, 69 insertions(+), 253 deletions(-) delete mode 100644 input/regression/slur-staccato.ly delete mode 100644 input/regression/slur-stem-broken.ly delete mode 100644 lily/include/slur-bezier-bow.hh rename lily/include/{new-slur.hh => slur.hh} (87%) diff --git a/ChangeLog b/ChangeLog index b647338ffe..3637da19fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-08-29 Han-Wen Nienhuys + + * input/regression/slur-stem-broken.ly: remove. + + * lily/slur.cc: add quant-score. + + * input/regression/slur-staccato.ly (texidoc): remove + + * make/lilypond.redhat.spec.in (Group): remove musedata2ly + 2004-08-28 Han-Wen Nienhuys * lily/include/bezier-bow.hh: remove. @@ -64,8 +74,9 @@ 2004-08-27 Graham Percival - * Documentation/user/introduction.itely: add note about the "example templates" - section of the manual, and remove link to input/template/ + * Documentation/user/introduction.itely: add note about the + "example templates" section of the manual, and remove link to + input/template/ 2004-08-27 Juergen Reuter diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 6b62c48a1c..388f8d4389 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -8,6 +8,10 @@ @itemize @bullet +@item The automatic staff changer, which is invoked with +@code{\autochange}, now creates the @code{up} and @code{down} staff +automatically, and uses bass clef for the bottom staff. + @item There is now support for putting two slurs on chords, both above and below. This is switched on with the @code{doubleSlurs} property. diff --git a/input/regression/slur-broken-trend.ly b/input/regression/slur-broken-trend.ly index aec1dce799..89903b62fa 100644 --- a/input/regression/slur-broken-trend.ly +++ b/input/regression/slur-broken-trend.ly @@ -15,10 +15,6 @@ in unbroken state. } \relative c''{ - \override Slur #'after-line-breaking-callback = #New_slur::after_line_breaking - \override Slur #'print-function = #New_slur::print - \override Slur #'height = ##f - e1( \break a,) \time 2/4 e'2( \break a,)(\break diff --git a/input/regression/slur-staccato.ly b/input/regression/slur-staccato.ly deleted file mode 100644 index 0841c171b8..0000000000 --- a/input/regression/slur-staccato.ly +++ /dev/null @@ -1,18 +0,0 @@ - -\version "2.3.4" -\header { -texidoc="An extra offset may be added between a slur and staccato(s)." -} - -\paper { raggedright = ##t} - -\score { - \context Staff \relative c'' { - \override Slur - #'attachment-offset = #'((0 . 1) . (0 . 1)) - a-.( g-. a)-. - \override Slur - #'attachment-offset = #'((0 . 1.5) . (0 . 1.5)) - b-.( a-. b)-. - } -} diff --git a/input/regression/slur-stem-broken.ly b/input/regression/slur-stem-broken.ly deleted file mode 100644 index ace158908c..0000000000 --- a/input/regression/slur-stem-broken.ly +++ /dev/null @@ -1,17 +0,0 @@ - -\version "2.3.4" -\header { -texidoc="Trend of broken slur with user-overridden stem attachment should also -follow the same vertical direction it would have had in unbroken state." -} -\score { - \relative c' { - \override Slur #'attachment = #'(stem . stem) - f( c' c c \break - c c c \stemUp c) - } - \paper { - linewidth=40*\staffspace - } -} - diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 18c41d2b16..a6d82e9785 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -16,7 +16,7 @@ #include "hairpin.hh" #include "interval.hh" #include "item.hh" -#include "new-slur.hh" +#include "slur.hh" #include "note-column.hh" #include "paper-column.hh" #include "script-interface.hh" @@ -414,6 +414,6 @@ ENTER_DESCRIPTION (Dynamic_engraver, /* creats*/ "DynamicLineSpanner DynamicText Hairpin TextSpanner", /* accepts */ "absolute-dynamic-event crescendo-event decrescendo-event", -/* acks */ "note-column-interface script-interface new-slur-interface", +/* acks */ "note-column-interface script-interface slur-interface", /* reads */ "", /* write */ ""); diff --git a/lily/include/slur-bezier-bow.hh b/lily/include/slur-bezier-bow.hh deleted file mode 100644 index 4fd52370e7..0000000000 --- a/lily/include/slur-bezier-bow.hh +++ /dev/null @@ -1,43 +0,0 @@ -/* - slur-bezier-bow.hh -- declare Slur_bezier_bow - - source file of the GNU LilyPond music typesetter - - (c) 2000--2004 Jan Nieuwenhuizen -*/ - -#ifndef SLUR_BEZIER_BOW_HH -#define SLUR_BEZIER_BOW_HH - -#include "bezier-bow.hh" - -class Slur_bezier_bow -{ - Array encompass_; - - void to_canonical_form (); - Direction dir_; - Real alpha_; - Offset origin_; - Real h_inf_, r_0_; - -public: - - /** - The canonical bezier. - */ - Bezier curve_; - - Slur_bezier_bow (Array encompass, Direction dir, - Real hinf, Real r0); - Bezier get_bezier () const; - - void minimise_enclosed_area (Real beauty, SCM props); - Real fit_factor () const; - void blow_fit (); - Real get_enclosed_area () const; -private: - Array area_x_gradientses (Real area); -}; - -#endif /* SLUR_BEZIER_BOW_HH */ diff --git a/lily/include/new-slur.hh b/lily/include/slur.hh similarity index 87% rename from lily/include/new-slur.hh rename to lily/include/slur.hh index 25caa9528c..5dd31b6f5c 100644 --- a/lily/include/new-slur.hh +++ b/lily/include/slur.hh @@ -1,5 +1,5 @@ /* - new-slur.hh -- declare New_slur + slur.hh -- declare Slur source file of the GNU LilyPond music typesetter @@ -15,7 +15,7 @@ #define DEBUG_SLUR_QUANTING 1 -class New_slur +class Slur { public: static void add_column (Grob *me, Grob *col); @@ -28,8 +28,5 @@ public: static Bezier get_curve (Grob*me); }; -// zught -Direction get_slur_dir (Grob *slur); - #endif /* NEW_SLUR_HH */ diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index c48ce5b6ad..749dc7232b 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -8,7 +8,7 @@ #include "directional-element-interface.hh" #include "engraver.hh" #include "event.hh" -#include "new-slur.hh" +#include "slur.hh" #include "note-column.hh" #include "spanner.hh" #include "tie.hh" diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 3b952933cb..88cca8b2e4 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -10,7 +10,7 @@ #include "directional-element-interface.hh" #include "engraver.hh" #include "event.hh" -#include "new-slur.hh" +#include "slur.hh" #include "note-column.hh" #include "paper-column.hh" #include "rhythmic-head.hh" @@ -244,7 +244,7 @@ ENTER_DESCRIPTION (Script_engraver, /* descr */ "Handles note scripted articulations.", /* creats*/ "Script", /* accepts */ "script-event articulation-event", -/* acks */ "stem-interface rhythmic-head-interface\ - new-slur-interface note-column-interface", +/* acks */ "stem-interface rhythmic-head-interface " + "slur-interface note-column-interface", /* reads */ "scriptDefinitions", /* write */ ""); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 76480c3936..96c83dde18 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -5,7 +5,7 @@ */ #include "event.hh" -#include "new-slur.hh" +#include "slur.hh" #include "note-column.hh" #include "context.hh" #include "directional-element-interface.hh" @@ -77,9 +77,9 @@ Slur_engraver::acknowledge_grob (Grob_info info) if (Note_column::has_interface (info.grob_)) { for (int i = slurs_.size (); i--; ) - New_slur::add_column (slurs_[i], e); + Slur::add_column (slurs_[i], e); for (int i = end_slurs_.size (); i-- ; ) - New_slur::add_column (end_slurs_[i], e); + Slur::add_column (end_slurs_[i], e); } else { @@ -88,9 +88,9 @@ Slur_engraver::acknowledge_grob (Grob_info info) || to_boolean (inside)) { for (int i = slurs_.size (); i--; ) - New_slur::add_extra_encompass (slurs_[i], e); + Slur::add_extra_encompass (slurs_[i], e); for (int i = end_slurs_.size (); i--; ) - New_slur::add_extra_encompass (end_slurs_[i], e); + Slur::add_extra_encompass (end_slurs_[i], e); } else if (inside == SCM_BOOL_F) { @@ -100,7 +100,7 @@ Slur_engraver::acknowledge_grob (Grob_info info) if (slur) { - e->add_offset_callback (New_slur::outside_slur_callback_proc, Y_AXIS); + e->add_offset_callback (Slur::outside_slur_callback_proc, Y_AXIS); e->set_property ("slur", slur->self_scm()); } } diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 2fd8386bd2..d0ae6ba916 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -15,7 +15,7 @@ #include "group-interface.hh" #include "libc-extension.hh" #include "lily-guile.hh" -#include "new-slur.hh" +#include "slur.hh" #include "note-column.hh" #include "output-def.hh" #include "pitch.hh" @@ -357,18 +357,11 @@ get_default_dir (Grob*me) return d; } -Direction -get_slur_dir (Grob *slur) -{ - Direction d = get_grob_direction (slur); - if (d == CENTER) - d = get_default_dir (slur); - return d; -} -MAKE_SCHEME_CALLBACK (New_slur, after_line_breaking,1); + +MAKE_SCHEME_CALLBACK (Slur, after_line_breaking,1); SCM -New_slur::after_line_breaking (SCM smob) +Slur::after_line_breaking (SCM smob) { Spanner *me = dynamic_cast (unsmob_grob (smob)); if (!scm_ilength (me->get_property ("note-columns"))) @@ -926,10 +919,10 @@ score_extra_encompass (Grob *me, Grob *common[], for (int i = encompasses.size (); i--; ) { - if (New_slur::has_interface (encompasses[i])) + if (Slur::has_interface (encompasses[i])) { Grob * small_slur = encompasses[i]; - Bezier b = New_slur::get_curve (small_slur); + Bezier b = Slur::get_curve (small_slur); Offset z = b.curve_point (0.5); z += Offset (small_slur->relative_coordinate (common[X_AXIS], X_AXIS), diff --git a/lily/slur.cc b/lily/slur.cc index a18495ba91..b61522b711 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -10,29 +10,29 @@ #include +#include "beam.hh" #include "bezier.hh" -#include "new-slur.hh" -#include "main.hh" -#include "font-interface.hh" -#include "text-item.hh" #include "directional-element-interface.hh" +#include "font-interface.hh" #include "group-interface.hh" #include "lily-guile.hh" #include "lookup.hh" +#include "main.hh" #include "note-column.hh" #include "output-def.hh" #include "rod.hh" +#include "slur.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" #include "stem.hh" #include "stencil.hh" +#include "text-item.hh" #include "warn.hh" -#include "beam.hh" -MAKE_SCHEME_CALLBACK (New_slur, height, 2); +MAKE_SCHEME_CALLBACK (Slur, height, 2); SCM -New_slur::height (SCM smob, SCM ax) +Slur::height (SCM smob, SCM ax) { Axis a = (Axis)ly_scm2int (ax); Grob *me = unsmob_grob (smob); @@ -48,9 +48,9 @@ New_slur::height (SCM smob, SCM ax) /* Ugh should have dash-length + dash-period */ -MAKE_SCHEME_CALLBACK (New_slur, print,1); +MAKE_SCHEME_CALLBACK (Slur, print,1); SCM -New_slur::print (SCM smob) +Slur::print (SCM smob) { Grob *me = unsmob_grob (smob); if (!scm_ilength (me->get_property ("note-columns"))) @@ -99,7 +99,7 @@ New_slur::print (SCM smob) Bezier -New_slur::get_curve (Grob*me) +Slur::get_curve (Grob*me) { Bezier b; int i = 0; @@ -111,7 +111,7 @@ New_slur::get_curve (Grob*me) } void -New_slur::add_column (Grob*me, Grob*n) +Slur::add_column (Grob*me, Grob*n) { Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n); add_bound_item (dynamic_cast (me), dynamic_cast (n)); @@ -119,16 +119,16 @@ New_slur::add_column (Grob*me, Grob*n) void -New_slur::add_extra_encompass (Grob*me, Grob*n) +Slur::add_extra_encompass (Grob*me, Grob*n) { Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n); } -MAKE_SCHEME_CALLBACK (New_slur, outside_slur_callback, 2); +MAKE_SCHEME_CALLBACK (Slur, outside_slur_callback, 2); SCM -New_slur::outside_slur_callback (SCM grob, SCM axis) +Slur::outside_slur_callback (SCM grob, SCM axis) { Grob *script = unsmob_grob (grob); Axis a = Axis (ly_scm2int (axis)); @@ -142,7 +142,7 @@ New_slur::outside_slur_callback (SCM grob, SCM axis) Grob *cx = script->common_refpoint (slur, X_AXIS); Grob *cy = script->common_refpoint (slur, Y_AXIS); - Bezier curve = New_slur::get_curve (slur); + Bezier curve = Slur::get_curve (slur); curve.translate (Offset (slur->relative_coordinate (cx, X_AXIS), slur->relative_coordinate (cy, Y_AXIS))); @@ -177,7 +177,7 @@ New_slur::outside_slur_callback (SCM grob, SCM axis) } -ADD_INTERFACE (New_slur, "new-slur-interface", +ADD_INTERFACE (Slur, "slur-interface", "A slur", - "excentricity encompass-objects control-points dashed slur-details direction height-limit note-columns ratio thickness"); + "quant-score excentricity encompass-objects control-points dashed slur-details direction height-limit note-columns ratio thickness"); diff --git a/make/lilypond.redhat.spec.in b/make/lilypond.redhat.spec.in index 6660f6ffe3..2c16465ef3 100644 --- a/make/lilypond.redhat.spec.in +++ b/make/lilypond.redhat.spec.in @@ -155,7 +155,6 @@ scrollkeeper-update %{_bindir}/midi2ly %{_bindir}/lilypond-book %{_bindir}/mup2ly -%{_bindir}/musedata2ly %doc THANKS %doc COPYING @@ -176,7 +175,6 @@ scrollkeeper-update %{_mandir}/man1/lilypond.1.gz %{_mandir}/man1/midi2ly.1.gz %{_mandir}/man1/lilypond-book.1.gz -%{_mandir}/man1/musedata2ly.1.gz %{_mandir}/man1/mup2ly.1.gz %{_datadir}/lilypond/@TOPLEVEL_VERSION@/ diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 54bc8241b7..99ecc095fb 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -775,15 +775,15 @@ (PhrasingSlur . ((slur-details . ,default-slur-details) - (print-function . ,New_slur::print) + (print-function . ,Slur::print) (thickness . 1.2) (spacing-procedure . ,Spanner::set_spacing_rods) (minimum-length . 1.5) - (after-line-breaking-callback . ,New_slur::after_line_breaking) - (Y-extent-callback . ,New_slur::height) + (after-line-breaking-callback . ,Slur::after_line_breaking) + (Y-extent-callback . ,Slur::height) (height-limit . 2.0) (ratio . 0.333) - (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface)))) + (meta . ((interfaces . (slur-interface spanner-interface)))) )) (NonMusicalPaperColumn @@ -887,16 +887,16 @@ (Slur . ((slur-details . ,default-slur-details) - (print-function . ,New_slur::print) + (print-function . ,Slur::print) (thickness . 1.2) (spacing-procedure . ,Spanner::set_spacing_rods) (minimum-length . 1.5) - (after-line-breaking-callback . ,New_slur::after_line_breaking) - (Y-extent-callback . ,New_slur::height) + (after-line-breaking-callback . ,Slur::after_line_breaking) + (Y-extent-callback . ,Slur::height) ; Slur::height) (height-limit . 2.0) (ratio . 0.25) - (meta . ((interfaces . (slur-interface new-slur-interface spanner-interface)))) + (meta . ((interfaces . (slur-interface spanner-interface)))) )) (SpacingSpanner diff --git a/scm/document-backend.scm b/scm/document-backend.scm index 5094bcdb63..72aa188d34 100644 --- a/scm/document-backend.scm +++ b/scm/document-backend.scm @@ -102,8 +102,9 @@ node." ; (bla (display name)) (ifaces (map lookup-interface (cdr (assoc 'interfaces meta)))) (ifacedoc (map (lambda (iface) - (ref-ify (symbol->string (car iface))) - ) + (if (pair? iface) + (ref-ify (symbol->string (car iface))) + (error (format "Error making doc of ~s" name)))) (reverse ifaces))) (engravers (filter (lambda (x) (engraver-makes-grob? name x)) all-engravers-list)) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index fe2a87442c..b47f9d4260 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -245,9 +245,9 @@ Separating_group_spanner::set_spacing_rods Side_position_interface::aligned_on_support_refpoints Side_position_interface::aligned_side - New_slur::after_line_breaking - New_slur::height - New_slur::print + Slur::after_line_breaking + Slur::height + Slur::print Spacing_spanner::set_springs Span_bar::before_line_breaking Span_bar::get_bar_size diff --git a/scm/slur.scm b/scm/slur.scm index 0605d66f00..a0ba65c364 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -5,113 +5,7 @@ ;;;; ;;;; (c) 2000--2004 Jan Nieuwenhuizen ;;;; - -(define (attached-to-stem slur dir) - (let* ((note-columns (ly:grob-property slur 'note-columns)) - (col (if (= dir RIGHT) - (car note-columns) - (car (last-pair note-columns)))) - (stem (ly:grob-property col 'stem))) - (and - (eq? col (ly:spanner-get-bound slur dir)) - ;(ly:grob? stem) - ;(pair? (ly:grob-property stem 'heads)) - - ))) - - -;; -;; Currently, we have attachments: -;; -;; 'head 'along-side-stem 'stem 'loose-end -;; -(define (calc-slur-extremity slur dir) - (let* ((note-columns (ly:grob-property slur 'note-columns)) - (col (if (= dir 1) - (car note-columns) - (car (last-pair note-columns)))) - (stem (ly:grob-property col 'stem)) - (beaming (if (and (ly:grob? stem) - (ly:grob? (ly:grob-property stem 'beam))) - (ly:grob-property stem 'beaming) - '(() . ()))) - (one-side-beaming (if (= dir RIGHT) - (car beaming) - (cdr beaming))) - - ) - - (cond - ((< (length note-columns) 1) 'head) - ((not (attached-to-stem slur dir)) - - 'loose-end) - ((and stem - (not (equal? (ly:grob-property slur 'direction) - (ly:grob-property stem 'direction)))) 'head) - ((and (memq (ly:spanner-get-bound slur dir) - (ly:grob-property slur 'note-columns)) - (ly:grob? stem) - - ;; slur would go under beam for 'head - (> (length one-side-beaming ) 0) - ;; and beam on same side as slur - (equal? - (ly:grob-property stem 'direction) - (ly:grob-property slur 'direction)) - ) - 'stem) - ((not (attached-to-stem slur dir)) - 'loose-end) - (else - 'head)) - )) - - -;; This list defines the offsets for each type of attachment. -;; The format of each element is -;; (attachment stem-dir*dir slur-dir*dir) -;; Different attachments have different default points: -;; -;; head: Default position is centered in X, on outer side of head Y -;; along-side-stem: Default position is on stem X, on outer side of head Y -;; stem: Default position is on stem X, at stem end Y -(define default-slur-extremity-offset-alist - '( - ((head 1 1) . (-0.25 . 0.75)) - ((head 1 -1) . (-0.25 . 0.75)) - ((head -1 1) . (-0.25 . 0.75)) - ((head -1 -1) . (-0.85 . 0.75)) - - ((stem 1 1) . (-0.125 . 0.5)) - ((stem -1 -1) . (-0.125 . 0.5)) - - ((loose-end 1 1) . (-0.4 . 0)) - ((loose-end 1 -1) . (-0.4 . 0)) - ((loose-end -1 -1) . (-4 . 0)) - ((loose-end -1 1) . (-4 . 0)) - )) - -;; This is a bit of a hack: slurs and phrasing slurs -;; attaching at the same note must not collide. -;; However, slurs (and phrasing slurs) should look -;; at scripts and eachother. -(define default-phrasing-slur-extremity-offset-alist - '( - ((head 1 1) . (-0.25 . 1.25)) - ((head 1 -1) . (-0.25 . 1.25)) - ((head -1 1) . (-0.25 . 1.25)) - ((head -1 -1) . (-0.85 . 1.25)) - - ((stem 1 1) . (-0.25 . 1.5)) - ((stem -1 -1) . (-0.25 . 1.5)) - - ((loose-end 1 1) . (-0.4 . 0)) - ((loose-end 1 -1) . (-0.4 . 0)) - ((loose-end -1 -1) . (-4 . 0)) - ((loose-end -1 1) . (-4 . 0)) - )) - + ; ; this is put into the slur-details property of Slur and PhrasingSlur (define default-slur-details '((region-size . 4) -- 2.39.5