From: Han-Wen Nienhuys Date: Tue, 13 Jul 1999 23:58:22 +0000 (+0200) Subject: release: 1.1.58 X-Git-Tag: release/1.1.58 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=ad4297de0246935caa4c51f4e152e20009a6f64e;p=lilypond.git release: 1.1.58 --- diff --git a/Documentation/tex/lilypond-regtest.doc b/Documentation/tex/lilypond-regtest.doc index a92910cdee..611478d23a 100644 --- a/Documentation/tex/lilypond-regtest.doc +++ b/Documentation/tex/lilypond-regtest.doc @@ -24,6 +24,14 @@ you must create a special context called Thread. \mudelafile{noteheadstyle.ly} +Noteheads can have dots, and ---although this is bad style--- rests +can too. Augmentation dots should never be printed on a staff line, +but rather be shifted: down stem notes shift dots down, up stem up. +In case of chords, all dots should be in a column. The dots go along +as rests are shifted to avoid collisions. + +\mudelafile{dots.fly} + Multiple measure rests do not collide with barlines and clefs. They are not expanded when you set \verb+Score.SkipBars+. Although the multi-measure-rest is a Spanner, minimum distances are set to keep it @@ -47,10 +55,12 @@ point) are mixed. \section{Grace notes} Grace notes are typeset as an encapsulated piece of music. You can -have beams, notes, chords, stems etc. within a \verb|\grace| -section. Slurs that start within a grace section, but aren't ended are -attached to the next normal note. Grace notes have zero duration. If -there are tuplets, the grace notes won't be under the brace. +have beams, notes, chords, stems etc. within a \verb|\grace| section. +Slurs that start within a grace section, but aren't ended are attached +to the next normal note. Grace notes have zero duration. If there +are tuplets, the grace notes won't be under the brace. Grace notes +can have accidentals, but they are (currently) spaced at a fixed +distance. diff --git a/NEWS b/NEWS index 2a01616cca..cc7169ce80 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,34 @@ +pl 57.hwn1 + - bf: accidentals on grace notes. + - \property graceAccidentalSpace + - bf: ignore grace notes duration for non-grace spacing. + - uncommented Key_req::transpose. + - Dot_column::do_post_processing (): better dot collisions, see dots.fly. + - derive Dot_column from Note_side_item. + - renaming of files + * heads-engraver + * request-iterator + * p-score + * engraver-group + +pl 57.jcn3 + - bf: no extension: assume .ly + - bf: bow::do_width; which in turn allowed + - removed broken interstaff slur damping hack, and + - bf: slur height damping fixes damping + +pl 57.jcn2 + - bf: ? priority and snap to stem + +pl 56.jcn4 + - interstaff slur fixes and damping + +pl 56.mk1 + - bf: collision.cc: collisions between chords with different + stem directions and close heads. + +****************s************** + pl 56.jcn3 - slur de-hairification * slurs always attached to noteheads, by default @@ -272,7 +303,7 @@ pl 49.uu1 - bf: linebreak at |: - doc updates by Adrian Mariano -pl 49-rst +pl 49.mk1 - Breathing signs by Michael Krause ************ diff --git a/TODO b/TODO index e95bd85eda..92e9b48a21 100644 --- a/TODO +++ b/TODO @@ -10,48 +10,31 @@ Grep for TODO and ugh/ugr/urg. .* TODO before 1.2 . * rename 'staff_line_leading' (who is being lead where?) to -staff_space, interline; (or other meaningful name) and use throughout lily -. * rename files to class-name: -. * heads-engraver -. * request-iterator -. * p-score -. * engraver-group -. * standardise(d) switches: -v, --version; -d, --debug, -. * Peter 1. Key signatures are no longer transposed with the rest - of - the music. - - \notes\transpose bes {\key D; d1 } - should produce no key signature (key C) - - 2. Crescendos and other dynamic markings that start inside a - \grace { } section are ignored. +staff_space, interline; (or other meaningful name) and use throughout +lily - \notes \relative c' { fis4 r4 \grace { [g16 ( \< a16] } - ) b4 \! a8. g16} +[-> leading are the lead strips between the sticks (lines) of +typeface. ie. leading is vertical space --hwn] - 3. Slurs that end within a grace section but start outside - are treated strangely. - a2 d,4 ( \grace { [e16 ) d16]} cis8 d - - - 4. Lyrics and grace sections don't go too well together. +. * move \version check to lexer.ll +. * junk delayed spanner breaking. +. * check dangling_scm_sym working. +. * revise pianobrace to put font stuff into Lookup +. * standardise(d) switches: -v, --version; -d, --debug, +. * spacing of accidentals +. * restorations & repeats +. * dotted rests? +. * input/test/grace.ly spacing (triplet!) +. * spanners from grace to normal ctxt +.* 4. Lyrics and grace sections don't go too well together. The words are aligned with the main note, not the start of the grace note. This is usually wrong, but is sometimes right. - - . * Auto_beam debugging output (waarom/wanneer heb jij die weggehaald?) . * Rename illegal to invalid . * Mats: - The Postscript output is still very experimental -- The reference manual contain a number of exampels that don't - pass lilypond, among other the chord syntax. - -- Accidentals for grace notes are drawn at the wrong place. See - comment in grace.ly - - It is impossible to typeset two textual scripts that are stacked on top of eachother and avoids note collisions and at the same time are typeset with different textStyle. I tried to move around @@ -63,9 +46,6 @@ staff_space, interline; (or other meaningful name) and use throughout lily be stacked vertically, avoiding collisions with the notes in all voices. -- If an \alternative is directly followed by a new \repeat, - Lily gives an assertion failure. See the comment in volta.fly - - I'd like to change the \repetitions command to Jan's suggested syntax: \repeat "repeatsymbol" 2 {...}, but I'm not sure that I understand the implementation of repeats well enough. @@ -83,38 +63,6 @@ staff_space, interline; (or other meaningful name) and use throughout lily GIFs attached for easy reference: #1: time meter and first note on the line are too close; #2: last note on the line and next bar are too close. - -- And I haven't got any feedback on this one, posted last week: - -Check out: - -\score { - \notes \relative c' { - \context Staff < - \context Voice = one { \stemdown c1 c4 } - \context Voice = two { \stemup d1 d4 } - > - } -} - -Notes are shifted as expected. Now check out: - -\score { - \notes \relative c' { - \context Staff < - \context Voice = one { \stemdown c1 } - \context Voice = two { \stemup d1 d4 } - > - } -} - -i.e. do - -- \context Voice = one { \stemdown c1 c4 } -+ \context Voice = one { \stemdown c1 } - -Now the chord collides with the note of the other voice! - . * relative mode for midi2ly . * Crescendi/diminuendi that cross a line break lose their vertical @@ -153,15 +101,12 @@ following example. . * formatting of input stuff. . * deps for ly2dvi . * decide wether to junk _ in lyrics. -. * sane strategy for extensions (assume .ly): -02:22:24 appel ~/usr/src/lilypond$ lilypond foo -GNU LilyPond 1.1.54. -[/home/fred/usr/src/lilypond/scm/lily.scm] -warning: can't find file: `init' . * indent = 0.0 with linewidth=-1.0 . * collisions & accidentals. -. * auto-beaming in input/test/spacing.ly. -huh, snap niks van: gewone beam gaat wel goed. hoe kan abe nu +. * auto-beaming in input/test/spacing.ly: +Non-finished auto-beams (consider_end_and_begin didn't decide to +end beam), that get typeset in removal_processing (eg: end of a piece) +Huh, snap niks van: gewone beam gaat wel goed. hoe kan abe nu invloed hebben op beam-creatie, stopt toch gewoon stokken in? . * music ending in grace notes. . * PostScript @@ -307,7 +252,6 @@ repeated section with different words for each repeat. . * disable spaces in TeX stuff . * handle ^C for tmp/file creation. . * make LilyPond RPM fully relocatable -. * dots & rest collisions. . * the warning about the negative slur/tie length appears twice which is irritating. . * better hshift (dots, distance, head dependent) @@ -641,11 +585,3 @@ hesitate to ask. (require 'allout) (outline-init 't) -+ pl 56.jcn3 -+ - slur de-hairification -+ * slurs always attached to noteheads, by default -+ * corrections for steep and high slurs -+ * snap to stem end when close -+ - bow/tie/slur dy/dx fix -+ -+ diff --git a/VERSION b/VERSION index 4cfbcaff7b..0e9fb9aa7b 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=57 +PATCH_LEVEL=58 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/test/dots.fly b/input/test/dots.fly new file mode 100644 index 0000000000..a111a6df2f --- /dev/null +++ b/input/test/dots.fly @@ -0,0 +1,9 @@ + +d''4. b c4 | +%This doesn't really work yet. + +\context Staff < + \context Voice = VA { \stemup r4. } + \context Voice = VB { \stemdown r4. } +> + diff --git a/input/test/grace.ly b/input/test/grace.ly index 2155314bed..3c8c8c9030 100644 --- a/input/test/grace.ly +++ b/input/test/grace.ly @@ -3,7 +3,8 @@ \grace c8 c4 \grace { [c32 cis32] } c4 \grace { [c32 c32] } \times 2/3 { [c8 c c] } - \grace { [b32 ( c32] } c4 + \grace { [b32 ( c32] } ) c4 \grace c16 [c8 c8] } +\paper {linewidth = -1.;} } diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index 3bf92b841b..b0307f2e6f 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -7,7 +7,7 @@ Jan Nieuwenhuizen */ -#include "p-col.hh" +#include "paper-column.hh" #include "array.hh" #include "proto.hh" #include "abbreviation-beam.hh" diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index 3c1ff77b42..4e00da6840 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -10,6 +10,8 @@ #include "engraver.hh" #include "grace-align-item.hh" #include "note-column.hh" +#include "local-key-item.hh" +#include "warn.hh" /** catch notes, and put them in a row. @@ -17,6 +19,11 @@ class Align_note_column_engraver: public Engraver { Axis_align_item * align_item_p_; + Note_column * now_column_l_; + Local_key_item * accidental_l_; + + virtual void process_acknowledged (); + virtual void do_post_move_processing (); virtual void do_creation_processing (); virtual void do_removal_processing (); virtual void acknowledge_element (Score_element_info); @@ -28,6 +35,8 @@ public: Align_note_column_engraver::Align_note_column_engraver() { align_item_p_ =0; + now_column_l_ =0; + accidental_l_ =0; } void @@ -50,8 +59,47 @@ Align_note_column_engraver::acknowledge_element (Score_element_info inf) { if (Note_column * n = dynamic_cast (inf.elem_l_)) { - align_item_p_->add_element (n); + now_column_l_ =n; + } + else if (Local_key_item * it = dynamic_cast (inf.elem_l_)) + { + accidental_l_ = it; + } +} +void +Align_note_column_engraver::process_acknowledged () +{ + if (now_column_l_ && accidental_l_) + { + + /* Can't inspect width of Local_key_item, since + + A. it may not be fully built + + B. it has no pscore_l_ field. + + */ + Scalar grsp = get_property ("graceAccidentalSpace", 0); + if (grsp.isnum_b ()) + { + Real extra_space = double(grsp); + SCM e = gh_cons (gh_double2scm (-extra_space), gh_double2scm (0.0)); + now_column_l_->set_elt_property (extra_space_scm_sym, e); + } + } + + if (now_column_l_) + { + align_item_p_->add_element (now_column_l_); + now_column_l_ =0; } } +void +Align_note_column_engraver::do_post_move_processing () +{ + now_column_l_ =0; + accidental_l_ =0; +} + ADD_THIS_TRANSLATOR(Align_note_column_engraver); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 44b85b416e..a3bf9111fd 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -8,7 +8,7 @@ #include "axis-group-engraver.hh" #include "axis-group-spanner.hh" -#include "p-col.hh" +#include "paper-column.hh" Axis_group_engraver::Axis_group_engraver () { diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc index 65570d0623..b43f07e270 100644 --- a/lily/axis-group-item.cc +++ b/lily/axis-group-item.cc @@ -6,7 +6,7 @@ (c) 1997--1999 Han-Wen Nienhuys */ #include "axis-group-item.hh" -#include "p-col.hh" +#include "paper-column.hh" diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index b625c6c6b3..aed0954e47 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -9,7 +9,7 @@ #include "axis-group-spanner.hh" #include "debug.hh" #include "item.hh" -#include "p-col.hh" +#include "paper-column.hh" /** Do stuff if we're not broken. In this case the last and first columns usually are pre- and postbreak respectively, diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index b319bdc4bc..086f6bd62f 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -13,7 +13,7 @@ #include "staff-side.hh" #include "text-item.hh" #include "lily-guile.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" Bar_script_engraver::Bar_script_engraver () @@ -61,6 +61,7 @@ Bar_script_engraver::do_acknowledge_element (Item *i) How do we make sure that staff_side_p_ has a dependency from someone else? We can't use i for that, so we use some other element. */ + // staff_side_p_->set_elt_property (dangling_scm_sym, SCM_BOOL_T) get_staff_info ().command_pcol_l ()->add_dependency (staff_side_p_); } } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 849163e5be..608167f01b 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -180,7 +180,6 @@ Beam_engraver::acknowledge_element (Score_element_info info) return; } - if (rhythmic_req->duration_.durlog_i_<= 2) { rhythmic_req->warning (_ ("stem doesn't fit in beam")); diff --git a/lily/bow.cc b/lily/bow.cc index a3ac0bf073..588c7f9c74 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -70,7 +70,7 @@ Bow::do_height () const Array c (get_controls()); for (int i=0; i < c.size (); i++) { - Real y = c[i][Y_AXIS] + dy_f_drul_[LEFT]; + Real y = c[i][Y_AXIS]; iv.unite (Interval (y,y)); } return iv; diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index d8e284a388..5f5079dad5 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -9,9 +9,9 @@ #include "lily-guile.hh" #include "break-align-item.hh" #include "dimensions.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "paper-def.hh" -#include "p-col.hh" +#include "paper-column.hh" /* diff --git a/lily/break.cc b/lily/break.cc index f362ef5ff1..8291f81a23 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -12,8 +12,8 @@ #include "spring-spacer.hh" #include "debug.hh" #include "line-of-score.hh" -#include "p-score.hh" -#include "p-col.hh" +#include "paper-score.hh" +#include "paper-column.hh" #include "cpu-timer.hh" #include "command-request.hh" diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 1e8ce2dae9..208365788a 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -13,7 +13,7 @@ #include "paper-def.hh" #include "lookup.hh" #include "text-item.hh" -#include "p-score.hh" +#include "paper-score.hh" void Clef_item::do_pre_processing() diff --git a/lily/col-info.cc b/lily/col-info.cc index fa87a8f653..47d9c69c33 100644 --- a/lily/col-info.cc +++ b/lily/col-info.cc @@ -6,7 +6,7 @@ (c) 1997--1999 Han-Wen Nienhuys */ -#include "p-col.hh" +#include "paper-column.hh" #include "col-info.hh" #include "debug.hh" diff --git a/lily/collision.cc b/lily/collision.cc index 1ddff7d2f7..a252a633d3 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -114,8 +114,8 @@ Collision::do_pre_processing() Note_column *cd_l =clash_groups[DOWN][0]; Note_head * nu_l= cu_l->head_l_arr_[0]; Note_head * nd_l = cd_l->head_l_arr_.top(); - int downpos = cd_l->head_positions_interval ()[SMALLER]; - int uppos = cu_l->head_positions_interval ()[BIGGER]; + int downpos = cd_l->head_positions_interval ()[BIGGER]; + int uppos = cu_l->head_positions_interval ()[SMALLER]; bool merge = downpos == uppos diff --git a/lily/command-request.cc b/lily/command-request.cc index 7ce3b9fd6c..218d283f1b 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -170,3 +170,11 @@ Mark_req::do_print () const { DOUT << str_; } +void +Key_change_req::transpose (Musical_pitch p) +{ + key_.transpose (p); +} + + + diff --git a/lily/dot-column.cc b/lily/dot-column.cc index b673b77092..4bcaff4a67 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -23,39 +23,60 @@ Dot_column::add_head (Rhythmic_head *r) { if (!r->dots_l_) return ; - - head_l_arr_.push (r); - add_dependency (r); + + add_support (r); add_dots (r->dots_l_); } void Dot_column::do_substitute_element_pointer (Score_element*o,Score_element*n) { - Item *oi =dynamic_cast (o); - - if (oi && dynamic_cast (oi)) - head_l_arr_.substitute (dynamic_cast (oi), - dynamic_cast(n)); - else if (oi && dynamic_cast (oi)) - dot_l_arr_.substitute (dynamic_cast (oi), - dynamic_cast (n)); + Note_head_side::do_substitute_element_pointer (o,n); + if (Dots * d = dynamic_cast (o)) + dot_l_arr_.substitute (d, dynamic_cast (n)); +} + +int +Dot_column::compare (Dots * const &d1, Dots * const &d2) +{ + return d1->position_i_ - d2->position_i_; } void Dot_column::do_pre_processing () { - Interval w; - for (int i=0; i < head_l_arr_.size (); i++) - w.unite (head_l_arr_[i]->extent (X_AXIS)); - - if (!w.empty_b ()) - translate_axis (w[RIGHT] - extent(X_AXIS) [LEFT],X_AXIS); + dot_l_arr_.sort (Dot_column::compare); + Note_head_side::do_pre_processing (); } - - Dot_column::Dot_column () { + align_dir_ = RIGHT; set_axes(X_AXIS,X_AXIS); } + +void +Dot_column::do_post_processing () +{ + if (dot_l_arr_.size () < 2) + return; + Slice s; + s.set_empty (); + + for (int i=0; i < dot_l_arr_.size (); i++) + { + s.unite (Slice (dot_l_arr_[i]->position_i_,dot_l_arr_[i]->position_i_)); + } + int middle = s.center (); + /* + +1 -> off by one + */ + int pos = middle - dot_l_arr_.size () + 1; + if (!(pos % 2)) + pos ++; // center () rounds down. + + for (int i=0; i position_i_ = pos; + } +} diff --git a/lily/dots.cc b/lily/dots.cc index 6d9af00dd2..e81108b0c6 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -13,16 +13,20 @@ Dots::Dots () { - no_dots_i_ =0; + dots_i_ =0; position_i_ =0; + resolve_dir_ =CENTER; } void Dots::do_post_processing () { + if (!resolve_dir_) + resolve_dir_ = DOWN; + if (!(position_i_ % 2)) - position_i_ ++; - if (!no_dots_i_) + position_i_ += resolve_dir_; + if (!dots_i_) { set_elt_property (transparent_scm_sym, SCM_BOOL_T); set_empty (true); @@ -41,7 +45,7 @@ Dots::do_brew_molecule_p () const Real dw = d.dim_[X_AXIS].length (); d.translate_axis (-dw, X_AXIS); - for (int i=no_dots_i_; i--; ) + for (int i=dots_i_; i--; ) { d.translate_axis (2*dw,X_AXIS); out->add_molecule (d); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 833e40c83b..0d6b61ae25 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -178,6 +178,8 @@ Dynamic_engraver::do_process_requests() new_sss_p = new Staff_side_spanner; new_sss_p->set_victim (new_cresc_p); new_sss_p->axis_ = Y_AXIS; + // UGH.! + // new_sss_p->set_elt_property (dangling_scm_sym, SCM_BOOL_T); announce_element (Score_element_info (new_sss_p, span_l)); } } diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc index 8dd95437d4..b5fbcf56fe 100644 --- a/lily/encompass-info.cc +++ b/lily/encompass-info.cc @@ -20,7 +20,6 @@ Encompass_info::Encompass_info () { - assert (0); } Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, Slur const* slur_l) @@ -37,37 +36,12 @@ Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, S o_[X_AXIS] = stem_l->hpos_f (); -#if 0 - /* - Let's not do this; yields ugly assymetric slurs. - - set o_[X_AXIS] to middle of notehead or on the exact position of stem, - according to slur direction - - - stem_l->dir == dir - ________ - | | / \ - x| x| |x |x - \________/ | | - - */ - - dx_f_drul_[d] = -d * spanned_drul_[d]->extent (X_AXIS).length (); - - if (stem_l->dir_ != dir) - o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length (); - -#else - /* - Instead; simply set x to middle of notehead + Simply set x to middle of notehead */ o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length (); -#endif - if (stem_l->dir_ == dir) { o_[Y_AXIS] = stem_l->extent (Y_AXIS)[dir]; diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc new file mode 100644 index 0000000000..8420c7fa3b --- /dev/null +++ b/lily/engraver-group-engraver.cc @@ -0,0 +1,85 @@ +/* + engravergroup.cc -- implement Engraver_group_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#include "proto.hh" +#include "engraver-group-engraver.hh" +#include "engraver.hh" +#include "debug.hh" +#include "paper-score.hh" +#include "score-element.hh" + + +ADD_THIS_TRANSLATOR(Engraver_group_engraver); + +void +Engraver_group_engraver::announce_element (Score_element_info info) +{ + announce_info_arr_.push (info); + Engraver::announce_element (info); +} + +void +Engraver_group_engraver::do_announces() +{ + Link_array groups = group_l_arr (); + for (int i=0; i < groups.size(); i++) + { + Engraver_group_engraver * group = dynamic_cast (groups[i]); + if (group) + { + group->do_announces(); + } + } + + Request dummy_req; + + Link_array nongroups = nongroup_l_arr (); + while (announce_info_arr_.size ()) + { + for (int j =0; j < announce_info_arr_.size(); j++) + { + Score_element_info info = announce_info_arr_[j]; + + if (!info.req_l_) + info.req_l_ = &dummy_req; + for (int i=0; i < nongroups.size(); i++) + { // Is this good enough? + Engraver * eng = dynamic_cast (nongroups[i]); + if (eng && eng!= info.origin_trans_l_arr_[0]) + eng->acknowledge_element (info); + } + } + announce_info_arr_.clear (); + for (int i=0; i < nongroups.size(); i++) + { + Engraver * eng = dynamic_cast (nongroups[i]); + if (eng) + eng->process_acknowledged (); + } + + } +} + + +Staff_info +Engraver_group_engraver::get_staff_info() const +{ + Staff_info inf = Engraver::get_staff_info(); + + Link_array simple_translators = nongroup_l_arr (); + for (int i=0; i < simple_translators.size(); i++) + { + Engraver * eng = dynamic_cast (simple_translators[i]); + if (eng) + eng->fill_staff_info (inf); + } + return inf; +} + + + diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc deleted file mode 100644 index 4636dcad3c..0000000000 --- a/lily/engraver-group.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* - engravergroup.cc -- implement Engraver_group_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "proto.hh" -#include "engraver-group-engraver.hh" -#include "engraver.hh" -#include "debug.hh" -#include "p-score.hh" -#include "score-element.hh" - - -ADD_THIS_TRANSLATOR(Engraver_group_engraver); - -void -Engraver_group_engraver::announce_element (Score_element_info info) -{ - announce_info_arr_.push (info); - Engraver::announce_element (info); -} - -void -Engraver_group_engraver::do_announces() -{ - Link_array groups = group_l_arr (); - for (int i=0; i < groups.size(); i++) - { - Engraver_group_engraver * group = dynamic_cast (groups[i]); - if (group) - { - group->do_announces(); - } - } - - Request dummy_req; - - Link_array nongroups = nongroup_l_arr (); - while (announce_info_arr_.size ()) - { - for (int j =0; j < announce_info_arr_.size(); j++) - { - Score_element_info info = announce_info_arr_[j]; - - if (!info.req_l_) - info.req_l_ = &dummy_req; - for (int i=0; i < nongroups.size(); i++) - { // Is this good enough? - Engraver * eng = dynamic_cast (nongroups[i]); - if (eng && eng!= info.origin_trans_l_arr_[0]) - eng->acknowledge_element (info); - } - } - announce_info_arr_.clear (); - for (int i=0; i < nongroups.size(); i++) - { - Engraver * eng = dynamic_cast (nongroups[i]); - if (eng) - eng->process_acknowledged (); - } - - } -} - - -Staff_info -Engraver_group_engraver::get_staff_info() const -{ - Staff_info inf = Engraver::get_staff_info(); - - Link_array simple_translators = nongroup_l_arr (); - for (int i=0; i < simple_translators.size(); i++) - { - Engraver * eng = dynamic_cast (simple_translators[i]); - if (eng) - eng->fill_staff_info (inf); - } - return inf; -} - - - diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 541080b60b..dc7f4c22aa 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -15,7 +15,7 @@ #include "debug.hh" #include "lookup.hh" #include "molecule.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" #include "extender-spanner.hh" diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 01f2860d4d..284f1e83b3 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -10,8 +10,8 @@ #include "colhpos.hh" #include "spring-spacer.hh" #include "debug.hh" -#include "p-col.hh" -#include "p-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" #include "paper-def.hh" #include "killing-cons.tcc" diff --git a/lily/grace-engraver-group.cc b/lily/grace-engraver-group.cc index 8a9db8b171..220b8c82f3 100644 --- a/lily/grace-engraver-group.cc +++ b/lily/grace-engraver-group.cc @@ -10,6 +10,7 @@ #include "lily-guile.hh" #include "ly-symbols.hh" #include "score-element.hh" +#include "musical-request.hh" void Grace_engraver_group::start () @@ -99,12 +100,23 @@ ADD_THIS_TRANSLATOR(Grace_engraver_group); bool Grace_engraver_group::do_try_music (Music *m) { - bool hebbes_b =false; + bool hebbes_b = try_music_on_nongroup_children (m); - Link_array nongroups (nongroup_l_arr ()); - - for (int i =0; !hebbes_b && i < nongroups.size() ; i++) - hebbes_b =nongroups[i]->try_music (m); + if (!hebbes_b && pass_to_top_b (m)) + { + hebbes_b = daddy_trans_l_->try_music (m); + } return hebbes_b; } + +bool +Grace_engraver_group::pass_to_top_b (Music *m) const +{ + if (Span_req * sp = dynamic_cast (m)) + { + if (sp->span_type_str_ == "slur") + return true; + } + return false; +} diff --git a/lily/grace-position-engraver.cc b/lily/grace-position-engraver.cc index 189c2e54d8..3d0295f017 100644 --- a/lily/grace-position-engraver.cc +++ b/lily/grace-position-engraver.cc @@ -44,7 +44,10 @@ Grace_position_engraver::acknowledge_element (Score_element_info i) } else if (Local_key_item*it = dynamic_cast(i.elem_l_)) { - support_.push (it); + if (it->get_elt_property (grace_scm_sym) == SCM_BOOL_F) + support_.push (it); + else if (align_l_) + it->add_dependency (align_l_); } } diff --git a/lily/heads-engraver.cc b/lily/heads-engraver.cc deleted file mode 100644 index fee3bd41b0..0000000000 --- a/lily/heads-engraver.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* - head-grav.cc -- part of GNU LilyPond - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "note-head.hh" -#include "heads-engraver.hh" -#include "paper-def.hh" -#include "musical-request.hh" -#include "dots.hh" -#include "dot-column.hh" - -Note_heads_engraver::Note_heads_engraver() -{ -} - -bool -Note_heads_engraver::do_try_music (Music *m) -{ - if (Note_req * n =dynamic_cast (m)) - { - note_req_l_arr_.push (n); - return true; - } - if (Tonic_req* t = dynamic_cast (m)) - { - return true; - } - return false; -} - -void -Note_heads_engraver::do_process_requests() -{ - if (note_p_arr_.size ()) - return ; - - String noteheadstyle = get_property ("noteHeadStyle", 0); - for (int i=0; i < note_req_l_arr_.size (); i++) - { - Note_head *note_p = new Note_head; - Note_req * note_req_l = note_req_l_arr_[i]; - note_p->balltype_i_ = note_req_l->duration_.durlog_i_; - note_p->dots_i_ = note_req_l->duration_.dots_i_; - if (note_p->dots_i_) - { - Dots * d = new Dots; - note_p->dots_l_ = d; - announce_element (Score_element_info (d,0)); - dot_p_arr_.push (d); - } - - // note_p->steps_i_ = note_req_l->pitch_.steps (); - note_p->position_i_ = note_req_l->pitch_.steps (); - - - if (noteheadstyle == "transparent") - note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T); - else - note_p->set_elt_property (style_scm_sym, - gh_str02scm (noteheadstyle.ch_C())); - - - Score_element_info itinf (note_p,note_req_l); - announce_element (itinf); - note_p_arr_.push (note_p); - } -} - -void -Note_heads_engraver::do_pre_move_processing() -{ - for (int i=0; i < note_p_arr_.size (); i++) - { - typeset_element (note_p_arr_[i]); - } - note_p_arr_.clear (); - for (int i=0; i < dot_p_arr_.size (); i++) - { - typeset_element (dot_p_arr_[i]); - } - dot_p_arr_.clear (); - - note_req_l_arr_.clear (); -} - -void -Note_heads_engraver::do_post_move_processing() -{ - -} - - - -ADD_THIS_TRANSLATOR(Note_heads_engraver); diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 8636dbb756..990c24884b 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -17,7 +17,7 @@ #include "debug.hh" #include "lookup.hh" #include "molecule.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" #include "hyphen-spanner.hh" diff --git a/lily/idealspacing.cc b/lily/idealspacing.cc index 3e3859a0c7..780c224bdf 100644 --- a/lily/idealspacing.cc +++ b/lily/idealspacing.cc @@ -7,8 +7,8 @@ */ #include "idealspacing.hh" -#include "p-col.hh" -#include "p-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" #include "debug.hh" void diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 47507b8c3c..d7553339ed 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -133,7 +133,7 @@ public: protected: VIRTUAL_COPY_CONS(Music); - // void transpose (Musical_pitch d); + void transpose (Musical_pitch d); virtual void do_print () const; }; diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 374181e014..3562441c8a 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -11,22 +11,25 @@ #define DOT_COLUMN_HH #include "axis-group-item.hh" +#include "note-head-side.hh" /** Group dots. This is needed because, the dots have to be aligned per voice */ -class Dot_column : public Axis_group_item +class Dot_column : public Axis_group_item, public Note_head_side { - Link_array head_l_arr_; Link_array dot_l_arr_; - + static int compare (Dots * const&,Dots * const&); public: - + VIRTUAL_COPY_CONS (Score_element); void add_head (Rhythmic_head*); void add_dots (Dots*); Dot_column (); + protected: + virtual void do_pre_processing (); + virtual void do_post_processing (); virtual void do_substitute_element_pointer (Score_element *o, Score_element*n); }; #endif // DOT_COLUMN_HH diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 919da6fb8d..29e1bd5b11 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -22,8 +22,9 @@ protected: virtual Molecule * do_brew_molecule_p () const; virtual void do_post_processing (); public: - int no_dots_i_; + int dots_i_; int position_i_; + Direction resolve_dir_; Dots (); }; diff --git a/lily/include/grace-engraver-group.hh b/lily/include/grace-engraver-group.hh index cb31244aeb..8d2f823a83 100644 --- a/lily/include/grace-engraver-group.hh +++ b/lily/include/grace-engraver-group.hh @@ -18,6 +18,7 @@ class Grace_engraver_group : public Engraver_group_engraver, public Global_trans Link_array typeset_us_; Array announce_to_top_; bool calling_self_b_; + bool pass_to_top_b (Music *) const; public: VIRTUAL_COPY_CONS(Translator); Grace_engraver_group (); diff --git a/lily/include/heads-engraver.hh b/lily/include/heads-engraver.hh deleted file mode 100644 index 433a05f43a..0000000000 --- a/lily/include/heads-engraver.hh +++ /dev/null @@ -1,32 +0,0 @@ -/* - head-engraver.hh -- part of GNU LilyPond - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef HEADSGRAV_HH -#define HEADSGRAV_HH -#include "engraver.hh" - -/** - make balls and rests - */ -class Note_heads_engraver : public Engraver { - Link_array note_p_arr_; - Link_array dot_p_arr_; - Link_array note_req_l_arr_; - -public: - VIRTUAL_COPY_CONS(Translator); - Note_heads_engraver(); - -protected: - virtual bool do_try_music (Music *req_l) ; - virtual void do_process_requests(); - virtual void do_pre_move_processing(); - virtual void do_post_move_processing(); -}; - - -#endif // HEADSGRAV_HH diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index a4cbf4e77b..e702c3334b 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -48,7 +48,6 @@ struct Bar_req; struct Barcheck_req; struct Beam; struct Beam_engraver; -struct Beam_req; struct Beaming_info; struct Beaming_info_list; struct Blank_req; @@ -75,12 +74,9 @@ struct Collision_engraver; struct Command_req; struct Command_script_req; struct Command_tie_engraver; -struct Command_tie_req; struct Time_scaled_music; struct Time_scaled_music_iterator; -struct Cresc_req; struct Crescendo ; -struct Decresc_req; struct Dots; struct Dot_column; struct Directional_spanner; @@ -186,9 +182,6 @@ struct Paper_stream; struct Partial_measure_req; struct Performance; struct Performer; -struct Plet; -struct Plet_engraver; -struct Plet_req; struct Tuplet_spanner; struct Piano_brace; struct Performer; @@ -223,11 +216,9 @@ struct Single_malt_grouping_item; struct Skip_req; struct Slur; struct Slur_engraver; -struct Slur_req; struct Spacing_spanner; struct Span_bar; struct Span_score_bar; -struct Span_dynamic_req; struct Span_req; struct Spanner; struct Spring; diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh index be99f08c74..25a2b8b38b 100644 --- a/lily/include/ly-symbols.hh +++ b/lily/include/ly-symbols.hh @@ -31,6 +31,7 @@ DECLARE_LY_SYMBOL(char); DECLARE_LY_SYMBOL(change); DECLARE_LY_SYMBOL(damping); DECLARE_LY_SYMBOL(dashed); +DECLARE_LY_SYMBOL(dangling); DECLARE_LY_SYMBOL(extremal); DECLARE_LY_SYMBOL(extra_space); DECLARE_LY_SYMBOL(dir_forced); diff --git a/lily/include/note-head-side.hh b/lily/include/note-head-side.hh index 7ecc0f2588..c5f7b0167c 100644 --- a/lily/include/note-head-side.hh +++ b/lily/include/note-head-side.hh @@ -21,6 +21,9 @@ class Note_head_side: public virtual Item { Link_array support_l_arr_; public: + Direction align_dir_; + + Note_head_side (); void add_support (Item*); VIRTUAL_COPY_CONS (Score_element); protected: diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index e931ede0ea..9b2650f486 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -17,7 +17,6 @@ class Note_head : public Rhythmic_head { public: - int position_i_; Note_head (); void flip_around_stem (Direction); diff --git a/lily/include/note-heads-engraver.hh b/lily/include/note-heads-engraver.hh new file mode 100644 index 0000000000..433a05f43a --- /dev/null +++ b/lily/include/note-heads-engraver.hh @@ -0,0 +1,32 @@ +/* + head-engraver.hh -- part of GNU LilyPond + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef HEADSGRAV_HH +#define HEADSGRAV_HH +#include "engraver.hh" + +/** + make balls and rests + */ +class Note_heads_engraver : public Engraver { + Link_array note_p_arr_; + Link_array dot_p_arr_; + Link_array note_req_l_arr_; + +public: + VIRTUAL_COPY_CONS(Translator); + Note_heads_engraver(); + +protected: + virtual bool do_try_music (Music *req_l) ; + virtual void do_process_requests(); + virtual void do_pre_move_processing(); + virtual void do_post_move_processing(); +}; + + +#endif // HEADSGRAV_HH diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh deleted file mode 100644 index bf2d032cf2..0000000000 --- a/lily/include/p-col.hh +++ /dev/null @@ -1,73 +0,0 @@ -/* - p-col.hh -- declare Paper_column - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef P_COL_HH -#define P_COL_HH - -#include "axis-group-item.hh" -#include "rod.hh" -#include "spring.hh" - -/** - stuff grouped vertically. - This is a class to address items vertically. It contains the data for: - \begin{itemize} - \item - unbroken score - \item - broken score - \item - the linespacing problem - \end{itemize} - */ - -class Paper_column : public Axis_group_item { -public: - VIRTUAL_COPY_CONS(Score_element); - Drul_array > minimal_dists_arr_drul_; - Drul_array > spring_arr_drul_; - void preprocess (); - /// set a minimum distance - void add_rod (Paper_column * to, Real distance); - void add_spring (Paper_column * to, Real dist, Real strength); - - virtual Paper_column * column_l () const; - /// if lines are broken then this column is in #line# - Line_of_score *line_l_; - - virtual Line_of_score *line_l () const; - - /// which one (left =0) - int rank_i() const; - - bool breakpoint_b() const; - void add_item (Item *i); - - Paper_column(); - - void set_rank (int); - - void OK() const; - virtual void do_print() const; -private: - - /** - The ranking: left is smaller than right - -1 is uninitialised. - */ - int rank_i_; - -}; - - -// #include "compare.hh" -// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare); - -#endif // P_COL_HH - diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh deleted file mode 100644 index 339b894088..0000000000 --- a/lily/include/p-score.hh +++ /dev/null @@ -1,84 +0,0 @@ -/* - p-score.hh -- declare Paper_score - - source file of the GNU LilyPond music typesetter - - (c) 1996, 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef P_SCORE_HH -#define P_SCORE_HH - -#include "colhpos.hh" -#include "parray.hh" -#include "lily-proto.hh" -#include "music-output.hh" -#include "lily-guile.hh" - -/** all stuff which goes onto paper. notes, signs, symbols in a score - #Paper_score# contains the items, the columns. - - */ - -class Paper_score : public Music_output -{ - /// crescs etc; no particular order - Link_array span_p_arr_; - - /// other elements - Link_array elem_p_arr_; - Link_array break_helpers_arr_; - - SCM protected_scms_; -public: - Paper_def *paper_l_; - - /// the columns, ordered left to right - Link_array col_l_arr_; - - Paper_outputter *outputter_l_; - Line_of_score * line_l_; - - Paper_score (); - - - /// add to bottom of pcols - void add_column (Paper_column*); - - /** - @return index of argument. - */ - int find_col_idx (Paper_column const *) const; - - Link_array broken_col_range (Item const*,Item const*) const; - - - /* STANDARD ROUTINES */ - void print() const; - - void typeset_element (Score_element*); - void typeset_broken_spanner (Spanner*); - /// add a Spanner - void typeset_unbroken_spanner (Spanner*); - - - virtual ~Paper_score(); -protected: - /* MAIN ROUTINES */ - virtual void process(); - -private: - /// before calc_breaking - void preprocess(); - - void calc_idealspacing(); - /// calculate where the lines are to be broken, and use results - Array calc_breaking(); - - /// after calc_breaking - void postprocess(); - Paper_score (Paper_score const &); -}; - -#endif diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh new file mode 100644 index 0000000000..9505542f6f --- /dev/null +++ b/lily/include/paper-column.hh @@ -0,0 +1,73 @@ +/* + paper-column.hh -- declare Paper_column + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef P_COL_HH +#define P_COL_HH + +#include "axis-group-item.hh" +#include "rod.hh" +#include "spring.hh" + +/** + stuff grouped vertically. + This is a class to address items vertically. It contains the data for: + \begin{itemize} + \item + unbroken score + \item + broken score + \item + the linespacing problem + \end{itemize} + */ + +class Paper_column : public Axis_group_item { +public: + VIRTUAL_COPY_CONS(Score_element); + Drul_array > minimal_dists_arr_drul_; + Drul_array > spring_arr_drul_; + void preprocess (); + /// set a minimum distance + void add_rod (Paper_column * to, Real distance); + void add_spring (Paper_column * to, Real dist, Real strength); + + virtual Paper_column * column_l () const; + /// if lines are broken then this column is in #line# + Line_of_score *line_l_; + + virtual Line_of_score *line_l () const; + + /// which one (left =0) + int rank_i() const; + + bool breakpoint_b() const; + void add_item (Item *i); + + Paper_column(); + + void set_rank (int); + + void OK() const; + virtual void do_print() const; +private: + + /** + The ranking: left is smaller than right + -1 is uninitialised. + */ + int rank_i_; + +}; + + +// #include "compare.hh" +// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare); + +#endif // P_COL_HH + diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh new file mode 100644 index 0000000000..e27fe72943 --- /dev/null +++ b/lily/include/paper-score.hh @@ -0,0 +1,84 @@ +/* + paper-score.hh -- declare Paper_score + + source file of the GNU LilyPond music typesetter + + (c) 1996, 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef P_SCORE_HH +#define P_SCORE_HH + +#include "colhpos.hh" +#include "parray.hh" +#include "lily-proto.hh" +#include "music-output.hh" +#include "lily-guile.hh" + +/** all stuff which goes onto paper. notes, signs, symbols in a score + #Paper_score# contains the items, the columns. + + */ + +class Paper_score : public Music_output +{ + /// crescs etc; no particular order + Link_array span_p_arr_; + + /// other elements + Link_array elem_p_arr_; + Link_array break_helpers_arr_; + + SCM protected_scms_; +public: + Paper_def *paper_l_; + + /// the columns, ordered left to right + Link_array col_l_arr_; + + Paper_outputter *outputter_l_; + Line_of_score * line_l_; + + Paper_score (); + + + /// add to bottom of pcols + void add_column (Paper_column*); + + /** + @return index of argument. + */ + int find_col_idx (Paper_column const *) const; + + Link_array broken_col_range (Item const*,Item const*) const; + + + /* STANDARD ROUTINES */ + void print() const; + + void typeset_element (Score_element*); + void typeset_broken_spanner (Spanner*); + /// add a Spanner + void typeset_unbroken_spanner (Spanner*); + + + virtual ~Paper_score(); +protected: + /* MAIN ROUTINES */ + virtual void process(); + +private: + /// before calc_breaking + void preprocess(); + + void calc_idealspacing(); + /// calculate where the lines are to be broken, and use results + Array calc_breaking(); + + /// after calc_breaking + void postprocess(); + Paper_score (Paper_score const &); +}; + +#endif diff --git a/lily/include/plet-engraver.hh b/lily/include/plet-engraver.hh deleted file mode 100644 index 67af5ccabd..0000000000 --- a/lily/include/plet-engraver.hh +++ /dev/null @@ -1,41 +0,0 @@ -/* - plet-engraver.hh -- declare Plet_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Jan Nieuwenhuizen -*/ - -#ifndef PLET_ENGRAVER_HH -#define PLET_ENGRAVER_HH - -#include "engraver.hh" -#include "drul-array.hh" -#include "plet-spanner.hh" - -/** - Generate a plet. - Should make a Plet_spanner that typesets a nice bracket. - */ -class Plet_engraver : public Engraver -{ -public: - VIRTUAL_COPY_CONS(Translator); - - Plet_engraver (); - -protected: - virtual void acknowledge_element (Score_element_info); - virtual void do_removal_processing(); - virtual void do_process_requests(); - virtual bool do_try_music (Music*); - virtual void do_pre_move_processing(); - -private: - Drul_array span_reqs_drul_; - Drul_array beam_mom_drul_; - Drul_array span_mom_drul_; - Plet_spanner* plet_spanner_p_; -}; - -#endif // PLET_ENGRAVER_HH diff --git a/lily/include/request-chord-iterator.hh b/lily/include/request-chord-iterator.hh new file mode 100644 index 0000000000..0b35c447d6 --- /dev/null +++ b/lily/include/request-chord-iterator.hh @@ -0,0 +1,41 @@ +/* + request-iter.hh -- declare Request_chord_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef REQUEST_ITER_HH +#define REQUEST_ITER_HH + +#include "music-iterator.hh" + +/** + Walk through a Request_chord + */ +class Request_chord_iterator : public Music_iterator { + Request_chord * elt_l () const; + /** + cache elt_l ()->length_mom (). + */ + Moment elt_length_mom_; + bool last_b_; + Cons* cursor_; + +public: + Request_chord_iterator (); + + +protected: + virtual void do_process_and_next (Moment); + virtual Moment next_moment() const; + virtual Music* next_music_l (); + virtual void construct_children(); + virtual bool ok() const; + virtual void do_print() const; +}; + + +#endif // REQUEST_ITER_HH diff --git a/lily/include/request-iterator.hh b/lily/include/request-iterator.hh deleted file mode 100644 index 0b35c447d6..0000000000 --- a/lily/include/request-iterator.hh +++ /dev/null @@ -1,41 +0,0 @@ -/* - request-iter.hh -- declare Request_chord_iterator - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef REQUEST_ITER_HH -#define REQUEST_ITER_HH - -#include "music-iterator.hh" - -/** - Walk through a Request_chord - */ -class Request_chord_iterator : public Music_iterator { - Request_chord * elt_l () const; - /** - cache elt_l ()->length_mom (). - */ - Moment elt_length_mom_; - bool last_b_; - Cons* cursor_; - -public: - Request_chord_iterator (); - - -protected: - virtual void do_process_and_next (Moment); - virtual Moment next_moment() const; - virtual Music* next_music_l (); - virtual void construct_children(); - virtual bool ok() const; - virtual void do_print() const; -}; - - -#endif // REQUEST_ITER_HH diff --git a/lily/include/rest.hh b/lily/include/rest.hh index c88e778973..611ddd7103 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -15,13 +15,11 @@ class Rest : public Rhythmic_head { public: - - - int position_i_; Rest (); void add_dots (Dots*); protected: virtual void do_add_processing (); + virtual void do_post_processing (); virtual Molecule * do_brew_molecule_p () const; }; #endif // REST_HH diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 21988a85d7..98ebcc5bfd 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -19,11 +19,14 @@ public: Stem * stem_l_; int balltype_i_; int dots_i_; + int position_i_; + Dots * dots_l_; void add_dots (Dots *); Rhythmic_head (); protected: + virtual void do_post_processing (); virtual void do_add_processing (); virtual void do_print () const; virtual void do_substitute_element_pointer (Score_element*,Score_element*); diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 56dcf59d92..9c2097367e 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -13,7 +13,7 @@ #include "lily-proto.hh" #include "array.hh" #include "moment.hh" -#include "p-col.hh" +#include "paper-column.hh" /** Column with durational info. diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 2a0a7805ef..723cf5a283 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -135,6 +135,7 @@ protected: virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); virtual void handle_prebroken_dependents (); + virtual void handle_broken_dependents (); virtual Link_array get_extra_dependencies () const; static Interval dim_cache_callback (Dimension_cache*); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 9e4ee574a3..287492989f 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -72,6 +72,7 @@ protected: friend Axis_group_spanner; // UGH virtual void do_space_processing (); + void handle_broken_dependents (); virtual void do_break_processing (); virtual Interval do_width () const; virtual void do_print () const; diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index b907c452b5..4868940bb8 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -66,6 +66,7 @@ public: void check_removal (); + Translator *get_simple_translator (String) const; Translator_group *find_existing_translator_l (String n, String id); Translator_group *find_create_translator_l (String n, String id); @@ -73,6 +74,8 @@ public: Translator_group*get_default_interpreter(); protected: + bool try_music_on_nongroup_children (Music *m); + virtual ~Translator_group (); virtual void do_print () const; virtual void do_process_requests (); diff --git a/lily/item.cc b/lily/item.cc index 40da38cb8c..cf3891cb0b 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -6,10 +6,10 @@ (c) 1997--1999 Han-Wen Nienhuys */ -#include "p-score.hh" +#include "paper-score.hh" #include "debug.hh" #include "item.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "spanner.hh" #include "lily-guile.hh" diff --git a/lily/key-def.cc b/lily/key-def.cc index 7c492b23f3..67bbc4f7b6 100644 --- a/lily/key-def.cc +++ b/lily/key-def.cc @@ -1,5 +1,5 @@ /* - key-def.cc -- implement + key-def.cc -- implement Key_def source file of the GNU LilyPond music typesetter diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc index e269689cc8..43aaeb6021 100644 --- a/lily/line-group-group-engraver.cc +++ b/lily/line-group-group-engraver.cc @@ -12,7 +12,7 @@ #include "bar.hh" #include "debug.hh" #include "line-group-group-engraver.hh" -#include "p-col.hh" +#include "paper-column.hh" Line_group_engraver_group::Line_group_engraver_group() { diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index ec786d7815..be7a5e8dac 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -9,8 +9,8 @@ #include "line-of-score.hh" #include "paper-def.hh" #include "paper-outputter.hh" -#include "p-col.hh" -#include "p-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" #include "warn.hh" Line_of_score::Line_of_score() diff --git a/lily/main.cc b/lily/main.cc index b5f0c3170e..04e883c4de 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -405,7 +405,7 @@ distill_inname_str (String name_str, String& ext_r) split_path (str,a,b,c,ext_r); // add extension if not present. - char const* extensions[] = {"", "", ".ly", ".fly", ".sly", 0}; + char const* extensions[] = {"", ".ly", ".fly", ".sly", "", 0}; extensions[0] = ext_r.ch_C (); for (int i = 0; extensions[i]; i++) { @@ -416,6 +416,9 @@ distill_inname_str (String name_str, String& ext_r) } } str = a+b+c+ext_r; + // in any case, assume (init).ly + if (!ext_r.length_i ()) + ext_r = ".ly"; } } else diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index fede70beb4..7a952f0135 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -10,7 +10,7 @@ #include "multi-measure-rest.hh" #include "debug.hh" #include "paper-def.hh" -#include "p-col.hh" // urg +#include "paper-column.hh" // urg #include "bar.hh" #include "lookup.hh" #include "rest.hh" diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index b3e99c8f63..0dcba0a2b4 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -9,7 +9,7 @@ #include "music-list.hh" #include "music-iterator.hh" #include "property-iterator.hh" -#include "request-iterator.hh" +#include "request-chord-iterator.hh" #include "sequential-music-iterator.hh" #include "simultaneous-music-iterator.hh" #include "translator-group.hh" diff --git a/lily/note-head-side.cc b/lily/note-head-side.cc index 5d073f0a10..0d360c4d02 100644 --- a/lily/note-head-side.cc +++ b/lily/note-head-side.cc @@ -36,7 +36,7 @@ Note_head_side::do_pre_processing () if (x_int.empty_b ()) x_int = Interval(0,0); - translate_axis (-extent(X_AXIS)[RIGHT] + x_int[LEFT], X_AXIS); + translate_axis (-extent(X_AXIS)[-align_dir_] + x_int[align_dir_], X_AXIS); } void @@ -45,3 +45,8 @@ Note_head_side::do_substitute_element_pointer (Score_element*o,Score_element*n) if (Item* o_l = dynamic_cast (o)) support_l_arr_.substitute (o_l,dynamic_cast (n)); } + +Note_head_side:: Note_head_side() +{ + align_dir_ = LEFT; +} diff --git a/lily/note-head.cc b/lily/note-head.cc index 9561ba341f..8e6ec890dc 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -13,6 +13,7 @@ #include "lookup.hh" #include "molecule.hh" #include "musical-request.hh" +#include "stem.hh" void Note_head::flip_around_stem (Direction d) @@ -22,7 +23,6 @@ Note_head::flip_around_stem (Direction d) Note_head::Note_head () { - position_i_ = 0; } void @@ -35,6 +35,8 @@ Note_head::do_pre_processing () dots_l_->position_i_ = position_i_; } + + int Note_head::compare (Note_head *const &a, Note_head * const &b) { diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc new file mode 100644 index 0000000000..099c8bf731 --- /dev/null +++ b/lily/note-heads-engraver.cc @@ -0,0 +1,96 @@ +/* + head-grav.cc -- part of GNU LilyPond + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#include "note-head.hh" +#include "note-heads-engraver.hh" +#include "paper-def.hh" +#include "musical-request.hh" +#include "dots.hh" +#include "dot-column.hh" + +Note_heads_engraver::Note_heads_engraver() +{ +} + +bool +Note_heads_engraver::do_try_music (Music *m) +{ + if (Note_req * n =dynamic_cast (m)) + { + note_req_l_arr_.push (n); + return true; + } + if (Tonic_req* t = dynamic_cast (m)) + { + return true; + } + return false; +} + +void +Note_heads_engraver::do_process_requests() +{ + if (note_p_arr_.size ()) + return ; + + String noteheadstyle = get_property ("noteHeadStyle", 0); + for (int i=0; i < note_req_l_arr_.size (); i++) + { + Note_head *note_p = new Note_head; + Note_req * note_req_l = note_req_l_arr_[i]; + note_p->balltype_i_ = note_req_l->duration_.durlog_i_; + note_p->dots_i_ = note_req_l->duration_.dots_i_; + if (note_p->dots_i_) + { + Dots * d = new Dots; + note_p->dots_l_ = d; + announce_element (Score_element_info (d,0)); + dot_p_arr_.push (d); + } + + // note_p->steps_i_ = note_req_l->pitch_.steps (); + note_p->position_i_ = note_req_l->pitch_.steps (); + + + if (noteheadstyle == "transparent") + note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T); + else + note_p->set_elt_property (style_scm_sym, + gh_str02scm (noteheadstyle.ch_C())); + + + Score_element_info itinf (note_p,note_req_l); + announce_element (itinf); + note_p_arr_.push (note_p); + } +} + +void +Note_heads_engraver::do_pre_move_processing() +{ + for (int i=0; i < note_p_arr_.size (); i++) + { + typeset_element (note_p_arr_[i]); + } + note_p_arr_.clear (); + for (int i=0; i < dot_p_arr_.size (); i++) + { + typeset_element (dot_p_arr_[i]); + } + dot_p_arr_.clear (); + + note_req_l_arr_.clear (); +} + +void +Note_heads_engraver::do_post_move_processing() +{ + +} + + + +ADD_THIS_TRANSLATOR(Note_heads_engraver); diff --git a/lily/p-col.cc b/lily/p-col.cc index fee4a083b7..4138548797 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -1,13 +1,13 @@ /* - p-col.cc -- implement Paper_column + paper-column.cc -- implement Paper_column source file of the GNU LilyPond music typesetter (c) 1997--1999 Han-Wen Nienhuys */ -#include "p-col.hh" -#include "p-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" #include "debug.hh" void diff --git a/lily/p-score.cc b/lily/p-score.cc deleted file mode 100644 index 261d3795f2..0000000000 --- a/lily/p-score.cc +++ /dev/null @@ -1,244 +0,0 @@ -/* - p-score.cc -- implement Paper_score - - source file of the GNU LilyPond music typesetter - - (c) 1996, 1997--1999 Han-Wen Nienhuys -*/ - -#include "main.hh" -#include "debug.hh" -#include "lookup.hh" -#include "spanner.hh" -#include "paper-def.hh" -#include "line-of-score.hh" -#include "p-col.hh" -#include "p-score.hh" -#include "p-col.hh" -#include "scope.hh" -#include "word-wrap.hh" -#include "gourlay-breaking.hh" -#include "paper-stream.hh" -#include "paper-outputter.hh" -#include "file-results.hh" -#include "misc.hh" - -Paper_score::Paper_score () -{ - protected_scms_ = scm_protect_object (gh_cons (SCM_BOOL_T, SCM_EOL)); - paper_l_ =0; - outputter_l_ =0; - Line_of_score * line_p = new Line_of_score; - typeset_unbroken_spanner (line_p); - - line_l_ = line_p; -} - -Paper_score::Paper_score (Paper_score const &s) - : Music_output (s) -{ - assert (false); -} - -Paper_score::~Paper_score () -{ - for (int i=span_p_arr_.size (); --i >=0 ; ) - delete span_p_arr_[i]; - for (int i=elem_p_arr_.size (); --i >=0 ; ) - delete elem_p_arr_[i]; - - scm_unprotect_object (protected_scms_); -} - -void -Paper_score::typeset_element (Score_element * elem_p) -{ - elem_p_arr_.push (elem_p); - elem_p->pscore_l_ = this; - - // take over protection. - SCM_CDR(protected_scms_) = gh_cons (elem_p->element_property_alist_, - SCM_CDR (protected_scms_)); - scm_unprotect_object (elem_p->element_property_alist_); - - SCM p = elem_p->remove_elt_property (break_helper_only_scm_sym); - if (p != SCM_BOOL_F) - break_helpers_arr_.push (elem_p); -} - - -void -Paper_score::typeset_unbroken_spanner (Spanner*span_p) -{ - span_p_arr_.push (span_p); - span_p->pscore_l_=this; - - SCM p = span_p->remove_elt_property (break_helper_only_scm_sym); - if (p != SCM_BOOL_F) - break_helpers_arr_.push (span_p); -} - -void -Paper_score::add_column (Paper_column *p) -{ - p->set_rank (col_l_arr_.size ()); - col_l_arr_.push (p); - typeset_element(p); -} - - - -void -Paper_score::print () const -{ -#ifndef NPRINT - if (!check_debug) - return ; - DOUT << "Paper_score { "; - DOUT << "\n elements: "; - for (int i=0; i < span_p_arr_.size (); i++) - span_p_arr_[i]->print (); - for (int i=0; i < elem_p_arr_.size (); i++) - elem_p_arr_[i]->print(); - - DOUT << "}\n"; -#endif -} - -int -Paper_score::find_col_idx (Paper_column const *c) const -{ - Paper_column const *what = c; - - return col_l_arr_.find_i ((Paper_column*)what); -} - -Array -Paper_score::calc_breaking () -{ - Break_algorithm *algorithm_p=0; - Array sol; - bool try_wrap = !paper_l_->get_var ("castingalgorithm"); - - if (!try_wrap) - { - algorithm_p = new Gourlay_breaking ; - algorithm_p->set_pscore (this); - sol = algorithm_p->solve (); - delete algorithm_p; - if (! sol.size ()) - { - warning (_ ("Can't solve this casting problem exactly; revert to Word_wrap")); - try_wrap = true; - } - } - if (try_wrap) - { - algorithm_p = new Word_wrap; - algorithm_p->set_pscore (this); - sol = algorithm_p->solve (); - delete algorithm_p; - } - return sol; -} - - - -void -Paper_score::process () -{ - Dictionary type_stats; - type_stats["Item"] =0; - type_stats["Spanner"] =0; - type_stats["Total"]=0; - - print (); - *mlog << _ ("Preprocessing elements...") << " " << flush; - line_l_->breakable_col_processing (); - line_l_->pre_processing (); - - *mlog << '\n' << _ ("Calculating column positions...") << " " << flush; - line_l_->space_processing (); - - Array breaking = calc_breaking (); - - - Paper_stream* paper_stream_p = paper_l_->paper_stream_p (); - outputter_l_ = paper_l_->paper_outputter_p (paper_stream_p, header_l_, origin_str_); - - Link_array lines; - for (int i=0; i < breaking.size (); i++) - { - Line_of_score *line_l = line_l_->set_breaking (breaking, i); - lines.push (line_l); - if (line_l != line_l_) - typeset_element (line_l); - } - - if (experimental_features_global_b) - *mlog << elem_p_arr_.size () + span_p_arr_.size () << _ (" elements. "); - - *mlog << "\n"; - *mlog << _ ("Line ... "); - line_l_->break_processing (); - for (int i=0; i < lines.size (); i++) - { - *mlog << '[' << flush; - - Line_of_score *line_l = lines[i]; - - line_l->post_processing (); - *mlog << i << flush; - line_l->output_all (i + 1 == lines.size()); - if (experimental_features_global_b) - *mlog << '(' << elem_p_arr_.size () + span_p_arr_.size () << ')'; - - *mlog << ']' << flush; - } - - // huh? - delete outputter_l_; - delete paper_stream_p; - outputter_l_ = 0; - - - /* - todo: sort output - */ - if (experimental_features_global_b) - { - for (Dictionary_iter i(type_stats); i.ok(); i++) - { - *mlog << i.key () << ": " << i.val () << " objects\n"; - } - } - *mlog << '\n' << flush; - -} - -Link_array -Paper_score::broken_col_range (Item const*l, Item const*r) const -{ - Link_array ret; - - l = l->column_l (); - r = r->column_l (); - - int start = l - ? find_col_idx (dynamic_cast ((Item*)l))+1 - : 0; - - int stop = r - ? find_col_idx (dynamic_cast((Item*)r)) - : col_l_arr_.size (); - - while (start < stop) - { - Paper_column *c = col_l_arr_[start]; - if (c->breakable_b () && !c->line_l_) - ret.push (c); - start++; - } - - return ret; -} diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 4cd2101032..f6ed231d34 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -13,7 +13,7 @@ #include "debug.hh" #include "lookup.hh" #include "score-engraver.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "identifier.hh" #include "main.hh" #include "scope.hh" diff --git a/lily/paper-score.cc b/lily/paper-score.cc new file mode 100644 index 0000000000..38ecdc320a --- /dev/null +++ b/lily/paper-score.cc @@ -0,0 +1,244 @@ +/* + p-score.cc -- implement Paper_score + + source file of the GNU LilyPond music typesetter + + (c) 1996, 1997--1999 Han-Wen Nienhuys +*/ + +#include "main.hh" +#include "debug.hh" +#include "lookup.hh" +#include "spanner.hh" +#include "paper-def.hh" +#include "line-of-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" +#include "paper-column.hh" +#include "scope.hh" +#include "word-wrap.hh" +#include "gourlay-breaking.hh" +#include "paper-stream.hh" +#include "paper-outputter.hh" +#include "file-results.hh" +#include "misc.hh" + +Paper_score::Paper_score () +{ + protected_scms_ = scm_protect_object (gh_cons (SCM_BOOL_T, SCM_EOL)); + paper_l_ =0; + outputter_l_ =0; + Line_of_score * line_p = new Line_of_score; + typeset_unbroken_spanner (line_p); + + line_l_ = line_p; +} + +Paper_score::Paper_score (Paper_score const &s) + : Music_output (s) +{ + assert (false); +} + +Paper_score::~Paper_score () +{ + for (int i=span_p_arr_.size (); --i >=0 ; ) + delete span_p_arr_[i]; + for (int i=elem_p_arr_.size (); --i >=0 ; ) + delete elem_p_arr_[i]; + + scm_unprotect_object (protected_scms_); +} + +void +Paper_score::typeset_element (Score_element * elem_p) +{ + elem_p_arr_.push (elem_p); + elem_p->pscore_l_ = this; + + // take over protection. + SCM_CDR(protected_scms_) = gh_cons (elem_p->element_property_alist_, + SCM_CDR (protected_scms_)); + scm_unprotect_object (elem_p->element_property_alist_); + + SCM p = elem_p->remove_elt_property (break_helper_only_scm_sym); + if (p != SCM_BOOL_F) + break_helpers_arr_.push (elem_p); +} + + +void +Paper_score::typeset_unbroken_spanner (Spanner*span_p) +{ + span_p_arr_.push (span_p); + span_p->pscore_l_=this; + + SCM p = span_p->remove_elt_property (break_helper_only_scm_sym); + if (p != SCM_BOOL_F) + break_helpers_arr_.push (span_p); +} + +void +Paper_score::add_column (Paper_column *p) +{ + p->set_rank (col_l_arr_.size ()); + col_l_arr_.push (p); + typeset_element(p); +} + + + +void +Paper_score::print () const +{ +#ifndef NPRINT + if (!check_debug) + return ; + DOUT << "Paper_score { "; + DOUT << "\n elements: "; + for (int i=0; i < span_p_arr_.size (); i++) + span_p_arr_[i]->print (); + for (int i=0; i < elem_p_arr_.size (); i++) + elem_p_arr_[i]->print(); + + DOUT << "}\n"; +#endif +} + +int +Paper_score::find_col_idx (Paper_column const *c) const +{ + Paper_column const *what = c; + + return col_l_arr_.find_i ((Paper_column*)what); +} + +Array +Paper_score::calc_breaking () +{ + Break_algorithm *algorithm_p=0; + Array sol; + bool try_wrap = !paper_l_->get_var ("castingalgorithm"); + + if (!try_wrap) + { + algorithm_p = new Gourlay_breaking ; + algorithm_p->set_pscore (this); + sol = algorithm_p->solve (); + delete algorithm_p; + if (! sol.size ()) + { + warning (_ ("Can't solve this casting problem exactly; revert to Word_wrap")); + try_wrap = true; + } + } + if (try_wrap) + { + algorithm_p = new Word_wrap; + algorithm_p->set_pscore (this); + sol = algorithm_p->solve (); + delete algorithm_p; + } + return sol; +} + + + +void +Paper_score::process () +{ + Dictionary type_stats; + type_stats["Item"] =0; + type_stats["Spanner"] =0; + type_stats["Total"]=0; + + print (); + *mlog << _ ("Preprocessing elements...") << " " << flush; + line_l_->breakable_col_processing (); + line_l_->pre_processing (); + + *mlog << '\n' << _ ("Calculating column positions...") << " " << flush; + line_l_->space_processing (); + + Array breaking = calc_breaking (); + + + Paper_stream* paper_stream_p = paper_l_->paper_stream_p (); + outputter_l_ = paper_l_->paper_outputter_p (paper_stream_p, header_l_, origin_str_); + + Link_array lines; + for (int i=0; i < breaking.size (); i++) + { + Line_of_score *line_l = line_l_->set_breaking (breaking, i); + lines.push (line_l); + if (line_l != line_l_) + typeset_element (line_l); + } + + if (experimental_features_global_b) + *mlog << elem_p_arr_.size () + span_p_arr_.size () << _ (" elements. "); + + *mlog << "\n"; + *mlog << _ ("Line ... "); + line_l_->break_processing (); + for (int i=0; i < lines.size (); i++) + { + *mlog << '[' << flush; + + Line_of_score *line_l = lines[i]; + + line_l->post_processing (); + *mlog << i << flush; + line_l->output_all (i + 1 == lines.size()); + if (experimental_features_global_b) + *mlog << '(' << elem_p_arr_.size () + span_p_arr_.size () << ')'; + + *mlog << ']' << flush; + } + + // huh? + delete outputter_l_; + delete paper_stream_p; + outputter_l_ = 0; + + + /* + todo: sort output + */ + if (experimental_features_global_b) + { + for (Dictionary_iter i(type_stats); i.ok(); i++) + { + *mlog << i.key () << ": " << i.val () << " objects\n"; + } + } + *mlog << '\n' << flush; + +} + +Link_array +Paper_score::broken_col_range (Item const*l, Item const*r) const +{ + Link_array ret; + + l = l->column_l (); + r = r->column_l (); + + int start = l + ? find_col_idx (dynamic_cast ((Item*)l))+1 + : 0; + + int stop = r + ? find_col_idx (dynamic_cast((Item*)r)) + : col_l_arr_.size (); + + while (start < stop) + { + Paper_column *c = col_l_arr_[start]; + if (c->breakable_b () && !c->line_l_) + ret.push (c); + start++; + } + + return ret; +} diff --git a/lily/request-chord-iterator.cc b/lily/request-chord-iterator.cc new file mode 100644 index 0000000000..47d28ce770 --- /dev/null +++ b/lily/request-chord-iterator.cc @@ -0,0 +1,102 @@ +/* + request-chord-iterator.cc -- implement Request_chord_iterator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#include "translator-group.hh" +#include "debug.hh" +#include "request-chord-iterator.hh" +#include "music-list.hh" +#include "request.hh" + + + +void +Request_chord_iterator::construct_children() +{ + elt_length_mom_ =elt_l ()->length_mom (); + get_req_translator_l(); +} + +Request_chord* +Request_chord_iterator::elt_l () const +{ + return (Request_chord*) music_l_; +} + +Request_chord_iterator::Request_chord_iterator () +{ + last_b_ = false; + // cursor_ = elt_l ()->music_p_list_p_->head_; + cursor_ = 0; +} + + +bool +Request_chord_iterator::ok() const +{ + return (elt_length_mom_ && !last_b_) || first_b_; +} + +Moment +Request_chord_iterator::next_moment() const +{ + Moment m (0); + if (!first_b_) + m = elt_length_mom_; + return m; +} + +Music* +Request_chord_iterator::next_music_l () +{ + if (first_b_) + { + cursor_ = elt_l ()->music_p_list_p_->head_; + first_b_ = false; + } + else + { + if (cursor_) + cursor_ = cursor_->next_; + } + if (cursor_) + return cursor_->car_; + else + return 0; +} + +void +Request_chord_iterator::do_print() const +{ +#ifndef NPRINT + DOUT << "duration: " << elt_length_mom_; +#endif +} + +void +Request_chord_iterator::do_process_and_next (Moment mom) +{ + if (first_b_) + { + for (Cons *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_) + { + if (Request * req_l = dynamic_cast (i->car_)) + { + bool gotcha = report_to_l()->try_music (req_l); + if (!gotcha) + req_l->warning (_f ("junking request: `%s\'", classname( req_l))); + } + else + i->car_->warning (_f ("Huh? Not a Request: `%s\'", + classname (i->car_))); + } + first_b_ = false; + } + + if (mom >= elt_length_mom_) + last_b_ = true; +} diff --git a/lily/request-iterator.cc b/lily/request-iterator.cc deleted file mode 100644 index 9cbf798a4b..0000000000 --- a/lily/request-iterator.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* - request-iterator.cc -- implement Request_chord_iterator - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "translator-group.hh" -#include "debug.hh" -#include "request-iterator.hh" -#include "music-list.hh" -#include "request.hh" - - - -void -Request_chord_iterator::construct_children() -{ - elt_length_mom_ =elt_l ()->length_mom (); - get_req_translator_l(); -} - -Request_chord* -Request_chord_iterator::elt_l () const -{ - return (Request_chord*) music_l_; -} - -Request_chord_iterator::Request_chord_iterator () -{ - last_b_ = false; - // cursor_ = elt_l ()->music_p_list_p_->head_; - cursor_ = 0; -} - - -bool -Request_chord_iterator::ok() const -{ - return (elt_length_mom_ && !last_b_) || first_b_; -} - -Moment -Request_chord_iterator::next_moment() const -{ - Moment m (0); - if (!first_b_) - m = elt_length_mom_; - return m; -} - -Music* -Request_chord_iterator::next_music_l () -{ - if (first_b_) - { - cursor_ = elt_l ()->music_p_list_p_->head_; - first_b_ = false; - } - else - { - if (cursor_) - cursor_ = cursor_->next_; - } - if (cursor_) - return cursor_->car_; - else - return 0; -} - -void -Request_chord_iterator::do_print() const -{ -#ifndef NPRINT - DOUT << "duration: " << elt_length_mom_; -#endif -} - -void -Request_chord_iterator::do_process_and_next (Moment mom) -{ - if (first_b_) - { - for (Cons *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_) - { - if (Request * req_l = dynamic_cast (i->car_)) - { - bool gotcha = report_to_l()->try_music (req_l); - if (!gotcha) - req_l->warning (_f ("junking request: `%s\'", classname( req_l))); - } - else - i->car_->warning (_f ("Huh? Not a Request: `%s\'", - classname (i->car_))); - } - first_b_ = false; - } - - if (mom >= elt_length_mom_) - last_b_ = true; -} diff --git a/lily/rest.cc b/lily/rest.cc index 2c9c91eff5..b0a0cce179 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -12,7 +12,7 @@ #include "rest.hh" #include "dots.hh" #include "axis-group-element.hh" -#include "p-score.hh" +#include "paper-score.hh" void Rest::do_add_processing () @@ -21,9 +21,15 @@ Rest::do_add_processing () position_i_ += 2; Rhythmic_head::do_add_processing (); +} + +void +Rest::do_post_processing () +{ + Rhythmic_head::do_post_processing (); if (dots_l_ && balltype_i_ > 4) { - dots_l_->position_i_ = position_i_ + 3; + dots_l_->position_i_ += 3; if (balltype_i_ == 7) dots_l_->position_i_++; } diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index e188abe59e..d329ca93e5 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -14,7 +14,7 @@ #include "rest.hh" #include "dots.hh" #include "axis-group-element.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "stem.hh" void @@ -26,10 +26,22 @@ Rhythmic_head::do_add_processing () } if (dots_l_) { - dots_l_->no_dots_i_ = dots_i_; + dots_l_->dots_i_ = dots_i_; } } +void +Rhythmic_head::do_post_processing () +{ + if (dots_l_) + { + if (stem_l_) + dots_l_->resolve_dir_ = stem_l_->dir_; + dots_l_->position_i_ = position_i_; + } +} + + void Rhythmic_head::add_dots (Dots *dot_l) { @@ -37,13 +49,13 @@ Rhythmic_head::add_dots (Dots *dot_l) dot_l->add_dependency (this); } - Rhythmic_head::Rhythmic_head () { dots_l_ =0; balltype_i_ =0; dots_i_ = 0; stem_l_ =0; + position_i_ =0; } void diff --git a/lily/rod.cc b/lily/rod.cc index 0bb8614232..129d9bb3c6 100644 --- a/lily/rod.cc +++ b/lily/rod.cc @@ -7,7 +7,7 @@ */ #include "rod.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "debug.hh" #include "dimensions.hh" #include "single-malt-grouping-item.hh" diff --git a/lily/score-column.cc b/lily/score-column.cc index 9744e3106a..0470fb71f7 100644 --- a/lily/score-column.cc +++ b/lily/score-column.cc @@ -7,7 +7,7 @@ */ #include "debug.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "score-column.hh" #include "command-request.hh" diff --git a/lily/score-element.cc b/lily/score-element.cc index 3215b80930..302b6dd352 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -9,7 +9,7 @@ #include -#include "p-score.hh" +#include "paper-score.hh" #include "paper-def.hh" #include "lookup.hh" #include "molecule.hh" @@ -18,7 +18,7 @@ #include "spanner.hh" #include "line-of-score.hh" #include "item.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "molecule.hh" #include "misc.hh" #include "paper-outputter.hh" @@ -410,6 +410,11 @@ Score_element::handle_prebroken_dependents() { } +void +Score_element::handle_broken_dependents() +{ +} + Link_array diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 70d2943c74..815e736675 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -11,14 +11,12 @@ #include "debug.hh" #include "item.hh" #include "score-engraver.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "musical-request.hh" #include "score-column.hh" #include "command-request.hh" #include "paper-def.hh" - - Score_engraver::Score_engraver() { break_penalty_i_ = 0; @@ -125,6 +123,17 @@ Score_engraver::typeset_all() { Score_element * elem_p = elem_p_arr_[i]; elem_p->add_processing (); + +#if 0 // TODO! + /* + elem_p wants to be connected to the rest of the + dependency graph. + */ + + if (elem_p->get_elt_property (dangling_scm_sym) != SCM_BOOL_F) + scoreline_l_->add_dependency (elem_p); +#endif + if (Spanner *s = dynamic_cast (elem_p)) { /* diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 2db95f52f4..8890ddbdd7 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -9,7 +9,7 @@ #include "separating-group-spanner.hh" #include "single-malt-grouping-item.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" #include "dimensions.hh" diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index f60ccd5730..99fc66a907 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -10,7 +10,7 @@ #include "separating-line-group-engraver.hh" #include "separating-group-spanner.hh" #include "single-malt-grouping-item.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" Separating_line_group_engraver::Separating_line_group_engraver () diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index eb572cd817..6714625393 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -10,9 +10,8 @@ #include "debug.hh" #include "sequential-music-iterator.hh" #include "music-list.hh" -// hmm -//#include "request-chord-iterator.hh" -#include "request-iterator.hh" +#include "request-chord-iterator.hh" + void Sequential_music_iterator::do_print() const diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index 77848e79fa..8ce4cdbd17 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -8,7 +8,7 @@ */ #include "single-malt-grouping-item.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "debug.hh" Single_malt_grouping_item ::Single_malt_grouping_item() diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 23fc2ebbe3..d2464fc5a7 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -45,10 +45,11 @@ Slur_engraver::do_removal_processing () typeset_element (slur_l_stack_[i]); } slur_l_stack_.clear (); - for (int i=0; i < requests_arr_.size(); i++) - { - requests_arr_[i]->warning (_ ("unterminated slur")); - } + if (!get_property ("weAreGraceContext",0).to_bool ()) + for (int i=0; i < requests_arr_.size(); i++) + { + requests_arr_[i]->warning (_ ("unterminated slur")); + } } void diff --git a/lily/slur.cc b/lily/slur.cc index 82aaa7e544..5e8055a9f4 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -19,7 +19,7 @@ #include "paper-def.hh" #include "note-column.hh" #include "stem.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "molecule.hh" #include "debug.hh" #include "box.hh" @@ -198,12 +198,39 @@ Slur::do_post_processing () } while (flip (&d) != LEFT); + int interstaff_i = 0; + for (int i = 0; i < encompass_arr_.size (); i++) + { + Encompass_info info (encompass_arr_[i], dir_, this); + if (info.interstaff_f_) + { + interstaff_i++; + } + } + bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ()); + + Drul_array info_drul; + info_drul[LEFT] = Encompass_info (encompass_arr_[0], dir_, this); + info_drul[RIGHT] = Encompass_info (encompass_arr_.top (), dir_, this); + Real interstaff_f = info_drul[RIGHT].interstaff_f_ + - info_drul[LEFT].interstaff_f_; + if (fix_broken_b) - do { - if (dy_f_drul_[d]) - dy_f_drul_[-d] = dy_f_drul_[d]; + { + Direction d = (encompass_arr_.top () != spanned_drul_[RIGHT]) ? + RIGHT : LEFT; + dy_f_drul_[d] = info_drul[d].o_[Y_AXIS]; + if (!interstaff_b) + { + dy_f_drul_[d] -= info_drul[d].interstaff_f_; + + if (interstaff_i) + { + dy_f_drul_[LEFT] += info_drul[d].interstaff_f_; + dy_f_drul_[RIGHT] += info_drul[d].interstaff_f_; + } + } } - while (flip (&d) != LEFT); /* @@ -211,13 +238,30 @@ Slur::do_post_processing () Catch and correct some ugly cases */ - Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; + Real height_damp_f; + Real slope_damp_f; + Real snap_f; + Real ratio_f; + + if (!fix_broken_b) + dy_f_drul_[RIGHT] += interstaff_f; Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; + + Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; Real height_f = do_height ().length (); - Real height_damp_f = paper_l ()->get_var ("slur_height_damping"); - Real slope_damp_f = paper_l ()->get_var ("slur_slope_damping"); - Real ratio_f; + if (!interstaff_b) + { + height_damp_f = paper_l ()->get_var ("slur_height_damping"); + slope_damp_f = paper_l ()->get_var ("slur_slope_damping"); + snap_f = paper_l ()->get_var ("slur_snap_to_stem"); + } + else + { + height_damp_f = paper_l ()->get_var ("slur_interstaff_height_damping"); + slope_damp_f = paper_l ()->get_var ("slur_interstaff_slope_damping"); + snap_f = paper_l ()->get_var ("slur_interstaff_snap_to_stem"); + } /* @@ -241,27 +285,28 @@ Slur::do_post_processing () Direction d = (Direction)(- dir_ * (sign (dy_f))); if (!d) d = LEFT; - dy_f_drul_[d] += dir_ * height_f * height_damp_f; + Real damp_f = dir_ * (ratio_f - height_damp_f) * dx_f; + dy_f_drul_[d] += damp_f; /* - if y positions at same height, correct both ends + if y positions at about the same height, correct both ends */ if (abs (dy_f / dx_f ) < slope_damp_f) { - dy_f_drul_[-d] += dir_ * height_f * height_damp_f; + dy_f_drul_[-d] += damp_f; } } /* If, after correcting, we're close to stem-end... */ - Real snap_f = paper_l ()->get_var ("slur_snap_to_stem"); do { if ((note_column_drul[d] == spanned_drul_[d]) && (note_column_drul[d]->stem_l_) && (note_column_drul[d]->stem_l_->dir_ == dir_) && (abs (note_column_drul[d]->stem_l_->extent (Y_AXIS)[dir_] - - dy_f_drul_[d]) <= snap_f)) + - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f)) + <= snap_f)) { /* attach to stem-end @@ -270,6 +315,7 @@ Slur::do_post_processing () dx_f_drul_[d] = stem_l->hpos_f () - spanned_drul_[d]->absolute_coordinate (X_AXIS); dy_f_drul_[d] = stem_l->extent (Y_AXIS)[dir_]; + dy_f_drul_[d] += info_drul[d].interstaff_f_; dy_f_drul_[d] += dir_ * 2 * y_gap_f; } } @@ -280,20 +326,43 @@ Array Slur::get_encompass_offset_arr () const { Array offset_arr; +#if 0 + /* + check non-disturbed slur + FIXME: x of ends off by a tiny bit!! + */ + offset_arr.push (Offset (0, dy_f_drul_[LEFT])); + offset_arr.push (Offset (0, dy_f_drul_[RIGHT])); + return offset_arr; +#endif + + int interstaff_i = 0; + for (int i = 0; i < encompass_arr_.size (); i++) + { + Encompass_info info (encompass_arr_[i], dir_, this); + if (info.interstaff_f_) + { + interstaff_i++; + } + } + bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ()); + Offset origin (absolute_coordinate (X_AXIS), 0); int first = 1; int last = encompass_arr_.size () - 2; + offset_arr.push (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT])); /* left is broken edge */ if (encompass_arr_[0] != spanned_drul_[LEFT]) { first--; + Encompass_info left_info (encompass_arr_[0], dir_, this); + if (interstaff_b) + offset_arr[0][Y_AXIS] += left_info.interstaff_f_; } - Encompass_info left_info (encompass_arr_[0], dir_, this); - offset_arr.push (Offset (0, left_info.interstaff_f_)); /* right is broken edge @@ -309,20 +378,9 @@ Slur::get_encompass_offset_arr () const offset_arr.push (info.o_ - origin); } - offset_arr.push (Offset (do_width ().length (), 0)); + offset_arr.push (Offset (do_width ().length () + dx_f_drul_[RIGHT], + dy_f_drul_[RIGHT])); -#if 1 - offset_arr[0] += Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]); - offset_arr.top () += Offset (dx_f_drul_[RIGHT], dy_f_drul_[RIGHT]); -#else - /* - check non-disturbed slur - FIXME: ends off by a tiny bit!! - */ - offset_arr[0] += Offset (0, dy_f_drul_[LEFT]); - offset_arr.top () += Offset (0, dy_f_drul_[RIGHT]); -#endif - return offset_arr; } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index c61dd3df3f..a7785e47b4 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -52,6 +52,9 @@ Spacing_engraver::do_removal_processing () void Spacing_engraver::acknowledge_element (Score_element_info i) { + if (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F) + return; + if (Rhythmic_req * r = dynamic_cast(i.req_l_)) { Rhythmic_tuple t(i, now_mom () + r->length_mom ()); diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 646d37cd97..1860a77d82 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -12,7 +12,7 @@ #include "dimensions.hh" #include "paper-def.hh" #include "warn.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "line-of-score.hh" Spacing_spanner::Spacing_spanner () diff --git a/lily/spanner.cc b/lily/spanner.cc index 9fbd9b8226..4d4659f66a 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -8,8 +8,8 @@ #include "debug.hh" #include "spanner.hh" -#include "p-col.hh" -#include "p-score.hh" +#include "paper-column.hh" +#include "paper-score.hh" #include "molecule.hh" #include "paper-outputter.hh" @@ -208,3 +208,31 @@ Spanner::do_space_processing () ss[i].add_to_cols (); } } + +void +Spanner::handle_broken_dependents () +{ +#if 0 // need to remove delayd breaking. + if (original_l_ && !original_l_->line_l ()) + { + + /* we're the broken pieces of a spanner. + Check if our Y-leaning point is sane. + */ + Dimension_cache *d = dim_cache_[Y_AXIS]->parent_l_; + if (d) + return; + + Score_element * ref_elt = dynamic_cast(d->element_l()); + Spanner *ref_span = dynamic_cast (ref_elt); + if (!ref_elt->line_l () && ref_span) + { + Spanner *broken_refpoint = ref_span->find_broken_piece (line_l ()); + if (broken_refpoint) + dim_cache_[Y_AXIS]->parent_l_ = broken_refpoint->dim_cache_[Y_AXIS]; + else + programming_error ("Spanner y -refpoint lost."); + } + } +#endif +} diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index aee2bba8bc..79ec147d69 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -11,7 +11,7 @@ #include #include "killing-cons.tcc" #include "spring-spacer.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "debug.hh" #include "dimensions.hh" #include "qlp.hh" diff --git a/lily/spring.cc b/lily/spring.cc index 8ba0ff7966..57c99c1fcd 100644 --- a/lily/spring.cc +++ b/lily/spring.cc @@ -10,7 +10,7 @@ #include "spring.hh" #include "debug.hh" #include "item.hh" -#include "p-col.hh" +#include "paper-column.hh" Spring::Spring () { diff --git a/lily/staff-sym-engraver.cc b/lily/staff-sym-engraver.cc index ba0431f4e3..b665200f35 100644 --- a/lily/staff-sym-engraver.cc +++ b/lily/staff-sym-engraver.cc @@ -9,7 +9,7 @@ #include "staff-sym-engraver.hh" #include "staff-symbol.hh" #include "score.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "staff-symbol-referencer.hh" #include "paper-def.hh" diff --git a/lily/stem.cc b/lily/stem.cc index 0fd640c795..3551ad97cf 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -14,7 +14,7 @@ #include "note-head.hh" #include "lookup.hh" #include "molecule.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "misc.hh" #include "beam.hh" #include "rest.hh" diff --git a/lily/super-element.cc b/lily/super-element.cc index 0401602c7a..03788e8f40 100644 --- a/lily/super-element.cc +++ b/lily/super-element.cc @@ -8,7 +8,7 @@ #include "super-element.hh" #include "line-of-score.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "string.hh" #include "paper-outputter.hh" @@ -26,6 +26,7 @@ enum Score_element_status { SPACING, SPACED, BROKEN, + BROKEN_SECOND, POSTCALCING, // busy calculating. This is used to trap cyclic deps. POSTCALCED, // after spacing calcs done BREWING, @@ -59,6 +60,8 @@ void Super_element::break_processing () { calculate_dependencies (BROKEN, BROKEN, &Score_element::do_break_processing); + calculate_dependencies (BROKEN_SECOND, BROKEN_SECOND, + &Score_element::handle_broken_dependents); } void Super_element::post_processing () diff --git a/lily/tie.cc b/lily/tie.cc index 86eab96d1d..e6c1902d77 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -9,7 +9,7 @@ #include "paper-def.hh" #include "tie.hh" #include "note-head.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "debug.hh" diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 2959bb7280..ccd0dd7dbe 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -210,18 +210,25 @@ Translator_group::find_create_translator_l (String n, String id) return ret; } - bool -Translator_group::do_try_music (Music* req_l) +Translator_group::try_music_on_nongroup_children (Music *m) { bool hebbes_b =false; Link_array nongroups (nongroup_l_arr ()); for (int i =0; !hebbes_b && i < nongroups.size() ; i++) - hebbes_b =nongroups[i]->try_music (req_l); + hebbes_b =nongroups[i]->try_music (m); + return hebbes_b; +} + +bool +Translator_group::do_try_music (Music* m) +{ + bool hebbes_b = try_music_on_nongroup_children (m); + if (!hebbes_b && daddy_trans_l_) - hebbes_b = daddy_trans_l_->try_music (req_l); + hebbes_b = daddy_trans_l_->try_music (m); return hebbes_b ; } diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index aa17ba7972..8ea56cdd42 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -11,7 +11,7 @@ #include "debug.hh" #include "lookup.hh" #include "molecule.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "paper-def.hh" #include "tuplet-spanner.hh" #include "stem.hh" diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 7a21264159..d02875c1d0 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -7,7 +7,7 @@ */ #include "translator-group.hh" #include "axis-group-engraver.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "vertical-align-engraver.hh" #include "axis-align-spanner.hh" #include "axis-group-spanner.hh" diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index db955da97e..9b0566af2f 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -12,7 +12,7 @@ #include "lookup.hh" #include "molecule.hh" #include "note-column.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "bar.hh" #include "paper-def.hh" #include "volta-spanner.hh" diff --git a/lily/word-wrap.cc b/lily/word-wrap.cc index 789117b757..f9c7ea8dfa 100644 --- a/lily/word-wrap.cc +++ b/lily/word-wrap.cc @@ -8,9 +8,9 @@ #include "word-wrap.hh" #include "paper-def.hh" -#include "p-score.hh" +#include "paper-score.hh" #include "debug.hh" -#include "p-col.hh" +#include "paper-column.hh" #include "spring-spacer.hh" diff --git a/ly/declarations.ly b/ly/declarations.ly index 28bcabd43e..30677bb55e 100644 --- a/ly/declarations.ly +++ b/ly/declarations.ly @@ -39,7 +39,7 @@ dorian = 10 papersize = "a4" - +\include "generic-paper.ly" \include "paper20.ly" \paper{ diff --git a/ly/engraver.ly b/ly/engraver.ly index f340a29c9a..36fe345691 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -114,10 +114,9 @@ GraceContext=\translator { \consists "Note_heads_engraver"; \consists "Local_key_engraver"; \consists "Stem_engraver"; - \consists "Slur_engraver"; - \consists "Timing_engraver"; %UGH. \consists "Beam_engraver"; beamAuto = "1"; + \consists "Slur_engraver"; \consists "Auto_beam_engraver"; \include "auto-beam-settings.ly"; \consists "Align_note_column_engraver"; @@ -129,6 +128,7 @@ GraceContext=\translator { fontSize = "-1"; stemLength = "6.0"; verticalDirection = "1"; + graceAccidentalSpace= 1.5 * \interline; }; \translator{\GraceContext} diff --git a/ly/generic-paper.ly b/ly/generic-paper.ly new file mode 100644 index 0000000000..206c771d54 --- /dev/null +++ b/ly/generic-paper.ly @@ -0,0 +1,5 @@ +\paper { + texsetting = "\\input lilyponddefs "; + pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n"; +} diff --git a/ly/paper16.ly b/ly/paper16.ly index 264691e068..c015aa2a1e 100644 --- a/ly/paper16.ly +++ b/ly/paper16.ly @@ -18,15 +18,13 @@ paper_sixteen = \paper { font_finger = 4.; font_volta = 5.; font_number = 8.; - font_dynamic = 10.; - font_mark = 10.; + font_dynamic = 10.; + font_mark = 10.; arithmetic_basicspace = 2.; arithmetic_multiplier = 4.8\pt; - texsetting = "\\input lilyponddefs "; - pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; - scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n"; - scmsetting = "\"\\\\input lilyponddefs \\\\musixsixteendefs\";\n"; + +% scmsetting = "\"\\\\input lilyponddefs \";\n"; 0 = \font "feta16" -1 = \font "feta13" diff --git a/ly/paper20.ly b/ly/paper20.ly index 9159454699..800ad6038b 100644 --- a/ly/paper20.ly +++ b/ly/paper20.ly @@ -30,13 +30,8 @@ paper_twenty = \paper { arithmetic_basicspace = 2.; arithmetic_multiplier = 6.\pt; - texsetting = "\\input lilyponddefs "; - pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; - % urg, debugging only - scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n"; - scmsetting = "\"\\\\input lilyponddefs \\\\musixtwentydefs\";\n"; - -2 = \font "feta13" + -2 = \font "feta13" -1 = \font "feta16" 0 = \font "feta20" diff --git a/ly/params.ly b/ly/params.ly index 47b28f061e..ca52e36fab 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -93,10 +93,14 @@ slur_x_minimum = 3.0 * \interline; % slope damping: keep dy/dx < slur_slope_damping slur_slope_damping = 0.3; +slur_interstaff_slope_damping = 0.8; % height damping: keep h/dx < slur_height_damping -slur_height_damping = 0.5; +slur_height_damping = 0.6; +slur_interstaff_height_damping = 1.5; % snap to stem if slur ends closer to stem than slur_snap_to_stem = 1.5 * \interline; +slur_interstaff_snap_to_stem = 2.5 * \interline; + tie_x_minimum = \slur_x_minimum; % OSU: tie gap == slur gap diff --git a/make/out/lelievijver.lsm b/make/out/lelievijver.lsm index b72fd64cc0..369539b369 100644 --- a/make/out/lelievijver.lsm +++ b/make/out/lelievijver.lsm @@ -1,15 +1,15 @@ Begin3 Titel: LilyPond -Versie: 1.1.57 -Inschrijf datum: 13JUL99 +Versie: 1.1.58 +Inschrijf datum: 14JUL99 Beschrijving: @FLAPTEKST@ Trefwoorden: muziek typezetten midi notatie Auteur: hanwen@stack.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys) Voornaamste plek: sunsite.unc.edu /pub/Linux/apps - 770k lilypond-1.1.57.tar.gz + 770k lilypond-1.1.58.tar.gz Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.57.tar.gz + 770k lilypond-1.1.58.tar.gz Copi-eer voorwaarden: GPL End diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 5a29149615..07d36ef054 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,7 +1,7 @@ Begin3 Title: LilyPond -Version: 1.1.57 -Entered-date: 13JUL99 +Version: 1.1.58 +Entered-date: 14JUL99 Description: LilyPond is the GNU Project music typesetter. It transforms a musical @@ -12,8 +12,8 @@ Author: hanwen@cs.ruu.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 - 770k lilypond-1.1.57.tar.gz + 770k lilypond-1.1.58.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.57.tar.gz + 770k lilypond-1.1.58.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 6f42f2001d..a6c7f5316a 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.1.57 +Version: 1.1.58 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.57.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.58.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys