From 51e7345f199657c7b868d5653f209703e897fca8 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 16 May 2000 11:02:27 +0200 Subject: [PATCH] release: 1.3.51 ====== * Item cleanups. Copying items and rearranging pointers are done in separate passes, which makes the code cleaner. This fixes a problem with some items not disappearing from hara-kiri staffs. * Use Scheme for Key_item data members. * Don't use regex in chord-names.scm under windows; hybrid chordnames user+calculated will be partly broken. 1.3 --- CHANGES | 15 +- Documentation/topdocs/index.tely | 10 +- VERSION | 4 +- flower/polynomial.cc | 2 + input/bugs/clef.sly | 2 - input/bugs/{ps.ly => die-staff.ly} | 0 input/bugs/p.ly | 211 ------------------ input/test/keys.ly | 4 +- lily/bezier.cc | 3 +- lily/{boxes.cc => box.cc} | 2 +- lily/clef-engraver.cc | 19 +- lily/collision-engraver.cc | 3 + lily/collision.cc | 12 +- lily/dots.cc | 1 + lily/gourlay-breaking.cc | 4 +- lily/hara-kiri-line-group-engraver.cc | 33 --- lily/include/bow.hh | 29 --- lily/include/breathing-sign.hh | 4 + lily/include/clef-item.hh | 2 +- lily/include/collision.hh | 18 +- lily/include/dots.hh | 9 +- .../hara-kiri-vertical-group-spanner.hh | 9 +- lily/include/item.hh | 5 +- lily/include/key-item.hh | 18 +- lily/include/local-key-item.hh | 8 +- lily/include/mark-engraver.hh | 16 -- lily/include/note-head.hh | 4 + lily/include/rest.hh | 7 + lily/include/rhythmic-head.hh | 8 + lily/include/single-malt-grouping-item.hh | 10 +- lily/include/super-element.hh | 16 -- lily/item.cc | 98 ++++---- lily/key-item.cc | 98 ++++---- lily/line-of-score.cc | 2 + lily/multi-measure-rest.cc | 4 +- lily/score-element.cc | 35 +-- lily/separating-group-spanner.cc | 4 +- lily/single-malt-grouping-item.cc | 2 - lily/spacing-spanner.cc | 4 +- lily/spanner.cc | 6 +- ly/params.ly | 6 + make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- scm/lily.scm | 1 + 44 files changed, 259 insertions(+), 501 deletions(-) delete mode 100644 input/bugs/clef.sly rename input/bugs/{ps.ly => die-staff.ly} (100%) delete mode 100644 input/bugs/p.ly rename lily/{boxes.cc => box.cc} (96%) delete mode 100644 lily/hara-kiri-line-group-engraver.cc delete mode 100644 lily/include/mark-engraver.hh delete mode 100644 lily/include/super-element.hh diff --git a/CHANGES b/CHANGES index 28a0e7d45b..af80dfea24 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,18 @@ -1.3.50.jcn1 -=========== +1.3.50 +====== + +* Item cleanups. Copying items and rearranging pointers are done in +separate passes, which makes the code cleaner. This fixes a problem +with some items not disappearing from hara-kiri staffs. + +* Use Scheme for Key_item data members. * Don't use regex in chord-names.scm under windows; hybrid chordnames user+calculated will be partly broken. -1.3.49.hwn2 -=========== + +1.3.50 +====== * Junked Shift_tuple from collision; Now it uses SCM. diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index d8b387b2af..7b4e57eb41 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -67,7 +67,7 @@ almost no restrictions. LilyPond is part of the The version numbers are in Linux-kernel style: even numbered versions are `stable'. The webpages for the stable version (1.2) reside at GNU, here: @uref{http://www.gnu.org/software/lilypond}. Big enhancements go -into the latest odd numbered version (1.3); its webpages are on +into the latest odd numbered version (1.3), whose webpages are on @uref{http://www.cs.uu.nl/~hanwen/lilypond/,Han-Wen's site}. If want more information, you can browse the @@ -124,7 +124,7 @@ Installing and compiling requires many additional packages, which are listed in the @uref{Documentation/topdocs/out-www/INSTALL.html, installation instructions}. -There are binaries available, but alas they are not updated for every version released. +Binaries are available, but are not updated for every version released. @itemize @bullet @item RedHat-i386 and Linuxppc RPMs: @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/RPMS/} @@ -149,10 +149,10 @@ Frequently Asked Questions} first.) subscribe: send mail with subject "subscribe" to info-gnu-music-request@@gnu.org. - As this list is moderated, normal people should ask to + This list is moderated; ask @email{drl@@gnu.org, David R. Linn} or - @email{hanwen@@cs.uu.nl, Han-Wen} to forward announces instead of - sending it to info-gnu-music@@gnu.org + @email{hanwen@@cs.uu.nl, Han-Wen} to send announcements for this +list. This list is archived at @uref{http://www.mail-archive.com/info-gnu-music@@gnu.org} diff --git a/VERSION b/VERSION index 4be4d9c8ad..b5601a0786 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=50 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=51 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 4e7fd944c7..50749f1fe4 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -276,7 +276,9 @@ Polynomial::solve_cubic()const { sol[i] -= sub; +#ifdef PARANOID assert (fabs (eval (sol[i]) ) < 1e-8); +#endif } return sol; diff --git a/input/bugs/clef.sly b/input/bugs/clef.sly deleted file mode 100644 index 8eb104509f..0000000000 --- a/input/bugs/clef.sly +++ /dev/null @@ -1,2 +0,0 @@ -\clef "violin"; c' c \clef "alto"; d, d -\clef "violin"; c' c \clef "alto"; d, d diff --git a/input/bugs/ps.ly b/input/bugs/die-staff.ly similarity index 100% rename from input/bugs/ps.ly rename to input/bugs/die-staff.ly diff --git a/input/bugs/p.ly b/input/bugs/p.ly deleted file mode 100644 index 416e641c6e..0000000000 --- a/input/bugs/p.ly +++ /dev/null @@ -1,211 +0,0 @@ - -praeludium_commands = \notes { - \time 4/4; - \key e; -} - -praeludium_right = \notes { - \$praeludium_commands - \clef violin; - - % 13 -- how to type -- where to split -- this more neatly? - \context Staff < - \context Voice = I \relative c'' { \stemup r4 dis4 e4. e8 ~ | - \shifton e4 [d8 fis8] \shiftoff gis4 ~ [gis8 fis16 e ] | - fis4 ~ [fis8 e16 dis] e4 r8 e8 } - \context Voice = III \relative c'' { \stemup \shifton r4 bis cis \shiftoff cis | - a' ~ [a16 gis a b] \shifton dis,4 cis ~ | - [cis8 dis16 ais] bis4 cis r8 b } - \context Voice = IV \relative c'' { - - %\stemup - %{ - this is a diversion from the Griepenkerl/Keller - edition; a hack to avoid collisions - %} - \stemdown - \shifton s4 gis } - - \context Voice = II \relative c' { \stemdown -% \shifton % idem - - r4 fis \shiftoff gis gis | - a4. cis8 gis2 | - fis4 gis gis r8 e8 } - > | - % 16 -} - -praeludium_left = \notes \relative c { - \$praeludium_commands - \clef bass; - - % 13 - \context Staff < - \context VoiceTwo { r4 } - \context VoiceOne { \stemup s4 dis' cis cis ~ | - [cis8 a d cis] [bis gis] cis4 | - dis2 cis4 r8 cis } - \context VoiceOne { \stemup bis2 } - \context VoiceThree { \stemup \shifton r4 gis ~ [gis8 gis] ~ \stemdown \shiftoff gis4 | - a4. fis8 gis4. a8 ~ | - a4 gis4 gis r8 gis } -% { \stemup \shifton s4 fis4 e} -% a quick hack to avoid some collisons - \context VoiceFour { \stemdown \shifton s4 fis4 e} - \context VoiceTwo { \stemdown s4 dis4 cis4 } - > | - %16 -} - -praeludium_pedal = \notes \relative c{ - \$praeludium_commands - \clef bass; - - %13 - r4 fis,4-\ltoe e4.-\lheel e'8-\rheel | - fis4.-\rtoe fis8-\rtoe fis4-\rtoe [e8-\ltoe a-\rtoe] | - dis,4-\ltoe gis-\rtoe [cis,8-\ltoe b!-\lheel ais-\rtoe gis-\ltoe] | - %16 -} - - -fugaII_commands = \notes{ - \time3/4; - \key e; % E-major -} - -fugaII_right = \notes \relative c'' { - \$fugaII_commands - \clef violin; - - %15 - \context Staff < - \context Voice = VA { \stemup [b8 fis8] b4 } - \context Voice = VB { \stemdown fis2 } - > - - % Wadieuw - \context Staff \notes\relative c''< - \context Voice=one { - \property Voice.horizontalNoteShift=0 - \property Voice.verticalDirection=1 - e4 - } - \context Voice=two { - \property Voice.verticalDirection=1 - \property Voice.horizontalNoteShift=1 - cis - } - \context Voice=three { - \property Voice.horizontalNoteShift=2 - \property Voice.verticalDirection=1 - ais - } - \context Voice=four { - \property Voice.verticalDirection=-1 - \property Voice.horizontalNoteShift=-1 - fis - } - > - - %16 - \context Staff < - \context VoiceOne { dis2 dis4 | - cis2 cis4 | - b4. [cis8 dis e] } - \context VoiceThree { \stemup \shifton [b8 fis] b2 ~ | - [b8 a!16 gis] a2 ~ | - a4 gis2 } - \context VoiceTwo { \stemdown fis2. ~ | - fis ~ | - fis4 e2 } - > | - %19 -} - -fugaII_left = \notes { - \$fugaII_commands - \clef bass; - - %15 - \context Staff < - \context VoiceTwo { \stemdown b2 \stemup ais4 | - b2 b4 } - \context VoiceTwo { \stemdown s2 e4 | - fis2 fis4 } - > - \stemdown cis2 e4 | - b4. b8 b4 | - %19 -} - -fugaII_pedal = \notes \relative c { - \$fugaII_commands - \clef bass; - - %15 - dis4.-\ltoe e8-\rtoe cis4 | - b4.-\lheel [cis8-\ltoe dis8-\rtoe e8-\rheel] | - fis4.-\rtoe [e8-\rheel dis8-\rtoe cis8-\ltoe] | - dis4-\rtoe e4-\rheel e,4-\ltoe | - %19 -} - -breakmusic = \notes { - %\time4/4; - r1 -} - - -% these should be two separate scores... -\score{ - \context Score < - \context PianoStaff < - \context Staff = treble { - \praeludium_right \breakmusic \fugaII_right } - \context Staff = bass { - \praeludium_left \breakmusic \fugaII_left } - > - \context Staff = pedal { - \praeludium_pedal \breakmusic \fugaII_pedal } - > - - \paper { - \translator { - \VoiceContext - \name "VoiceOne"; - verticalDirection = "1"; - } - \translator { - \VoiceContext - \name "VoiceTwo"; - verticalDirection = "-1"; - } - \translator { - \VoiceContext - \name "VoiceThree"; - verticalDirection = "1"; - horizontalNoteShift = "1"; - } - \translator { - \VoiceContext - \name "VoiceFour"; - verticalDirection = "-1"; - horizontalNoteShift = "1"; - } - \translator { - \StaffContext - - \accepts VoiceFour; - \accepts VoiceThree; - \accepts VoiceTwo; - \accepts VoiceOne; - } - \translator { \OrchestralScoreContext } -castingalgorithm = \Wordwrap; - } - - \midi { - \tempo 4 =96; } -} diff --git a/input/test/keys.ly b/input/test/keys.ly index 99bf45142d..0d49507e5f 100644 --- a/input/test/keys.ly +++ b/input/test/keys.ly @@ -4,9 +4,9 @@ test key itemv breaking %} \score { - \notes + \notes \relative c'' { - \key bes; c1 \key c \minor; c1 + \key bes; c2 \key c \minor; c2 \break \key bes \major; c1 \key d;\break c1 } diff --git a/lily/bezier.cc b/lily/bezier.cc index 72bd0e0f46..e7f02063f6 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -87,9 +87,10 @@ Bezier::curve_point (Real t)const one_min_tj /= (1-t); } +#ifdef PARANOID assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8); assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8); - +#endif return o; } diff --git a/lily/boxes.cc b/lily/box.cc similarity index 96% rename from lily/boxes.cc rename to lily/box.cc index acc6681d79..722e08278c 100644 --- a/lily/boxes.cc +++ b/lily/box.cc @@ -1,5 +1,5 @@ /* - boxes.cc -- implement Box + box.cc -- implement Box source file of the GNU LilyPond music typesetter diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index de2cb687c7..7fff19244c 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -217,21 +217,20 @@ Clef_engraver::do_pre_move_processing() { if (clef_p_) { + SCM vis; if(to_boolean (clef_p_->remove_elt_property("non-default"))) { - SCM all = scm_eval (ly_symbol2scm ("all-visible")); - clef_p_->set_elt_property("visibility-lambda", all); - if (octavate_p_) - octavate_p_->set_elt_property("visibility-lambda", all); + vis = ly_symbol2scm ("all-visible"); } else - { - SCM beg = scm_eval (ly_symbol2scm ("begin-of-line-visible")); + vis = ly_symbol2scm ("begin-of-line-visible"); + + vis = scm_eval (vis); + + clef_p_->set_elt_property("visibility-lambda", vis); + if (octavate_p_) + octavate_p_->set_elt_property("visibility-lambda", vis); - clef_p_->set_elt_property ("visibility-lambda", beg); - if (octavate_p_) - octavate_p_->set_elt_property ("visibility-lambda", beg); - } typeset_element (clef_p_); clef_p_ =0; diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index eebb06122b..c31121dae4 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -11,6 +11,9 @@ #include "dimension-cache.hh" #include "engraver.hh" +/* + collect Note_column, and as soon as there are 2 or more, put them in + a collision object. */ class Collision_engraver : public Engraver { Collision* col_p_; Link_array note_column_l_arr_; diff --git a/lily/collision.cc b/lily/collision.cc index 32ee0d69f6..e3eb69a403 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -28,6 +28,15 @@ Collision::add_column (Note_column* ncol_l) void Collision::before_line_breaking () +{ + do_shifts(); +} + +/* + TODO: make callback of this. + */ +void +Collision::do_shifts() { SCM autos (automatic_shift ()); SCM hand (forced_shift ()); @@ -55,8 +64,7 @@ Collision::before_line_breaking () /** This complicated routine moves note columns around horizontally to ensure that notes don't clash. - This should be done better, probably. - + This should be put into Scheme. */ SCM Collision::automatic_shift () diff --git a/lily/dots.cc b/lily/dots.cc index 5fa59bdd50..6f098e6110 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -39,6 +39,7 @@ Dots::after_line_breaking () si.set_position (p + directional_element (this).get ()); } } + Molecule Dots::do_brew_molecule () const { diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 0425c8a118..696a0d88a6 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -83,8 +83,8 @@ Gourlay_breaking::do_solve () const { Link_array line = all.slice (breaks[start_idx], breaks[break_idx]+1); - line[0] = dynamic_cast(line[0]->find_broken_piece (RIGHT)); - line.top () = dynamic_cast(line.top ()->find_broken_piece (LEFT)); + line[0] = dynamic_cast (line[0] ->find_prebroken_piece (RIGHT)); + line.top () = dynamic_cast (line.top ()->find_prebroken_piece (LEFT)); Column_x_positions cp; cp.cols_ = line; diff --git a/lily/hara-kiri-line-group-engraver.cc b/lily/hara-kiri-line-group-engraver.cc deleted file mode 100644 index 721a0995a8..0000000000 --- a/lily/hara-kiri-line-group-engraver.cc +++ /dev/null @@ -1,33 +0,0 @@ -/* - hara-kiri-line-group-engraver.cc -- implement Hara_kiri_line_group_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2000 Jan Nieuwenhuizen -*/ - -#include "rhythmic-head.hh" -#include "hara-kiri-vertical-group-spanner.hh" -#include "hara-kiri-line-group-engraver.hh" - - -ADD_THIS_TRANSLATOR (Hara_kiri_line_group_engraver); - -void -Hara_kiri_line_group_engraver::create_line_spanner () -{ - staffline_p_ = new Hara_kiri_group_spanner; - -} - -void -Hara_kiri_line_group_engraver::typeset_element(Score_element * e) -{ - if (Rhythmic_head *h = dynamic_cast (e)) - { - dynamic_cast (staffline_p_) - ->add_interesting_item (h); - } - Line_group_engraver_group::typeset_element (e); -} - diff --git a/lily/include/bow.hh b/lily/include/bow.hh index 40770af5df..8b13789179 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -1,30 +1 @@ -/* - bow.hh -- declare Bow - source file of the GNU LilyPond music typesetter - - (c) 1997--2000 Han-Wen Nienhuys -*/ - - -#ifndef BOW_HH -#define BOW_HH - -#include "spanner.hh" - -/** - Base class for anything that looks like a slur. - Anybody with a better name? - - UGH. Fixme. Should junk - - dy_f_drul_ , dx_f_drul_ - - */ -class Bow : public Spanner -{ -protected: -}; -#error - -#endif // BOW_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index ca074df3fa..e0cda68c19 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -13,6 +13,10 @@ #include "item.hh" #include "parray.hh" +/* + breathing sign (apostrophe within staff, not the comma above staff + type) +*/ class Breathing_sign : public Item { public: diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index 758e42a8a6..111e416393 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -16,7 +16,7 @@ properties: - nondefault -- not set because of existence of a bar? + non-default -- not set because of existence of a bar? change -- is this a change clef (smaller size)? diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 7a7b5379f2..4cb7b615ec 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -18,15 +18,29 @@ TODO - multistaff support (see Chlapik: equal noteheads should be on the + * multistaff support (see Chlapik: equal noteheads should be on the same hpos.) + + * Make interface of this, similar to align-interface. + + Properties: + + elements -- (see Axis_group_interface) + + merge-differently-dotted -- merge black noteheads with differing dot count. + + horizontal-shift -- integer that identifies ranking of note-column for horizontal shifting. + + force-hshift -- amount of collision_note_width that overides automatic collision settings. + Read and removed from elements. + */ class Collision : public Item { protected: SCM automatic_shift (); SCM forced_shift (); - + void do_shifts (); virtual void before_line_breaking (); public: diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 4f3ba7200b..2446e1f906 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -16,9 +16,14 @@ /** The dots to go with a notehead/rest. A separate class, since they are a party in collision resolution. + + properties: + + dot-count -- number of dots. + + */ -class Dots : - public Item +class Dots : public Item { protected: virtual Molecule do_brew_molecule () const; diff --git a/lily/include/hara-kiri-vertical-group-spanner.hh b/lily/include/hara-kiri-vertical-group-spanner.hh index aeb77bf9b8..389223cf34 100644 --- a/lily/include/hara-kiri-vertical-group-spanner.hh +++ b/lily/include/hara-kiri-vertical-group-spanner.hh @@ -16,7 +16,14 @@ As Vertical_group_spanner, but keep track of interesting items. If we don't contain any interesting items after linebreaking, then gracefully commit suicide. Objective: don't disgrace Lily by - typesetting empty lines in orchestral scores. */ + typesetting empty lines in orchestral scores. + + properties: + + items-worth-living -- list of interesting items. If empty in a particular system, + clear this line + +*/ class Hara_kiri_group_spanner : public Spanner { public: diff --git a/lily/include/item.hh b/lily/include/item.hh index 0f2c951ca4..d92a67fb04 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -38,8 +38,6 @@ class Item : public Score_element { Drul_array broken_to_drul_; - void do_break (); - void try_visibility_lambda (); public: VIRTUAL_COPY_CONS(Score_element); Item(); @@ -50,11 +48,12 @@ public: Direction break_status_dir () const; - Item * find_broken_piece (Direction) const; + Item * find_prebroken_piece (Direction) const; Score_element * find_broken_piece (Line_of_score*) const; virtual Line_of_score * line_l() const; virtual Paper_column * column_l () const; + virtual void handle_prebroken_dependencies (); protected: virtual void do_breakable_col_processing(); void copy_breakable_items(); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index d8a7f295a0..c003a3094d 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -11,16 +11,20 @@ #include "array.hh" -/** An item which places accidentals at the start of the line +/** + A group of accidentals. - TODO: Schemify me. + Properties: + + c0-position -- integer indicating the position of central C? + + old-accidentals -- list of (pitch, accidental) pairs + + new-accidentals -- list of (pitch, accidental) pairs */ class Key_item :public Item { - Array pitch_arr_; - Array acc_arr_; - Array old_pitch_arr_; - Array old_acc_arr_; + int calculate_position(SCM pair) const; public: VIRTUAL_COPY_CONS(Score_element); @@ -28,8 +32,6 @@ public: void add (int pitch, int acc); void add_old (int pitch, int acc); - int calculate_position(int p, int a) const; - protected: virtual Molecule do_brew_molecule() const; }; diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 3cfb339ce1..39ad2ccac2 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -32,14 +32,8 @@ struct Local_key_cautionary_tuple /** Accidentals which can be different for each octave. - - TODO - - Make an item for each accidental separately, and make a - Accidental_column to group them. - + TODO: schemify me! */ - class Local_key_item : public Item { Array accidental_arr_; diff --git a/lily/include/mark-engraver.hh b/lily/include/mark-engraver.hh deleted file mode 100644 index 4e4da38ced..0000000000 --- a/lily/include/mark-engraver.hh +++ /dev/null @@ -1,16 +0,0 @@ -/* - mark-engraver.hh -- declare Mark_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2000 Jan Nieuwenhuizen -*/ - - -#ifndef MARK_ENGRAVER_HH -#define MARK_ENGRAVER_HH - -#error - - -dendif // MARK_ENGRAVER_HH diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index dcdeca9ca4..3354ecfb24 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -13,6 +13,10 @@ * help lines + Properties + + style -- symbol that sets note head style + */ class Note_head : public Rhythmic_head diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 21ab46ae03..dcd6b81628 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -12,6 +12,13 @@ #include "rhythmic-head.hh" +/** + A pause. + + Properties + + style -- string specifying glyph style + */ class Rest : public Rhythmic_head { protected: diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index 4733d5f155..5d3ca3d56c 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -12,6 +12,14 @@ #include "item.hh" +/* + Properties + + duration-log -- 2-log of the notehead duration + + dot -- reference to Dots object. + +*/ class Rhythmic_head : public Item { public: diff --git a/lily/include/single-malt-grouping-item.hh b/lily/include/single-malt-grouping-item.hh index 78c325dcf7..17280a2b82 100644 --- a/lily/include/single-malt-grouping-item.hh +++ b/lily/include/single-malt-grouping-item.hh @@ -17,6 +17,15 @@ since these usually are in a different X_group It's 1:30 am. Naming suggestions appreciated. + + Properties: + + + elements -- list of items. + + no-spacing-rods -- read from elements: boolean that makes Single_malt_grouping_item ignore + this item + */ class Single_malt_grouping_item : public Item { @@ -27,6 +36,5 @@ public: void add_item (Item*); }; - #endif /* SINGLE_MALT_GROUPING_ITEM_HH */ diff --git a/lily/include/super-element.hh b/lily/include/super-element.hh deleted file mode 100644 index 3ae4480ba4..0000000000 --- a/lily/include/super-element.hh +++ /dev/null @@ -1,16 +0,0 @@ -/* - super-element.hh -- declare Super_element - - source file of the LilyPond music typesetter - - (c) 1997--2000 Han-Wen Nienhuys -*/ - - -#ifndef Super_element_HH -#define Super_element_HH - -#error -#include "score-element.hh" - -#endif // Super_element_HH diff --git a/lily/item.cc b/lily/item.cc index 1f7950658c..8547dd9f1a 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -22,7 +22,7 @@ Item::Item () /** Item copy ctor. Copy nothing: everything should be a elt property - or a special purpose poitner (such as broken_to_drul_[]) */ + or a special purpose pointer (such as broken_to_drul_[]) */ Item::Item (Item const &s) : Score_element (s) { @@ -38,7 +38,7 @@ Item::breakable_b () const return false; Item * i =dynamic_cast (parent_l (X_AXIS)); - return (i) ? i->breakable_b () : to_boolean (get_elt_property( "breakable")); + return (i) ? i->breakable_b () : to_boolean (get_elt_property ("breakable")); } Line_of_score * @@ -63,35 +63,8 @@ Item::copy_breakable_items() } while (flip(&i) != LEFT); broken_to_drul_= new_copies; - - do - { - broken_to_drul_[i]->handle_prebroken_dependencies(); - broken_to_drul_[i]->try_visibility_lambda(); - } - while (flip(&i) != LEFT); } -void -Item::try_visibility_lambda () -{ - SCM vis = remove_elt_property ("visibility-lambda"); - if (gh_procedure_p (vis)) - { - SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); - SCM result = gh_apply (vis, args); - bool trans = gh_scm2bool (gh_car (result)); - bool empty = gh_scm2bool (gh_cdr (result)); - - if (empty) - { - set_extent_callback (0, X_AXIS); - set_extent_callback (0, Y_AXIS); - } - if (trans) - set_elt_property ("transparent", SCM_BOOL_T); - } -} bool Item::broken_b () const @@ -100,33 +73,13 @@ Item::broken_b () const } void -Item::do_break () +Item::do_breakable_col_processing() { if (broken_b ()) return; if (breakable_b ()) - { - copy_breakable_items(); - handle_prebroken_dependencies(); - - /* - Otherwise the broken items won't be pre_process()'ed. - */ - - if (broken_to_drul_[LEFT]) - { - add_dependency (broken_to_drul_[LEFT]); - add_dependency (broken_to_drul_[RIGHT]); - } - } - try_visibility_lambda (); // ugh. -} - -void -Item::do_breakable_col_processing() -{ - do_break (); + copy_breakable_items(); } Score_element* @@ -137,7 +90,7 @@ Item::find_broken_piece (Line_of_score*l) const Direction d = LEFT; do { - Score_element *s = find_broken_piece (d); + Score_element *s = broken_to_drul_[d]; if (s && s->line_l () == l) return s; } @@ -146,19 +99,14 @@ Item::find_broken_piece (Line_of_score*l) const return 0; } + Item* -Item::find_broken_piece (Direction d) const +Item::find_prebroken_piece (Direction d) const { Item * me = (Item *) (this); if (!d) return me; - else if (breakable_b ()) - { - me->do_break (); - return dynamic_cast (broken_to_drul_[d]); - } - else - return 0; + return dynamic_cast (broken_to_drul_[d]); } Paper_column * @@ -180,4 +128,34 @@ Item::break_status_dir () const return CENTER; } +void +Item::handle_prebroken_dependencies () +{ + if (original_l_) + { + element_property_alist_ + = handle_broken_smobs (original_l_->element_property_alist_, + gh_int2scm (break_status_dir ())); + } + + /* + Can't do this earlier, because try_visibility_lambda () might set + the elt property transparent, which would then be copied. + */ + SCM vis = remove_elt_property ("visibility-lambda"); + if (gh_procedure_p (vis)) + { + SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); + SCM result = gh_apply (vis, args); + bool trans = gh_scm2bool (gh_car (result)); + bool empty = gh_scm2bool (gh_cdr (result)); + if (empty) + { + set_extent_callback (0, X_AXIS); + set_extent_callback (0, Y_AXIS); + } + if (trans) + set_elt_property ("transparent", SCM_BOOL_T); + } +} diff --git a/lily/key-item.cc b/lily/key-item.cc index e6b8df7b44..72380e7311 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -8,13 +8,11 @@ keyplacement by Mats Bengtsson */ +#include "group-interface.hh" #include "key-item.hh" -#include "key.hh" -#include "debug.hh" #include "molecule.hh" #include "paper-def.hh" #include "lookup.hh" -#include "musical-pitch.hh" #include "staff-symbol-referencer.hh" const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */ @@ -24,26 +22,32 @@ Key_item::Key_item () { set_elt_property ("breakable", SCM_BOOL_T); set_elt_property ("c0-position", gh_int2scm (0)); + + set_elt_property ("old-accidentals", SCM_EOL); + set_elt_property ("new-accidentals", SCM_EOL); } void Key_item::add (int p, int a) { - pitch_arr_.push (p); - acc_arr_.push (a); + SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a)); + Group_interface (this, "new-accidentals").add_thing (pair); } void Key_item::add_old (int p, int a) { - old_pitch_arr_.push (p); - old_acc_arr_.push (a); + SCM pair = gh_cons (gh_int2scm (p),gh_int2scm (a)); + Group_interface (this, "old-accidentals").add_thing (pair); } int -Key_item::calculate_position(int p, int a) const +Key_item::calculate_position(SCM pair) const { + int p = gh_scm2int (gh_car (pair)); + int a = gh_scm2int (gh_cdr (pair)); + if (to_boolean (get_elt_property ("multi-octave"))) { return p + gh_scm2int (get_elt_property ("c0-position")); @@ -62,9 +66,10 @@ Key_item::calculate_position(int p, int a) const { p -= 7; /* Typeset below c_position */ } - /* Provide for the four cases in which there's a glitch */ - /* it's a hack, but probably not worth */ - /* the effort of finding a nicer solution. dl. */ + /* Provide for the four cases in which there's a glitch + it's a hack, but probably not worth + the effort of finding a nicer solution. + --dl. */ if (c0==2 && a>0 && p==3) p -= 7; if (c0==-3 && a>0 && p==-1) @@ -81,8 +86,11 @@ Key_item::calculate_position(int p, int a) const /* TODO - space the `natural' signs wider - - dehair this + + + */ + Molecule Key_item::do_brew_molecule() const { @@ -91,27 +99,23 @@ Key_item::do_brew_molecule() const Staff_symbol_referencer_interface si (this); Real inter = si.staff_space ()/2.0; - int j; - if ((break_status_dir () == LEFT || break_status_dir () == CENTER) - || old_pitch_arr_.size ()) - { - for (int i =0; i < old_pitch_arr_.size(); i++) - { - for (j =0; (j < pitch_arr_.size()) - && (old_pitch_arr_[i] != pitch_arr_[j]); j++) - ; - - if (j == pitch_arr_.size() - || (old_pitch_arr_[i] == pitch_arr_[j] - && old_acc_arr_[i] != acc_arr_[j])) - { - Molecule m =lookup_l ()->afm_find ("accidentals-0"); - - m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); - mol.add_at_edge (X_AXIS, RIGHT, m,0); - } - } + SCM newas = get_elt_property ("new-accidentals"); + /* + SCM lists are stacks, so we work from right to left, ending with + the cancellation signature. + */ + for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) + { + int a = gh_scm2int (gh_cdar (s)); + Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (a)); + m.translate_axis (calculate_position(gh_car (s)) * inter, Y_AXIS); + mol.add_at_edge (X_AXIS, LEFT, m, 0); + } + + if (break_status_dir () != RIGHT) + { + SCM old = get_elt_property ("old-accidentals"); /* Add half a space between cancellation and key sig. @@ -120,15 +124,31 @@ Key_item::do_brew_molecule() const Interval x(0, inter); Interval y(0,0); - mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0); + mol.add_at_edge (X_AXIS, LEFT, lookup_l()->blank (Box(x,y)),0); + + for (; gh_pair_p (old); old = gh_cdr (old)) + { + SCM found = SCM_EOL; + + /* + find correspondences in pitches + */ + for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) + if (gh_caar(s) == gh_caar (old)) + found = gh_car (s); + + if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old)) + { + Molecule m =lookup_l ()->afm_find ("accidentals-0"); + + m.translate_axis (calculate_position(gh_car(old)) * inter, Y_AXIS); + mol.add_at_edge (X_AXIS, LEFT, m,0); + } + } + + } - for (int i =0; i < pitch_arr_.size(); i++) - { - Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i])); - m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); - mol.add_at_edge (X_AXIS, RIGHT, m, 0); - } return mol; } diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 18596d017d..5ca3685dee 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -212,6 +212,8 @@ Line_of_score::pre_processing () { for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) unsmob_element (gh_car (s))->do_breakable_col_processing (); + for (SCM s = get_elt_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) + unsmob_element (gh_car (s))->handle_prebroken_dependencies (); fixup_refpoints (get_elt_property ("all-elements")); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 6001e531bf..0d360c945b 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -183,8 +183,8 @@ Multi_measure_rest::get_rods () const Item * l = get_bound (LEFT)->column_l (); Item * r = get_bound (RIGHT)->column_l (); - Item * lb = l->find_broken_piece (RIGHT); - Item * rb = r->find_broken_piece (LEFT); + Item * lb = l->find_prebroken_piece (RIGHT); + Item * rb = r->find_prebroken_piece (LEFT); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; for (int i=0; i < 4; i++) diff --git a/lily/score-element.cc b/lily/score-element.cc index 891f67e092..48dd8be722 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -27,6 +27,7 @@ #include "dimension-cache.hh" #include "side-position-interface.hh" #include "item.hh" + /* TODO: @@ -291,7 +292,9 @@ Score_element::do_add_processing() } - +/* + ugh. + */ Molecule Score_element::do_brew_molecule() const { @@ -353,18 +356,17 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) Direction d = to_dir (criterion); if (i && i->break_status_dir () != d) { - Item *br = i->find_broken_piece (d); + Item *br = i->find_prebroken_piece (d); return (br) ? br->self_scm_ : SCM_UNDEFINED; } } else { - Line_of_score * line = dynamic_cast (unsmob_element ( criterion)); - Line_of_score * dep_line = sc->line_l (); + Line_of_score * dep_line = sc->line_l (); if (dep_line != line) { - Score_element * br = sc->find_broken_piece (line); + Score_element * br = sc->find_broken_piece (line); return (br) ? br->self_scm_ : SCM_UNDEFINED; } if (!dep_line) @@ -393,7 +395,8 @@ Score_element::handle_broken_smobs (SCM src, SCM criterion) return handle_broken_smobs (cdr, criterion); - We don't want to rely on the compiler to do this. */ + We don't want to rely on the compiler to do this. Without + tail-recursion, this easily crashes with a stack overflow. */ src = cdr; goto again; } @@ -439,34 +442,19 @@ Score_element::handle_broken_dependencies() /* This element is `invalid'; it has been removed from all dependencies, so let's junk the element itself. - */ element_property_alist_ = SCM_EOL; set_extent_callback (0, Y_AXIS); set_extent_callback (0, X_AXIS); } - - } - -/* - TODO: cleanify. - */ void Score_element::handle_prebroken_dependencies() { - if (Item*i =dynamic_cast (this)) - { - if (original_l_) - { - element_property_alist_ - = handle_broken_smobs (original_l_->element_property_alist_, - gh_int2scm (i->break_status_dir ())); - } - } } + bool Score_element::linked_b() const { @@ -625,7 +613,7 @@ Score_element::fixup_refpoint () Direction my_dir = i->break_status_dir () ; if (my_dir!= parenti->break_status_dir()) { - Item *newparent = parenti->find_broken_piece (my_dir); + Item *newparent = parenti->find_prebroken_piece (my_dir); set_parent (newparent, ax); } } @@ -639,7 +627,6 @@ Score_element::fixup_refpoint () SMOB funcs ****************************************************/ - #include "ly-smobs.icc" IMPLEMENT_UNSMOB(Score_element, element); diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index c00bfd8e13..43e7d0d8c0 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -52,10 +52,10 @@ Separating_group_spanner::get_rods () const continue; Single_malt_grouping_item *lb - = dynamic_cast(l->find_broken_piece (RIGHT)); + = dynamic_cast(l->find_prebroken_piece (RIGHT)); Single_malt_grouping_item *rb - = dynamic_cast(r->find_broken_piece (LEFT)); + = dynamic_cast(r->find_prebroken_piece (LEFT)); a.push (make_rod(l, r)); if (lb) diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc index b017addc21..3ab74cdc25 100644 --- a/lily/single-malt-grouping-item.cc +++ b/lily/single-malt-grouping-item.cc @@ -44,8 +44,6 @@ Single_malt_grouping_item::my_width () const SCM elt = gh_car (s); if (!SMOB_IS_TYPE_B(Score_element, elt)) continue; - - Item *il = dynamic_cast (SMOB_TO_TYPE (Score_element, elt)); if (pc != il->column_l ()) diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index d8cf62c2ac..6ad6b1a06c 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -67,8 +67,8 @@ Spacing_spanner::do_measure (Link_array cols) const { Item * l = cols[i]; Item * r = cols[i+1]; - Item * lb = l->find_broken_piece (RIGHT); - Item * rb = r->find_broken_piece (LEFT); + Item * lb = l->find_prebroken_piece (RIGHT); + Item * rb = r->find_prebroken_piece (LEFT); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; diff --git a/lily/spanner.cc b/lily/spanner.cc index 9a8ed71038..d3623668e1 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -63,7 +63,7 @@ Spanner::do_break_processing () Direction d = LEFT; do { - Item* bound = left->find_broken_piece (d); + Item* bound = left->find_prebroken_piece (d); if (bound->line_l ()) { Spanner * span_p = dynamic_cast( clone ()); @@ -94,7 +94,7 @@ Spanner::do_break_processing () { Item *&pc_l = bounds[d] ; if (!pc_l->line_l()) - pc_l = pc_l->find_broken_piece(- d); + pc_l = pc_l->find_prebroken_piece(- d); assert (pc_l); } @@ -122,7 +122,7 @@ Spanner::set_my_columns() do { if (!spanned_drul_[i]->line_l()) - set_bound(i,spanned_drul_[i]->find_broken_piece((Direction) -i)); + set_bound(i,spanned_drul_[i]->find_prebroken_piece((Direction) -i)); } while (flip(&i) != LEFT); } diff --git a/ly/params.ly b/ly/params.ly index 6b0629c7ce..cd799fdb76 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -70,10 +70,16 @@ arithmetic_multiplier = 0.9 * \quartwidth ; arithmetic_basicspace = 2.0; + + #'Stem_tremolo::beam-width = 1.5 * \quartwidth ; #'Left_edge_item::visibility-lambda = #begin-of-line-visible +% +% UGH; junk these! +% + #'Key_item::visibility-lambda = #begin-of-line-visible #'Breathing_sign::visibility-lambda = #begin-of-line-invisible diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index d435d4218d..38df7ada12 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.50 -Entered-date: 12MAY00 +Version: 1.3.51 +Entered-date: 16MAY00 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.50.tar.gz + 1000k lilypond-1.3.51.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.50.tar.gz + 1000k lilypond-1.3.51.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 8d9bad92f0..9be3cbd233 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.50 +Version: 1.3.51 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.50.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.51.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/scm/lily.scm b/scm/lily.scm index fec2be9cfe..2f237ac73a 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -104,6 +104,7 @@ ((none Instrument_name) . (extra-space 1.0)) ((Instrument_name Left_edge_item) . (extra-space 1.0)) ((Left_edge_item Clef_item) . (extra-space 1.0)) + ((Left_edge_item Key_item) . (extra-space 0.0)) ((none Left_edge_item) . (extra-space 0.0)) ((Left_edge_item Staff_bar) . (extra-space 0.0)) ; ((none Left_edge_item) . (extra-space -15.0)) -- 2.39.2