From 00a18717ab2099cca865ed86ecefc6453938227d Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 18 Aug 2000 00:19:10 +0200 Subject: [PATCH] patch::: 1.3.78.jcn5 1.3.78.jcn5 =========== * Made crude fixes so unbound slurs don't crash, bezier still crashes on infinitely steep slurs (eg flauti-part *with* slur_engraver). --- CHANGES | 6 ++++++ VERSION | 2 +- input/bugs/almost.ly | 18 ------------------ input/test/hymn.ly | 16 ++++------------ lily/include/slur.hh | 1 + lily/slur.cc | 29 ++++++++++++++++++++++++----- ly/engraver.ly | 1 + mutopia/Coriolan/flauti-part.ly | 25 ++++++++++++++++++++++++- mutopia/Coriolan/flauti.ly | 3 +-- scm/slur.scm | 3 +++ 10 files changed, 65 insertions(+), 39 deletions(-) diff --git a/CHANGES b/CHANGES index a3bd728da0..ebf487e4b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +1.3.78.jcn5 +=========== + +* Made crude fixes so unbound slurs don't crash, bezier still crashes on + infinitely steep slurs (eg flauti-part *with* slur_engraver). + 1.3.78.jcn4 =========== diff --git a/VERSION b/VERSION index bc65a00325..fe8e60a2d4 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=78 -MY_PATCH_LEVEL=jcn4 +MY_PATCH_LEVEL=jcn5 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/bugs/almost.ly b/input/bugs/almost.ly index 7276562718..e69de29bb2 100644 --- a/input/bugs/almost.ly +++ b/input/bugs/almost.ly @@ -1,18 +0,0 @@ -\score{ - \context Staff < - \context Voice=one { \skip 1; } - \context Voice=two { \skip 1; } - - \context Voice=one \partcombine Voice - \context Thread=one \notes\relative c'' { - a4 c4.()g8 a4 - } - \context Thread=two \notes\relative c'' { - g4 e4.()d8 c4 - } - > - \paper{ - linewidth=60.\mm; - } -} - diff --git a/input/test/hymn.ly b/input/test/hymn.ly index 8003c4dbd4..cecbbfc731 100644 --- a/input/test/hymn.ly +++ b/input/test/hymn.ly @@ -1,17 +1,15 @@ \score{ \context Staff < - \context Voice=one { \skip 1; } - \context Voice=two { \skip 1; } - + \time 4/4; \context Voice=one \partcombine Voice \context Thread=one \notes\relative c'' { - %a4 c4.()g8 a4 | + a4 c4.()g8 a4 | g4 e' g()f | b, a c2 } \context Thread=two \notes\relative c'' { - %g4 e4.()d8 c4 | - g4 c, e()f | + g4 e4.()d8 c4 | + g'4 c, e()f | d2 a } > @@ -20,13 +18,7 @@ \translator { \VoiceContext soloADue = ##f - %\remove Slur_engraver; - \consists Slur_engraver; } -% \translator { -% \ThreadContext -% \consists Slur_engraver; -% } } } diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 83d0900834..096d96ab2e 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -21,6 +21,7 @@ public: static Array get_encompass_offset_arr (Score_element*me) ; static Bezier get_curve (Score_element*me) ; static Direction get_default_dir (Score_element*me) ; + static SCM before_line_breaking (SCM); static SCM after_line_breaking (SCM); static SCM set_spacing_rods (SCM); private: diff --git a/lily/slur.cc b/lily/slur.cc index ccad52d81c..40985d33c0 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -150,14 +150,28 @@ Slur::encompass_offset (Score_element*me, return o; } -MAKE_SCHEME_CALLBACK(Slur,after_line_breaking); +MAKE_SCHEME_CALLBACK (Slur, before_line_breaking); +SCM +Slur::before_line_breaking (SCM smob) +{ + Score_element *me = unsmob_element (smob); + if (Pointer_group_interface__extract_elements (me, (Score_element*)0, "note-columns").size () < 2) + me->suicide (); + return SCM_UNSPECIFIED; +} +MAKE_SCHEME_CALLBACK(Slur,after_line_breaking); SCM Slur::after_line_breaking (SCM smob) { Score_element *me = unsmob_element (smob); - set_extremities (me); - set_control_points (me); + if (Pointer_group_interface__extract_elements (me, (Score_element*)0, "note-columns").size () < 2) + me->suicide (); + else + { + set_extremities (me); + set_control_points (me); + } return SCM_UNSPECIFIED; } @@ -281,7 +295,7 @@ Slur::get_attachment (Score_element*me,Direction dir, Array Slur::get_encompass_offset_arr (Score_element*me) { - Spanner*sp = dynamic_cast(me); + Spanner*sp = dynamic_cast(me); SCM eltlist = me->get_elt_property ("note-columns"); Score_element *common[] = {me->common_refpoint (eltlist,X_AXIS), me->common_refpoint (eltlist,Y_AXIS)}; @@ -376,11 +390,16 @@ SCM Slur::brew_molecule (SCM smob) { Score_element * me = unsmob_element (smob); + Molecule a; + if (Pointer_group_interface__extract_elements (me, (Score_element*)0, "note-columns").size () < 2) + { + me->suicide (); + return a.create_scheme (); + } Real thick = me->paper_l ()->get_var ("stafflinethickness") * gh_scm2double (me->get_elt_property ("thickness")); Bezier one = get_curve (me); - Molecule a; SCM d = me->get_elt_property ("dashed"); if (gh_number_p (d)) a = me->lookup_l ()->dashed_slur (one, thick, thick * gh_scm2double (d)); diff --git a/ly/engraver.ly b/ly/engraver.ly index 16dbcfa15e..1829e5f378 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -625,6 +625,7 @@ ScoreContext = \translator { (thickness . 1.2) (spacing-procedure . ,Slur::set_spacing_rods) e (minimum-length . 1.5) + (before-line-breaking-callback . ,Slur::before_line_breaking) (after-line-breaking-callback . ,Slur::after_line_breaking) ) basicSpacingSpannerProperties =#`( diff --git a/mutopia/Coriolan/flauti-part.ly b/mutopia/Coriolan/flauti-part.ly index 64c15a8d61..182f57d232 100644 --- a/mutopia/Coriolan/flauti-part.ly +++ b/mutopia/Coriolan/flauti-part.ly @@ -16,7 +16,30 @@ copyright = "public domain"; \score{ \$flauti_staff - \include "coriolan-part-paper.ly" + %\include "coriolan-part-paper.ly" + + \paper { + textheight = 295.0\mm; + linewidth = 180.0\mm; + + % slurs are never beautiful (no steep slurs) + slur_beautiful = 0.0; + + \translator { + \VoiceContext + \remove Slur_engraver; + } + \translator { + \ScoreContext skipBars = ##t + %% URG: this changes dynamics too + %%textStyle = #"italic" + timeSignatureStyle = #"C" + instrumentScriptPadding = #60 %% urg, this is in pt + instrScriptPadding = #40 %% urg, this is in pt + marginScriptHorizontalAlignment = #1 + maximumRestCount = #1 + } + } \include "coriolan-midi.ly" } diff --git a/mutopia/Coriolan/flauti.ly b/mutopia/Coriolan/flauti.ly index 83c1ea59c1..9fe7ce0674 100644 --- a/mutopia/Coriolan/flauti.ly +++ b/mutopia/Coriolan/flauti.ly @@ -24,9 +24,8 @@ $flauti_staff = \notes \context Staff = flauti < \context Voice=one { \skip 1; } \context Voice=two { \skip 1; } - \context Voice=one \partcombine Voice < + \context Voice=one \partcombine Voice \context Thread=one \$flauto1 \context Thread=two \$flauto2 - > > diff --git a/scm/slur.scm b/scm/slur.scm index dadeb3056c..8863368991 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -28,6 +28,9 @@ ;; (cons (lambda (slur dir) (begin (display "before head") (newline))#f) #f) + (cons (lambda (slur dir) + (< (length (ly-get-elt-property slur 'note-columns)) 2)) 'head) + (cons (lambda (slur dir) ;; urg, code dup (let* ((note-columns (ly-get-elt-property slur 'note-columns)) -- 2.39.5