From d521102157a5c9d71ba80ee8f0eef47e50bd7dd4 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 31 Jan 2001 17:29:56 +0100 Subject: [PATCH] release: 1.3.127 ============ * Grand Refman restructuring, featuring outline mode. * Fixed missing menus and cross references. * Coriolan fixes and updates. * Bugfix: a2-engraver and *devnull_engraver recognise alternative 'oneXXX' 'twoXXX' naming convention. * Enabled markup text to be used for instrument names. * Bugfix: interface description of System_start_delimiter * Slur attachment fix (thanks, Han-Wen) 1.3.126.h --- CHANGES | 24 ++++- Documentation/user/properties.itely | 0 VERSION | 4 +- input/bugs/arpeggio-collision.ly | 0 input/bugs/chord-changes.ly | 0 input/bugs/coda-kludge.ly | 0 input/bugs/empty.ly | 0 input/bugs/guile-state.ly | 0 input/bugs/no-bars.ly | 0 input/bugs/repeat.ly | 2 + input/bugs/script.ly | 8 ++ input/bugs/spanners.ly | 0 input/bugs/staff-size.ly | 20 ++++ input/bugs/triplets.ly | 5 + input/bugs/volta.ly | 0 input/bugs/voltastart.ly | 0 .../repeat-volta-skip-alternatives.ly | 3 + input/test/allfontstyle.ly | 0 lily/all-font-metrics.cc | 10 +- lily/global-translator.cc | 3 +- lily/include/repeated-music.hh | 1 + lily/include/spring.hh | 4 + lily/include/unfolded-repeat-iterator.hh | 75 +-------------- lily/repeated-music.cc | 19 +++- lily/sequential-music-iterator.cc | 12 ++- lily/unfolded-repeat-iterator.cc | 95 ++++++++++++++++++- make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- mf/feta-generic.mf | 2 +- mutopia/Coriolan/violi-part.ly | 0 mutopia/Coriolan/violi.ly | 0 .../J.S.Bach/Solo-Cello-Suites/scs-paper.ly | 0 scm/basic-properties.scm | 2 + scm/documentation-lib.scm | 11 +++ scm/engraver-documentation-lib.scm | 4 +- scm/font.scm | 24 ++--- scm/interface-description.scm | 5 +- scm/paper.scm | 0 scm/translator-description.scm | 4 +- scm/translator-property-description.scm | 4 +- 40 files changed, 231 insertions(+), 122 deletions(-) delete mode 100644 Documentation/user/properties.itely delete mode 100644 input/bugs/arpeggio-collision.ly delete mode 100644 input/bugs/chord-changes.ly delete mode 100644 input/bugs/coda-kludge.ly delete mode 100644 input/bugs/empty.ly delete mode 100644 input/bugs/guile-state.ly delete mode 100644 input/bugs/no-bars.ly create mode 100644 input/bugs/repeat.ly create mode 100644 input/bugs/script.ly delete mode 100644 input/bugs/spanners.ly create mode 100644 input/bugs/staff-size.ly delete mode 100644 input/bugs/volta.ly delete mode 100644 input/bugs/voltastart.ly create mode 100644 input/regression/repeat-volta-skip-alternatives.ly delete mode 100644 input/test/allfontstyle.ly delete mode 100644 mutopia/Coriolan/violi-part.ly delete mode 100644 mutopia/Coriolan/violi.ly delete mode 100644 mutopia/J.S.Bach/Solo-Cello-Suites/scs-paper.ly delete mode 100644 scm/paper.scm diff --git a/CHANGES b/CHANGES index dcdd1c8539..24ab2a8f67 100644 --- a/CHANGES +++ b/CHANGES @@ -5,9 +5,6 @@ * Fixed missing menus and cross references. -1.3.126.jcn1 -============ - * Coriolan fixes and updates. * Bugfix: a2-engraver and *devnull_engraver recognise alternative @@ -19,6 +16,27 @@ * Slur attachment fix (thanks, Han-Wen) +1.3.126.hwn1 +============ + +* Bugfix in Global_translator::run_iterator_on_me (): only run +iterator::process if iterator::ok() is true. + +* Bugfix: when iterating empty sequential-music, start out with an +invalid iterator. + +* Bugfix: length calculation for volta repeat music with too few +alternatives. + +* Bugfix: print different string for first printed alternative in +volta repeat music with too few alternatives, eg. 1.-4. + +* Cleaned up bugs/ directory + +* Be less intelligent about default font backup, just load cmr10 + +* Generated documentation: sort and uniq Grob lists of contexts. + 1.3.126 ======= * Doco: diff --git a/Documentation/user/properties.itely b/Documentation/user/properties.itely deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/VERSION b/VERSION index 3b10972f02..5a8e32e50c 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=126 -MY_PATCH_LEVEL=jcn3 +PATCH_LEVEL=127 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/bugs/arpeggio-collision.ly b/input/bugs/arpeggio-collision.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/chord-changes.ly b/input/bugs/chord-changes.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/coda-kludge.ly b/input/bugs/coda-kludge.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/empty.ly b/input/bugs/empty.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/guile-state.ly b/input/bugs/guile-state.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/no-bars.ly b/input/bugs/no-bars.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/repeat.ly b/input/bugs/repeat.ly new file mode 100644 index 0000000000..c9f7e36b6f --- /dev/null +++ b/input/bugs/repeat.ly @@ -0,0 +1,2 @@ + +\score { \context Staff \notes \repeat volta 3 c1 \alternative { d1 e1 }} diff --git a/input/bugs/script.ly b/input/bugs/script.ly new file mode 100644 index 0000000000..b6b1b67d4e --- /dev/null +++ b/input/bugs/script.ly @@ -0,0 +1,8 @@ + +% the \stopped collides with the +%beam. + + +\score { \notes { +\clef "G"; \stemUp [a''8^\stopped a''8^\stopped] +}} diff --git a/input/bugs/spanners.ly b/input/bugs/spanners.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/staff-size.ly b/input/bugs/staff-size.ly new file mode 100644 index 0000000000..12482575ee --- /dev/null +++ b/input/bugs/staff-size.ly @@ -0,0 +1,20 @@ + + % separate staff-size is clumsy with \override. + +\score { + \notes \relative c' < \context Voice { + \property Staff.staffSpace = #10 + \property Staff.fontSize = #-1 + \property Voice.fontSize = #-1 + + \property Voice . dynamicDirection = \up \stemDown +%\key gis \major; + c8 d [e f g a] b c \ff + } + +\context Staff = VB { \property Voice . dynamicDirection = \down c,,4 \ff c c c } + +> +\paper { linewidth = -1.; } +} +\version "1.3.117"; diff --git a/input/bugs/triplets.ly b/input/bugs/triplets.ly index 802727f22e..a29c59da62 100644 --- a/input/bugs/triplets.ly +++ b/input/bugs/triplets.ly @@ -6,6 +6,11 @@ texidoc="Simple beams. This broke somewhere < 1.3.110 filename = "gammes_chromatiques.ly"; } +%{ + - At bar 3 of 2nd score, stems are too big (or the beams are + badly positionned) +%} + linebreak = \penalty -1000; $ex8 = \notes \relative c' { diff --git a/input/bugs/volta.ly b/input/bugs/volta.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/bugs/voltastart.ly b/input/bugs/voltastart.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/input/regression/repeat-volta-skip-alternatives.ly b/input/regression/repeat-volta-skip-alternatives.ly new file mode 100644 index 0000000000..ed612cef84 --- /dev/null +++ b/input/regression/repeat-volta-skip-alternatives.ly @@ -0,0 +1,3 @@ +\score { \notes \context Voice { + \repeat volta 3 c1 + \alternative { d f } e4 } } diff --git a/input/test/allfontstyle.ly b/input/test/allfontstyle.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 0c22c59b6c..33a4667ef7 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -18,7 +18,7 @@ #include "scm-hash.hh" #include "kpath.hh" -const char * default_font_sz_ = "cmr10"; +static const char * default_font_sz_ = "cmr10"; All_font_metrics::All_font_metrics (String path) { @@ -155,12 +155,10 @@ All_font_metrics::find_font (String name) warning (_ ("Loading default font")); String def_name = default_font_sz_; - SCM l = scm_assoc (ly_str02scm ("default"), - scm_eval2 (ly_symbol2scm ("cmr-alist"), SCM_EOL)); - - if (l != SCM_BOOL_F) - def_name = ly_scm2string (gh_cdr (l)); + /* + we're in emergency recovery mode here anyway, so don't try to do + anything smart that runs the risk of failing. */ f= find_afm (def_name); if (f) return f; diff --git a/lily/global-translator.cc b/lily/global-translator.cc index 61b724d40d..af8d804537 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -95,7 +95,8 @@ Global_translator::run_iterator_on_me (Music_iterator * iter) w = sneaky_insert_extra_moment (w); prepare (w); - iter->process (w); + if (iter->ok ()) + iter->process (w); one_time_step (); } diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index b7ebb339d8..5274e35b8f 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -58,6 +58,7 @@ public: Moment body_length_mom () const; Moment alternatives_length_mom (bool fold) const; + Moment alternatives_volta_length_mom () const; DECLARE_SCHEME_CALLBACK(unfolded_music_length, (SCM)); DECLARE_SCHEME_CALLBACK(volta_music_length, (SCM)); diff --git a/lily/include/spring.hh b/lily/include/spring.hh index aaa7fb5b5a..7bb5cc3685 100644 --- a/lily/include/spring.hh +++ b/lily/include/spring.hh @@ -28,6 +28,10 @@ struct Column_spring { struct Spring{ Drul_array item_l_drul_; Real distance_f_; + + /* + TODO: make 2 strengths: one for stretching, and one for shrinking. + */ Real strength_f_; void add_to_cols (); Spring (); diff --git a/lily/include/unfolded-repeat-iterator.hh b/lily/include/unfolded-repeat-iterator.hh index 11b6a8fef3..272365ecd4 100644 --- a/lily/include/unfolded-repeat-iterator.hh +++ b/lily/include/unfolded-repeat-iterator.hh @@ -1,76 +1,3 @@ -/* - unfolded-repeat-iterator.hh -- declare Unfolded_repeat_iterator - - source file of the GNU LilyPond music typesetter - - (c) 1999--2000 Han-Wen Nienhuys - - */ -#ifndef UNFOLDED_REPEAT_ITERATOR_HH -#define UNFOLDED_REPEAT_ITERATOR_HH - -#include "music-iterator.hh" - -/** - Iterate repeats. First do body, then alternatives one by one, - optionally interspersed by the body. - */ -class Unfolded_repeat_iterator : public Music_iterator -{ - void add_repeat_command (SCM); - -public: - VIRTUAL_COPY_CONS (Music_iterator); - /** - How often have we done the body (assuming bodies are interspersed.)? - */ - int done_count_; - static SCM constructor_cxx_function; - - /* - are we now busy doing the body? - - */ - bool do_main_b_; - - /* - are we doing volta's? - */ - bool volta_b_; - - /** How far have we progressed into the repeat. - This excludes the elt currently being iterated. - */ - Moment here_mom_; - int alternative_count_i_; - Music_iterator * current_iter_p_; - - /// pointer to the alternative that will be processed next. - SCM alternative_cons_; - ~Unfolded_repeat_iterator(); - Unfolded_repeat_iterator (); - Unfolded_repeat_iterator (Unfolded_repeat_iterator const &); -protected: - virtual void construct_children (); - virtual Moment pending_moment () const; - virtual void process (Moment); - virtual Music_iterator *try_music_in_children (Music *) const; - virtual void skip (Moment); - virtual SCM get_music (Moment) const; - - virtual bool ok () const; - virtual void next_element (bool side_effect); -}; - -class Volta_repeat_iterator : public Unfolded_repeat_iterator -{ -public: - Volta_repeat_iterator (); - static SCM constructor_cxx_function; - VIRTUAL_COPY_CONS(Music_iterator); -}; - - -#endif /* UNFOLDED_REPEAT_ITERATOR_HH */ +#error diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 9ff853a9a6..32e8202e81 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -89,6 +89,23 @@ Repeated_music::alternatives_length_mom (bool fold) const return m; } +/* + Sum all duration of all available alternatives. This is for the case + of volta repeats, where the alternatives are iterated just as they + were entered. */ +Moment +Repeated_music::alternatives_volta_length_mom () const +{ + SCM p = alternatives ()->music_list (); + Moment m; + while (gh_pair_p (p)) + { + m = m + unsmob_music (gh_car (p))->length_mom (); + p = gh_cdr (p); + } + return m; +} + Moment Repeated_music::body_length_mom () const { @@ -133,6 +150,6 @@ SCM Repeated_music::volta_music_length (SCM m) { Repeated_music* r = dynamic_cast (unsmob_music (m)); - Moment l = r->body_length_mom () + r->alternatives_length_mom (false); + Moment l = r->body_length_mom () + r->alternatives_volta_length_mom (); return l.smobbed_copy (); } diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 281b97c167..ff0940e3d5 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -99,10 +99,18 @@ void Sequential_music_iterator::descend_to_child () { Translator_group * child_report = child_report = iter_p_->report_to_l (); + Translator_group * me_report = report_to_l (); + if (dynamic_cast (iter_p_)) child_report = child_report->daddy_trans_l_; - - if (report_to_l()->depth_i () < child_report->depth_i ()) + + Translator_group * c = child_report; + while (c && c != me_report) + { + c= c->daddy_trans_l_; + } + + if (c == me_report) set_translator (child_report); } diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index 89e5ba2fc6..8ad34fe331 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -7,13 +7,80 @@ */ - +/* + This is too hairy. Maybe split into subclasses for volta and full + unfold? + + */ +#include "music-iterator.hh" #include "repeated-music.hh" #include "music-list.hh" -#include "unfolded-repeat-iterator.hh" #include "debug.hh" #include "translator-group.hh" +/** + Iterate repeats. First do body, then alternatives one by one, + optionally interspersed by the body. + */ +class Unfolded_repeat_iterator : public Music_iterator +{ + void add_repeat_command (SCM); + +public: + VIRTUAL_COPY_CONS (Music_iterator); + /** + How often have we done the body (assuming bodies are interspersed.)? + + In volta: the number to print in the bracket. + */ + int done_count_; + static SCM constructor_cxx_function; + + /* + are we now busy doing the body? + + */ + bool do_main_b_; + + /* + are we doing volta's? + */ + bool volta_b_; + + /** How far have we progressed into the repeat. + This excludes the elt currently being iterated. + */ + Moment here_mom_; + int alternative_count_i_; + Music_iterator * current_iter_p_; + + /// pointer to the alternative that will be processed next. + SCM alternative_cons_; + ~Unfolded_repeat_iterator(); + Unfolded_repeat_iterator (); + Unfolded_repeat_iterator (Unfolded_repeat_iterator const &); +protected: + virtual void construct_children (); + virtual Moment pending_moment () const; + virtual void process (Moment); + virtual Music_iterator *try_music_in_children (Music *) const; + virtual void skip (Moment); + virtual SCM get_music (Moment) const; + + virtual bool ok () const; + virtual void next_element (bool side_effect); +}; + +class Volta_repeat_iterator : public Unfolded_repeat_iterator +{ +public: + Volta_repeat_iterator (); + static SCM constructor_cxx_function; + VIRTUAL_COPY_CONS(Music_iterator); +}; + + + Unfolded_repeat_iterator::~Unfolded_repeat_iterator () { delete current_iter_p_; @@ -83,7 +150,20 @@ Unfolded_repeat_iterator::next_element (bool side_effect) if (volta_b_) { - String repstr = to_str (done_count_ + 1); + String repstr = to_str (done_count_ + 1) + "."; + + /* + we're coming in from main, so we're always on the first repeat. + */ + assert (done_count_ == 0); + + if (done_count_ == 0 + && alternative_count_i_ < repmus->repeat_count ()) + { + done_count_ += repmus->repeat_count () - alternative_count_i_; + repstr = "1.--" + to_str (done_count_ + 1) + "."; + } + if (do_repcommands) add_repeat_command (gh_list (ly_symbol2scm ("volta"), ly_str02scm (repstr.ch_C()), SCM_UNDEFINED)); @@ -142,7 +222,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) { if (do_repcommands) { - String repstr = to_str (done_count_ + 1); + String repstr = to_str (done_count_ + 1) + "."; add_repeat_command (gh_list (ly_symbol2scm ("volta"), ly_str02scm (repstr.ch_C()), SCM_UNDEFINED)); add_repeat_command (ly_symbol2scm ("end-repeat")); @@ -164,7 +244,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) bool Unfolded_repeat_iterator::ok () const { - return current_iter_p_ ; + return current_iter_p_; } Moment @@ -195,6 +275,11 @@ Unfolded_repeat_iterator::construct_children () current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_))); do_main_b_ = false; } + + while (current_iter_p_ && !current_iter_p_-> ok()) + { + next_element(true); + } } /* diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index a5dc66756c..d893a866dc 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.126 -Entered-date: 28JAN01 +Version: 1.3.127 +Entered-date: 31JAN01 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.126.tar.gz + 1000k lilypond-1.3.127.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.126.tar.gz + 1000k lilypond-1.3.127.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index b874fc94fa..fd768c6b3d 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,11 +1,11 @@ %define info yes Name: lilypond -Version: 1.3.126 +Version: 1.3.127 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.126.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.127.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index f7b7341288..4195416c33 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -1,4 +1,4 @@ -% +i% % feta-generic.mf -- implement generic stuff: include lots of files, but don't % set dims. % diff --git a/mutopia/Coriolan/violi-part.ly b/mutopia/Coriolan/violi-part.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mutopia/Coriolan/violi.ly b/mutopia/Coriolan/violi.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mutopia/J.S.Bach/Solo-Cello-Suites/scs-paper.ly b/mutopia/J.S.Bach/Solo-Cello-Suites/scs-paper.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scm/basic-properties.scm b/scm/basic-properties.scm index 9975d25cd7..6100beea2f 100644 --- a/scm/basic-properties.scm +++ b/scm/basic-properties.scm @@ -55,6 +55,8 @@ ;; documentme: difference between extra-space and minimum-space +;; documentme: difference between extra-space and minimum-space + ;; (Measured in staff space) (define default-break-align-space-alist '( diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm index 047dc03fdc..e69c04884f 100644 --- a/scm/documentation-lib.scm +++ b/scm/documentation-lib.scm @@ -13,6 +13,15 @@ (uniqued-alist (cdr alist) (cons (car alist) acc) )))) +(define (uniq-list list) + (if (null? list) '() + (if (null? (cdr list)) + list + (if (equal? (car list) (cadr list)) + (uniq-list (cdr list)) + (cons (car list) (uniq-list (cdr list))) + + )))) (define (aliststring (car x)) @@ -148,6 +157,8 @@ Add a ref if REF is set (string-append "@ref{" x "}")) (define (human-listify l) + "Produce a textual enumeration from L, a list of strings" + (cond ((null? l) "none") ((null? (cdr l)) (car l)) diff --git a/scm/engraver-documentation-lib.scm b/scm/engraver-documentation-lib.scm index 8e8ceff574..bd18c440f8 100644 --- a/scm/engraver-documentation-lib.scm +++ b/scm/engraver-documentation-lib.scm @@ -43,7 +43,7 @@ "" (string-append "This engraver creates the following grobs: \n " - (human-listify (map ref-ify objs)) + (human-listify (map ref-ify (uniq-list (sort objs string