From 796c3d2eba8f5e9151a36ffcb3d0a26dfd4ffdb5 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 10 Feb 1999 17:05:06 +0100 Subject: [PATCH] patch::: 1.1.29.jcn3: sleur volg muziek fix pl 29.jcn3 - fix: slur-case3.ly - init.sly: .fly with linewidt=-1 --- Generated by janneke@gnu.org using package-diff 0.62, >From = lilypond-1.1.29.jcn2, To = lilypond-1.1.29.jcn3 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.29.jcn3.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure and possibly make outdirs. --state 1.1.29.jcn2 1.1.29.jcn3 ++state --- NEWS | 11 +++++++- TODO | 11 +++++--- VERSION | 2 +- input/test/slur-follow-music.sly | 15 +++++++++++ lily/include/direction.hh | 13 +++++++++ lily/main.cc | 13 +++++---- lily/slur.cc | 46 +++++++++++++++++++++++++++++--- ly/GNUmakefile | 2 +- ly/init.sly | 16 +++++++++++ ly/params.ly | 3 +++ make/mutopia-vars.make | 9 ++++--- 11 files changed, 124 insertions(+), 17 deletions(-) create mode 100644 input/test/slur-follow-music.sly create mode 100644 ly/init.sly diff --git a/NEWS b/NEWS index be611e77e1..607407ff6e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,13 @@ ---- ../lilypond-1.1.29.jcn1/NEWS Tue Feb 9 17:15:49 1999 +--- ../lilypond-1.1.29.jcn2/NEWS Tue Feb 9 22:46:07 1999 +++ b/NEWS Wed Feb 10 15:21:05 1999 +@@ -1,3 +1,7 @@ +pl 29.jcn3 + - fix: slur-case3.ly + - init.sly: .fly with linewidt=-1 + + pl 29.jcn2 + - resurrected ps output + --- ../lilypond-1.1.29.jcn1/NEWS Tue Feb 9 17:15:49 1999 ++ b/NEWS Tue Feb 9 22:46:07 1999 @@ -1,3 +1,6 @@ pl 29.jcn2 diff --git a/TODO b/TODO index 1de14911bf..a5b256713d 100644 --- a/TODO +++ b/TODO @@ -63,9 +63,13 @@ specify the third. Should there be? .* TODO before 1.2 . * > Yes. I want ties to tie only notes of the same pitch, so that -> < a~ a,> a +> f < a~ a,> a > works as you'd expect it to. + +I don't think that's functional, but there is a bug (--jcn): +Lily will set a tie between the a and the preceeding f. . * 1. Can Lily be told where to start numbering? +Fix: set bar-number to 0 if first bar is an anacrouse? . * The timpani part has rests the full first line. Is it possible to force lilypond to print all parts on the first page of the score but use the hara-kiri mechanism on the remaining pages? @@ -729,12 +733,13 @@ if you just sit there." "Additional expressions to highlight in Outline mode.") (add-hook 'outline-mode-hook - (lambda () + '(lambda () (setq font-lock-maximum-decoration t) (setq font-lock-maximum-decoration t) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(outline-font-lock-keywords t)) - (font-lock-mode (global-font-lock-mode)))) + (font-lock-mode global-font-lock-mode) + )) (require 'allout) (outline-init 't) diff --git a/VERSION b/VERSION index d986ff64a5..537aaa1c96 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 PATCH_LEVEL=29 -MY_PATCH_LEVEL=jcn2 +MY_PATCH_LEVEL=jcn3 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/slur-follow-music.sly b/input/test/slur-follow-music.sly new file mode 100644 index 0000000000..bc28469520 --- /dev/null +++ b/input/test/slur-follow-music.sly @@ -0,0 +1,15 @@ +% CASE 3 +d''4 ( ) b a ( ) e' \break +g,( \stemdown ) b \stemboth c ( ) f, \break + +% no adjusting... +\stemup [d'8 ( b a] \stemboth ) e' \break +\stemup [g,8 ( b d] \stemboth ) c \break + +% still ugly +g4 ( b d ) c \break + +%TIES +d ~ b a ~ e' \break +g, ~ \stemdown b \stemboth c ~ f, \break + diff --git a/lily/include/direction.hh b/lily/include/direction.hh index 8a59ac52f7..3b2029d3c8 100644 --- a/lily/include/direction.hh +++ b/lily/include/direction.hh @@ -27,6 +27,19 @@ enum Direction STOP = 1 }; +inline Direction +other_dir (Direction const d) +{ + return (Direction)(-d); +} + +inline Direction +operator - (Direction const d) +{ + return other_dir (d); +} + +// huh? inline Direction flip (Direction *i) { if (*i == (Direction)1) diff --git a/lily/main.cc b/lily/main.cc index e8e55b5baf..c619701663 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -401,12 +401,15 @@ distill_inname_str (String name_str, String& ext_r) split_path (str,a,b,c,ext_r); // add extension if not present. - // UGH. Should parametrise in list of default extensions. - if (ext_r.empty_b ()) + char const* extensions[] = {"", "", ".ly", ".fly", ".sly", 0}; + extensions[0] = ext_r.ch_C (); + for (int i = 0; extensions[i]; i++) { - ext_r = ".fly"; - if (global_path.find (a+b+c+ext_r).empty_b ()) - ext_r = ".ly"; + if (!global_path.find (a+b+c+extensions[i]).empty_b ()) + { + ext_r = extensions[i]; + break; + } } str = a+b+c+ext_r; } diff --git a/lily/slur.cc b/lily/slur.cc index 2a7c7014a1..62cf0016ce 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -122,6 +122,11 @@ Slur::do_post_processing () Direction d=LEFT; +#define NORMAL_SLUR_b(dir) \ + (extrema[dir]->stem_l_ \ + && !extrema[dir]->stem_l_->transparent_b_ \ + && extrema[dir]->head_l_arr_.size ()) + do { /* @@ -146,8 +151,7 @@ Slur::do_post_processing () /* normal slur */ - else if (extrema[d]->stem_l_ && !extrema[d]->stem_l_->transparent_b_ - && extrema[d]->head_l_arr_.size ()) + else if (NORMAL_SLUR_b (d)) { Real notewidth_f = extrema[d]->extent (X_AXIS).length (); dy_f_drul_[d] = (int)rint (extrema[d]->stem_l_-> extent (Y_AXIS)[dir_]); @@ -193,9 +197,44 @@ Slur::do_post_processing () } while (flip(&d) != LEFT); + /* + Slur should follow line of music + */ + if (NORMAL_SLUR_b (LEFT) && NORMAL_SLUR_b (RIGHT) + && (extrema[LEFT]->stem_l_ != extrema[RIGHT]->stem_l_)) + { + Real note_dy = extrema[RIGHT]->stem_l_->head_positions ()[dir_] + - extrema[LEFT]->stem_l_->head_positions ()[dir_]; + Real dy = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; + /* + Should we always follow note-heads, (like a tie)? + For now, only if the note_dy != slur_dy, we'll do + slur_dy := note_dy * factor. + */ + if (sign (dy) != sign (note_dy)) + { + Real damp_f = paper ()->get_var ("slur_slope_follow_music_factor"); + Real dy = note_dy * damp_f; + Direction adjust_dir = (Direction)(- dir_ * sign (dy)); + /* + adjust only if no beam gets in the way + */ + if (!extrema[adjust_dir]->stem_l_->beam_l_ + || (adjust_dir == extrema[adjust_dir]->stem_l_->dir_) + || (extrema[adjust_dir]->stem_l_->beams_i_drul_[-adjust_dir] < 1)) + { + dy_f_drul_[adjust_dir] = dy_f_drul_[-adjust_dir] + + 2 * adjust_dir * dy; + Real dx = notewidth_f / 2; + if (adjust_dir != extrema[adjust_dir]->stem_l_->dir_) + dx /= 2; + dx_f_drul_[adjust_dir] -= adjust_dir * dx; + } + } + } + /* Avoid too steep slurs. - * slur from notehead to stemend: c''()b'' */ Real damp_f = paper ()->get_var ("slur_slope_damping"); Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT], @@ -302,3 +341,4 @@ Slur::get_rods () const a.push (r); return a; } + diff --git a/ly/GNUmakefile b/ly/GNUmakefile index 6513297576..dda5863d26 100644 --- a/ly/GNUmakefile +++ b/ly/GNUmakefile @@ -2,7 +2,7 @@ depth = .. -INI_FILES = $(FLY_FILES) $(LY_FILES) +INI_FILES = $(FLY_FILES) $(SLY_FILES) $(LY_FILES) EXTRA_DIST_FILES = $(SCM_FILES) INSTALLATION_DIR=$(datadir)/ly/ diff --git a/ly/init.sly b/ly/init.sly new file mode 100644 index 0000000000..e2ebe1905d --- /dev/null +++ b/ly/init.sly @@ -0,0 +1,16 @@ +% Toplevel initialisation file. + +\version "1.0.14"; + + +\include "declarations.ly" + +\score { + \notes\relative c { + \maininput + } + \paper { + linewidth=-1.0; + } + \midi{ } +} diff --git a/ly/params.ly b/ly/params.ly index f434d57cf4..8be7f2a9b2 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -70,6 +70,9 @@ slur_x_minimum = 3.0 * \interline; % slope damping: keep dy/dx < slur_slope_damping slur_slope_damping = 0.6; +% dy_slur := dy_music * factor +slur_slope_follow_music_factor = 0.8; + tie_x_minimum = \slur_x_minimum; tie_x_gap = \slur_x_gap; tie_slope_damping = 0.8; diff --git a/make/mutopia-vars.make b/make/mutopia-vars.make index d140f286cf..154917110b 100644 --- a/make/mutopia-vars.make +++ b/make/mutopia-vars.make @@ -2,18 +2,21 @@ # UGH UGH include $(make-dir)/lilypond-vars.make -FLY_FILES = $(wildcard *.fly) LY_FILES = $(wildcard *.ly) +FLY_FILES = $(wildcard *.fly) +SLY_FILES = $(wildcard *.sly) + M4_FILES = $(wildcard *.m4) LYM4_FILES = $(wildcard *.lym4) -EXTRA_DIST_FILES += $(FLY_FILES) $(LY_FILES) $(M4_FILES) $(LYM4_FILES) +EXTRA_DIST_FILES += $(FLY_FILES) $(SLY_FILES) $(LY_FILES) $(M4_FILES) $(LYM4_FILES) # WWW.make ly_examples=$(addprefix $(outdir)/, $(addsuffix .ly.txt, $(examples))) fly_examples=$(addprefix $(outdir)/, $(addsuffix .fly.txt, $(flexamples))) +sly_examples=$(addprefix $(outdir)/, $(addsuffix .sly.txt, $(slexamples))) -all_examples=$(flexamples) $(examples) +all_examples=$(flexamples) $(slexamples) $(examples) ps_examples=$(addprefix $(outdir)/, $(addsuffix .ps.gz, $(all_examples))) gif_examples=$(addprefix $(outdir)/, $(addsuffix .gif, $(all_examples))) -- 2.39.2