From: fred Date: Tue, 26 Mar 2002 22:24:28 +0000 (+0000) Subject: lilypond-1.1.66 X-Git-Tag: release/1.5.59~2219 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=886122195ce576b1bdbb67cb1884a531100f0289;p=lilypond.git lilypond-1.1.66 --- diff --git a/ANNOUNCE-1.2 b/ANNOUNCE-1.2 index f0246bb97a..ee93a2d658 100644 --- a/ANNOUNCE-1.2 +++ b/ANNOUNCE-1.2 @@ -39,25 +39,26 @@ WHAT'S NEW? * Large cleanups, enhanced design and GUILE integration for smaller memory footprint and more flexible code. -* Direct output to PostScript (optional), PDFTeX or as GUILE script. +* Direct output to PostScript (optional), PDFTeX or as GUILE script + (default output still to plain TeX). -* convertors for ABC and MUP formats. +* Convertors for ABC and MUP formats. -* Font: now available as scaleable PostScript. New glyphs: time +* Font: now available as scalable PostScript. New glyphs: time signature, more note heads. * Enhanced input: semi-automatic beaming, (nested) tuplets, (nested) repeats, automatic staff switching, chordnames, automatic Lyrics durations. -* Grace notes, volta brackets, better spacing, multiple styles for - note heads and time signatures, breathing signs, lyric extenders, - cross staff beaming and slurring. +* Grace notes, volta brackets, multiple styles for note heads and + time signatures, breathing signs, lyric extenders, cross staff + beaming and slurring. -* --safe option for the paranoid +* --safe option for the paranoid. * More elegant spacing. Text is spaced exactly. -* lots of bugfixes +* Lots of bugfixes. diff --git a/TODO b/TODO index 2b0fcdc730..f922b37570 100644 --- a/TODO +++ b/TODO @@ -1,20 +1,20 @@ -*-outline-layout:(2 (-1 -1 0 :) 0);outline-stylish-prefixes:nil -*- * GNU LilyPond TODO -Features you cannot find in the doco as working, should be +Features you cannot find in the documentation as working, should be mentioned here. This is an assorted collection of stuff that will be -done, might be done, or is an idea that I want to think about +done, might be done, or is an idea that we want to think about. Most of the items are marked in the code as well -Grep for TODO and ugh/ugr/urg. +Grep -i for TODO, FIXME and ugh/ugr/urg. .* TODO before 1.2 . * align left edge of broken (de)cresc/slur/tie/tuplet/volta . * auto-staff-switching. +. * staccato-dot placement/quantisation is broken again . * warning if feta-nummer.tfm not found . * broken examples: input/star-spangled-banner.ly: hw? -mutopia/Coriolan/* . * spacing of accidentals . * key restorations & repeats . * rename \paper? @@ -75,6 +75,7 @@ one of the spacing bugs mentioned in the TODO. . * rhythmic staff & accidentals. . * use melismaBusy in Lyric context to typeset melismata correctly. . * ly2dvi/lilypond logfile. +. * def stem dir. . * hang Item on Spanner . * do --safe for PS output? . * msgfmt -o check? @@ -214,7 +215,6 @@ typeface. ie. leading is vertical space --hwn] \cadenza , \meter, should all be \properties . * fix singleStaffBracket . * rename -. * abbreviation-beam -> (measured/unmeasured) tremolo . * partial -> anacrouse . * move paper vars into engraver properties . * add new glyphs to font.ly diff --git a/input/bugs/spacing-very-tight.ly b/input/bugs/spacing-very-tight.ly index c903f74af8..fb03b9155f 100644 --- a/input/bugs/spacing-very-tight.ly +++ b/input/bugs/spacing-very-tight.ly @@ -1,11 +1,15 @@ -% when tightly spaced, hinterfleisch -> 0 (and not: -> note-width) -% we need a mininum of about a note-width/interline space before -% bar line +% When tightly spaced, hinterfleisch -> 0. +% Stems may touch the bar lines, opposite stems may touch eachother. +% We need a mininum of about a note-width/interline space in these +% situations, so that in tightly spaced music all vertical lines +% are about equally spaced. -% set rediculously tight \score { - \notes { \time 2/2; c'2 c'2 \time 2/2; } - \paper { linewidth = 2.0 \cm; - indent = 0.0; + \notes \relative c''{ + r1 e4 f, e' f, + } + \paper { + linewidth = 25.0 \mm; + indent = 0.0\mm; } } diff --git a/input/bugs/staccato-quantisation.sly b/input/bugs/staccato-quantisation.sly new file mode 100644 index 0000000000..1c290a4491 --- /dev/null +++ b/input/bugs/staccato-quantisation.sly @@ -0,0 +1,2 @@ +\stemup +f'-. g-. a-. b-. c-. d-. e-. diff --git a/input/test/chord-tremolo.sly b/input/test/chord-tremolo.sly new file mode 100644 index 0000000000..88cc140de0 --- /dev/null +++ b/input/test/chord-tremolo.sly @@ -0,0 +1,6 @@ +[:16 c'1 d] +[:8 c2 d] +[:16 c4 d] +[:32 c16 d] +[:32 c16 d] +[:16 c8 d] diff --git a/input/test/force-hshift.fly b/input/test/force-hshift.fly index 9bdee7d1e5..06c92d55fe 100644 --- a/input/test/force-hshift.fly +++ b/input/test/force-hshift.fly @@ -2,13 +2,16 @@ \context Staff < \context Voice = VA { \property Voice.forceHorizontalShift = "0.1" - \stemup \shifton + % \stemup \shifton + \property Voice.verticalDirection=1 + \property Voice.horizontalNoteShift=1 } \context Voice = VB { - \stemdown - \shifton + %\stemdown \shifton + \property Voice.verticalDirection=-1 + \property Voice.horizontalNoteShift=1 \property Voice.forceHorizontalShift = "-0.1" } diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index c539e883c6..550fbd652a 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -11,7 +11,7 @@ #include "musical-request.hh" #include "bar.hh" #include "beam.hh" -#include "abbreviation-beam.hh" +#include "chord-tremolo.hh" #include "rest.hh" #include "stem.hh" #include "debug.hh" @@ -299,7 +299,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) { junk_beam (); } - else if (Abbreviation_beam *b = dynamic_cast (info.elem_l_)) + else if (Chord_tremolo *b = dynamic_cast (info.elem_l_)) { junk_beam (); } diff --git a/lily/beam.cc b/lily/beam.cc index 64448f2450..ad751ac71c 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -24,6 +24,7 @@ needs what, and what information should be available when. #include +#include "chord-tremolo.hh" #include "new-beaming.hh" #include "proto.hh" #include "dimensions.hh" @@ -341,11 +342,14 @@ Beam::set_steminfo () for (int i=0; i < stems_.size (); i++) { Stem *s = stems_[i]; -#if 0 - // abbreviation beam needs to beam over invisible stems of wholes - if (s->invisible_b ()) - continue; -#endif + /* + Chord tremolo needs to beam over invisible stems of wholes + */ + if (!dynamic_cast (this)) + { + if (s->invisible_b ()) + continue; + } Stem_info info (s, multiple_i_); if (leftx == 0) @@ -667,7 +671,9 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const // UGH Real nw_f; - if (here->type_i ()== 1) + if (!here->head_l_arr_.size ()) + nw_f = 0; + else if (here->type_i ()== 1) nw_f = paper_l ()->get_var ("wholewidth"); else if (here->type_i () == 2) nw_f = paper_l ()->note_width () * 0.8; diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc new file mode 100644 index 0000000000..d41c8185a2 --- /dev/null +++ b/lily/chord-tremolo-engraver.cc @@ -0,0 +1,164 @@ +/* + abbreviation-beam-engraver.cc -- implement Chord_tremolo_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ + +#include "duration-convert.hh" +#include "time-description.hh" +#include "chord-tremolo-engraver.hh" +#include "stem.hh" +#include "chord-tremolo.hh" +#include "musical-request.hh" +#include "misc.hh" +#include "warn.hh" +#include "score-engraver.hh" + +ADD_THIS_TRANSLATOR (Chord_tremolo_engraver); + +Chord_tremolo_engraver::Chord_tremolo_engraver () +{ + reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0; + abeam_p_ = 0; + finished_abeam_p_ = 0; + prev_start_req_ = 0; +} + +bool +Chord_tremolo_engraver::do_try_music (Music* m) +{ + if (Chord_tremolo_req* b = dynamic_cast (m)) + { + Direction d = b->span_dir_; + if (reqs_drul_[d] && !reqs_drul_[d]->equal_b (b)) + return false; + + if ((d == STOP) && !abeam_p_) + { + m->warning (_ ("No abbreviation beam to end")); + return false; + } + + reqs_drul_[d] = b; + return true; + } + + return false; +} + +void +Chord_tremolo_engraver::do_process_requests () +{ + if (reqs_drul_[STOP]) + { + if (!abeam_p_) + reqs_drul_[STOP]->warning (_("No abbreviation beam to end")); + prev_start_req_ = 0; + finished_abeam_p_ = abeam_p_; + abeam_p_ = 0; + } + + if (abeam_p_) + { + Score_engraver * e = 0; + Translator * t = daddy_grav_l (); + for (; !e && t; t = t->daddy_trans_l_) + { + e = dynamic_cast (t); + } + + if (!e) + programming_error ("No score engraver!"); + else + e->forbid_breaks (); + } + + if (reqs_drul_[START]) + { + if (abeam_p_) + { + reqs_drul_[START]->warning (_ ("Already have an abbreviation beam")); + return; + } + + prev_start_req_ = reqs_drul_[START]; + + abeam_p_ = new Chord_tremolo; + announce_element (Score_element_info (abeam_p_, reqs_drul_[LEFT])); + } +} + +void +Chord_tremolo_engraver::do_post_move_processing () +{ + reqs_drul_ [START] = 0; +} + +void +Chord_tremolo_engraver::do_pre_move_processing () +{ + typeset_beam (); +} + +void +Chord_tremolo_engraver::typeset_beam () +{ + if (finished_abeam_p_) + { + typeset_element (finished_abeam_p_); + finished_abeam_p_ = 0; + + reqs_drul_[STOP] = 0; + } +} + +void +Chord_tremolo_engraver::do_removal_processing () +{ + typeset_beam (); + if (abeam_p_) + { + prev_start_req_->warning (_ ("Unfinished abbreviation beam")); + finished_abeam_p_ = abeam_p_; + typeset_beam (); + } +} + +void +Chord_tremolo_engraver::acknowledge_element (Score_element_info i) +{ + if (abeam_p_) + { + if (Stem* s = dynamic_cast (i.elem_l_)) + { + int type_i = prev_start_req_->type_i_; + s->flag_i_ = intlog2 (type_i) - 2; + + s->beams_i_drul_[LEFT] = s->flag_i_; + s->beams_i_drul_[RIGHT] = s->flag_i_; + + abeam_p_->multiple_i_ = s->flag_i_; + /* + abbrev gaps on all but half note + */ +#if 0 + if (s->type_i () != 1) + { + int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2); + s->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i)); + } +#else + if (s->type_i () != 1) + { + int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2); + abeam_p_->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i)); + } +#endif + + abeam_p_->add_stem (s); + } + } +} diff --git a/lily/chord-tremolo.cc b/lily/chord-tremolo.cc new file mode 100644 index 0000000000..fe743fad40 --- /dev/null +++ b/lily/chord-tremolo.cc @@ -0,0 +1,60 @@ +/* + abbreviation-beam.cc -- implement Chord_tremolo + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ + +#include "paper-column.hh" +#include "array.hh" +#include "proto.hh" +#include "chord-tremolo.hh" +#include "misc.hh" +#include "debug.hh" + +#include "molecule.hh" +#include "leastsquares.hh" +#include "stem.hh" +#include "paper-def.hh" +#include "lookup.hh" +#include "stem-info.hh" + + + + +Chord_tremolo::Chord_tremolo () + : Beam () +{ +} + +Molecule* +Chord_tremolo::do_brew_molecule_p () const +{ + return Beam::do_brew_molecule_p (); +} + +void +Chord_tremolo::do_print () const +{ +#ifndef NPRINT + Beam::do_print (); + Spanner::do_print (); +#endif +} + +/* + beams to go with one stem. + */ +Molecule +Chord_tremolo::stem_beams (Stem *here, Stem *next, Stem *prev) const +{ + /* + todo + - shorter beams (not reaching outer "stems") + for [:16 c4 c4] and [:16 c1 c1] + - centered beam on [:16 c1 c1] heads, rather than "stems" + */ + return Beam::stem_beams (here, next, prev); +} diff --git a/lily/column-x-positions.cc b/lily/column-x-positions.cc new file mode 100644 index 0000000000..894844de45 --- /dev/null +++ b/lily/column-x-positions.cc @@ -0,0 +1,78 @@ +/* + colhpos.cc -- implement Column_x_positions + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#include "column-x-positions.hh" +#include "real.hh" +#include "debug.hh" +#include "vector.hh" +#include "line-spacer.hh" + +Column_x_positions::Column_x_positions() +{ + energy_f_ = infinity_f; + satisfies_constraints_b_ = false; + spacer_l_ =0; +} + +Column_x_positions::~Column_x_positions() +{ + +} + +void +Column_x_positions::add_paper_column (Paper_column*c) +{ + cols_.push (c); +} + +void +Column_x_positions::print() const +{ +#ifndef NPRINT + DOUT << "energy : " << energy_f_ << '\n'; + DOUT << "line of " << config_.size() << " cols\n"; + Vector v (config_); + DOUT << v; +#endif +} + +void +Column_x_positions::OK() const +{ +#ifndef NDEBUG + assert (config_.size() == cols_.size ()); +#endif +} + +void +Column_x_positions::set_stupid_solution(Vector v) +{ + energy_f_ = infinity_f; + config_ = v; +} + +void +Column_x_positions::stupid_solution() +{ + set_stupid_solution (spacer_l_->default_solution()); +} + +void +Column_x_positions::solve_line() +{ + spacer_l_->solve (this); +} + + +void +Column_x_positions::approximate_solve_line() +{ + spacer_l_->lower_bound_solution (this); +} + + diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index cc494cfa88..382548592d 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -7,7 +7,7 @@ */ #include "gourlay-breaking.hh" -#include "colhpos.hh" +#include "column-x-positions.hh" #include "spring-spacer.hh" #include "debug.hh" #include "paper-column.hh" diff --git a/lily/include/break.hh b/lily/include/break.hh index f2b9d9df90..c6654fa8f0 100644 --- a/lily/include/break.hh +++ b/lily/include/break.hh @@ -12,7 +12,7 @@ #include "array.hh" #include "interval.hh" #include "lily-proto.hh" -#include "colhpos.hh" +#include "column-x-positions.hh" /** Statistics for the number of columns calced. diff --git a/lily/include/chord-tremolo-engraver.hh b/lily/include/chord-tremolo-engraver.hh new file mode 100644 index 0000000000..3616779e21 --- /dev/null +++ b/lily/include/chord-tremolo-engraver.hh @@ -0,0 +1,44 @@ +/* + chord-tremolo-engraver.hh -- declare Chord_tremolo_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ + + +#ifndef Chord_tremolo_ENGRAVER_HH +#define Chord_tremolo_ENGRAVER_HH + +#include "engraver.hh" +#include "drul-array.hh" + +/** + Generate an abbreviation beam. Eat stems. + */ +class Chord_tremolo_engraver : public Engraver +{ +public: + VIRTUAL_COPY_CONS(Translator); + + + Chord_tremolo_engraver(); + +protected: + virtual void do_removal_processing(); + virtual void do_process_requests(); + virtual bool do_try_music (Music*); + virtual void acknowledge_element (Score_element_info); + virtual void do_pre_move_processing(); + virtual void do_post_move_processing(); + +private: + void typeset_beam (); + Drul_array reqs_drul_; + Chord_tremolo_req* prev_start_req_; + Chord_tremolo* abeam_p_; + Chord_tremolo* finished_abeam_p_; +}; + +#endif // Chord_tremolo_ENGRAVER_HH diff --git a/lily/include/chord-tremolo.hh b/lily/include/chord-tremolo.hh new file mode 100644 index 0000000000..eb2d133f28 --- /dev/null +++ b/lily/include/chord-tremolo.hh @@ -0,0 +1,33 @@ +/* + chord-tremolo-engraver.hh -- declare Chord_tremolo_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ + +#ifndef Chord_tremolo_HH +#define Chord_tremolo_HH + +#include "beam.hh" + +/** a beam connects multiple stems Beam adjusts the stems its owns to + make sure that they reach the beam and that point in the correct + direction */ +class Chord_tremolo : public Beam { +public: + + + Chord_tremolo(); + + VIRTUAL_COPY_CONS(Score_element); + +protected: + virtual void do_print() const; + virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const; + virtual Molecule* do_brew_molecule_p() const; +}; + +#endif // Chord_tremolo_HH + diff --git a/lily/include/column-x-positions.hh b/lily/include/column-x-positions.hh new file mode 100644 index 0000000000..254ae882a7 --- /dev/null +++ b/lily/include/column-x-positions.hh @@ -0,0 +1,38 @@ +/* + column-x-positions.hh -- part of GNU LilyPond + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#ifndef COLUMN_X_POSITIONS_HH +#define COLUMN_X_POSITIONS_HH + +#include "parray.hh" +#include "lily-proto.hh" + +typedef Link_array Line_of_cols; + +struct Column_x_positions { + Line_spacer * spacer_l_; + Line_of_cols cols_; + Array config_; + + Real energy_f_; + bool satisfies_constraints_b_; + + void OK() const; + ~Column_x_positions(); + void solve_line(); + void approximate_solve_line(); + /** generate a solution with no regard to idealspacings or + constraints. should always work */ + void stupid_solution(); + void set_stupid_solution (Vector); + Column_x_positions(); + void add_paper_column (Paper_column*c); + void print() const; +}; + + +#endif // COLUMN_X_POSITIONS_HH + diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index e360dbfa62..dd2cd050f9 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -12,9 +12,6 @@ -struct Abbreviation_beam; -struct Abbreviation_beam_engraver; -struct Abbreviation_beam_req; struct Absolute_dynamic_req; struct Adobe_font_char_metric; struct Adobe_font_metric; @@ -58,6 +55,9 @@ struct Bracket_req; struct Break_align_item; struct Break_req; struct CHyphen_req; +struct Chord_tremolo; +struct Chord_tremolo_engraver; +struct Chord_tremolo_req; struct Cadenza_req; struct Change_iterator; struct Change_translator; diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index 6cf5efbfae..d80ae6b1e2 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -7,7 +7,7 @@ #ifndef SCORELINE_HH #define SCORELINE_HH -#include "colhpos.hh" +#include "column-x-positions.hh" #include "axis-group-spanner.hh" #include "super-element.hh" diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 8f380e9a04..cf583c1b99 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -168,12 +168,12 @@ public: }; /** Start / stop an abbreviation beam. */ -class Abbreviation_beam_req : public Span_req +class Chord_tremolo_req : public Span_req { public: VIRTUAL_COPY_CONS (Music); - Abbreviation_beam_req (); + Chord_tremolo_req (); virtual void do_print () const; diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index e27fe72943..c17afddfee 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -10,7 +10,7 @@ #ifndef P_SCORE_HH #define P_SCORE_HH -#include "colhpos.hh" +#include "column-x-positions.hh" #include "parray.hh" #include "lily-proto.hh" #include "music-output.hh" diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index 354b664fb6..ffab17f066 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -13,7 +13,7 @@ #include "line-spacer.hh" #include "cons.hh" #include "col-info.hh" -#include "colhpos.hh" +#include "column-x-positions.hh" #include "moment.hh" diff --git a/lily/include/tie-engraver.hh b/lily/include/tie-engraver.hh index 448ed17230..7246d0e4f8 100644 --- a/lily/include/tie-engraver.hh +++ b/lily/include/tie-engraver.hh @@ -44,6 +44,7 @@ class Tie_engraver : public Engraver Array stopped_heads_; Link_array tie_p_arr_; + void set_melisma (bool); protected: virtual void do_post_move_processing (); virtual void do_pre_move_processing (); diff --git a/lily/musical-request.cc b/lily/musical-request.cc index c4d8efa4fe..cedc1ce5e0 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -159,13 +159,13 @@ Span_req::Span_req () span_dir_ = CENTER; } -Abbreviation_beam_req::Abbreviation_beam_req () +Chord_tremolo_req::Chord_tremolo_req () { type_i_ = 0; } void -Abbreviation_beam_req::do_print () const +Chord_tremolo_req::do_print () const { #ifndef NPRINT DOUT << type_i_; diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index f80fe91561..f458a7a97a 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -20,7 +20,7 @@ #include "pointer.tcc" #include "score-column.hh" #include "paper-def.hh" -#include "colhpos.hh" +#include "column-x-positions.hh" #include "main.hh" Vector