From 352fd1005d930ced9e8631cd69f6ce439ceff512 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 21 Mar 2002 01:55:13 +0100 Subject: [PATCH] release: 1.5.45 --- AUTHORS.txt | 2 +- ChangeLog | 46 +++++++ Documentation/regression-test.tely | 4 + Documentation/topdocs/AUTHORS.texi | 2 +- VERSION | 2 +- input/baerenreiter-sarabande.ly | 41 +++--- input/regression/accidental-octave.ly | 19 +-- input/regression/accidental-voice.ly | 60 +++++++++ input/regression/accidentals.ly | 18 +-- input/regression/system-extents.ly | 20 +++ input/test/boxed-molecule.ly | 12 -- lily/accidental-engraver.cc | 163 +++++++++++++++--------- lily/beaming-info.cc | 2 +- lily/grob.cc | 48 +++++-- lily/include/grob.hh | 4 +- lily/include/item.hh | 4 +- lily/include/lily-proto.hh | 2 +- lily/include/line-of-score.hh | 4 +- lily/include/paper-column.hh | 4 +- lily/include/paper-score.hh | 4 +- lily/include/score-engraver.hh | 2 +- lily/include/spanner.hh | 4 +- lily/include/translator-group.hh | 2 + lily/item.cc | 4 +- lily/molecule.cc | 19 ++- lily/paper-column.cc | 4 +- lily/paper-score.cc | 2 +- lily/score-engraver.cc | 8 +- lily/spanner.cc | 8 +- lily/{line-of-score.cc => system.cc} | 44 ++++--- lily/translator-group.cc | 10 ++ ly/engraver-init.ly | 14 +- ly/params-init.ly | 3 +- ly/property-init.ly | 58 ++++++++- make/out/lilypond.lsm | 8 +- make/out/lilypond.mandrake.spec | 2 +- make/out/lilypond.redhat.spec | 4 +- make/out/lilypond.suse.spec | 4 +- ps/lilyponddefs.ps | 2 +- scm/grob-description.scm | 12 +- scm/molecule.scm | 32 +++++ scm/ps.scm | 2 +- scm/translator-property-description.scm | 15 ++- tex/lilyponddefs.tex | 8 +- 44 files changed, 527 insertions(+), 205 deletions(-) create mode 100644 input/regression/accidental-voice.ly create mode 100644 input/regression/system-extents.ly rename lily/{line-of-score.cc => system.cc} (93%) diff --git a/AUTHORS.txt b/AUTHORS.txt index 13884f19c6..e3dc690523 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -86,5 +86,5 @@ list is alphabetically ordered. * August S.Sigov Russian translation * Rune Zedeler Drum notation, beaming and - accidental fixes + auto-accidental changes. Font updates. Misc fixes. diff --git a/ChangeLog b/ChangeLog index 9b01d18456..5432c20c49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +2002-03-21 Han-Wen + + * VERSION: 1.5.45 released + + * input/regression/system-extents.ly: new regression test. Test + System extents. + + * lily/system.cc: rename LineOfScore into System + + * lily/molecule.cc (ly_add_molecule): new Scheme ly-add-molecule. + + * lily/grob.cc (ly_get_parent): new Scheme function ly-get-parent. + (ly_get_extent): new Scheme function ly-get-extent + + * ps/lilyponddefs.ps: use output-scale for line-x + definition. + + * scm/ps.scm (font-load-command): + use output-scale + +2002-03-20 Rune Zedeler + + * lily/beaming-info.cc: Stupid typo fixed + + * lily/accidental-engraver.cc: rewrote accidental-routines to get + support for cross-context auto-accidentals. + Now the engraver can stay in Staff-context and see other contexts + from there. + Changed properties: autoAccidentals, autoCautionaries + + * lily/translator-group.cc (set_children_property): + Function added recursively setting the same property (deep_copied) + for all children of a Translator_group. + + * ly/property-init.ly: added commands + \pianoAccidentals \voiceAccidentals + \modernVoiceAccidentals \modernVoiceCautionaries + + * ly/engraver-init.ly: Correct initialization of new accidentals. + + * scm/translator-property-description.scm: Updated + + * input/regression/accidental-voice.ly: Added + + * Documentation/regression-test.tely: Added new test + 2002-03-19 Han-Wen Nienhuys * VERSION: 1.5.44 released diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index d35558ed0d..ee9a1fdb41 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -53,6 +53,8 @@ Accidentals are currently in a development stage. @lilypondfile[printfilename]{accidental-octave.ly} +@lilypondfile[printfilename]{accidental-voice.ly} + @section Stems @@ -304,6 +306,8 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{font-magnification.ly} +@lilypondfile[printfilename]{system-extents.ly} + @lilypondfile[printfilename,nofragment]{size11.ly} @lilypondfile[printfilename,nofragment]{size13.ly} diff --git a/Documentation/topdocs/AUTHORS.texi b/Documentation/topdocs/AUTHORS.texi index f7d94f655c..e57ae509ac 100644 --- a/Documentation/topdocs/AUTHORS.texi +++ b/Documentation/topdocs/AUTHORS.texi @@ -86,7 +86,7 @@ list is alphabetically ordered. @item @email{august@@infran.ru, August S.Sigov} Russian translation @item @email{rune@@zedeler.dk, Rune Zedeler} - Drum notation, beaming and accidental fixes + Drum notation, beaming and auto-accidental changes. Font updates. Misc fixes. @end itemize @bye diff --git a/VERSION b/VERSION index 0d14b138fc..22c74e010d 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 -PATCH_LEVEL=44 +PATCH_LEVEL=45 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/baerenreiter-sarabande.ly b/input/baerenreiter-sarabande.ly index 1a529b1a9c..262ef28ca6 100644 --- a/input/baerenreiter-sarabande.ly +++ b/input/baerenreiter-sarabande.ly @@ -8,24 +8,25 @@ editor = "August Wenzinger" source= "B\\\"arenreiter Urtext" - texidoc = "The B\\\"arenreiter edition of the Cello Suites is the most -beautifully typeset piece of music in our collection of music (we both -own one. It is also lovely on French Horn). This piece follows the -same beaming as the printed edition. This is done in order to -benchmarkk the quality of the LilyPond output. As of lilypond 1.5.38, -the spacing is almost identical. With a line-break forced before -measure 25, we get back the linebreaking of Baerenreiter. - - - -This file used to show spacing weaknesses. Now it shows weaknesses in -slur handling. - -Note that the Barenreiter edition contains an engraving mistake. The -second line begins with measure 6 (but prints 5). - -" - + texidoc = "The B\\\"arenreiter edition of the Cello Suites is the +most beautifully typeset piece of music in our collection of music (we +both own one. It is also lovely on French Horn). This piece does not +include articulation, but it does follows the same beaming and +linebreaking as the printed edition. This is done in order to +benchmark the quality of the LilyPond output. + +As of lilypond 1.5.42, the spacing and beam quanting is almost +identical. + +There are two tweaks in this file: a line-break was forced before +measure 25, we get back the linebreaking of Baerenreiter. The stem +direction is forced in measure 24. The last beam of that measure is up +in Baerenreiter because of context. We don't detect that yet. + +Note that the Barenreiter edition contains a few engraving +mistakes. The second line begins with measure 6 (but prints 5). The |: +half way in measure 13 has been forgotten. + " } @@ -51,7 +52,7 @@ sarabandeA = \context Voice \notes \relative c { g8 bes16()a c()bes a()g d'8 f, | < e4.-\trill - \\ > + \\ > [d8 c bes] %%8 < { f'8 g16()a a4. g16()f | @@ -69,9 +70,7 @@ sarabandeA = \context Voice \notes \relative c { fis8.-\trill es16 d8 c | [bes g'] - \stemUp [a, fis'] - \stemBoth [es' d] | %%16 < bes4.-\trill d, g, > [a8 g f!] | diff --git a/input/regression/accidental-octave.ly b/input/regression/accidental-octave.ly index 11962c970e..f9bdb98024 100644 --- a/input/regression/accidental-octave.ly +++ b/input/regression/accidental-octave.ly @@ -1,8 +1,9 @@ -\version "1.5.24.rz2" +\version "1.5.43.rz1" \header { texidoc=" This shows how accidentals in different octaves are handled. +Fixme: Shorten and docu " } @@ -47,14 +48,14 @@ mel = \notes \transpose c'' { mus = \notes { \mel \property Score.oneMeasureLazy = ##t - \property Score.autoAccidentals = #'((measure-same-octave . 0)) - < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 0))" \mel > - \property Score.autoAccidentals = #'((measure-same-octave . 1)) - < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 1))" \mel > - \property Score.autoAccidentals = #'((measure-any-octave . 0)) - < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 0))" \mel > - \property Score.autoAccidentals = #'((measure-any-octave . 1)) - < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 1))" \mel > + \property Score.autoAccidentals = #'(Staff (same-octave . 0)) + < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 0))" \mel > + \property Score.autoAccidentals = #'(Staff (same-octave . 1)) + < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (same-octave . 1))" \mel > + \property Score.autoAccidentals = #'(Staff (any-octave . 0)) + < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 0))" \mel > + \property Score.autoAccidentals = #'(Staff (any-octave . 1)) + < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff (any-octave . 1))" \mel > \modernAccidentals < s1^""^""^"$\\backslash$modernAccidentals" \mel > \modernCautionaries diff --git a/input/regression/accidental-voice.ly b/input/regression/accidental-voice.ly new file mode 100644 index 0000000000..18ff73984b --- /dev/null +++ b/input/regression/accidental-voice.ly @@ -0,0 +1,60 @@ +\version "1.5.43.rz1" + +\header{ +texidoc=" +This shows how modern cross voice auto cautionary accidentals are handled. +The first two fisses get accidentals because they belong to different voices. +The first f gets cautionary natural because of previous measure. +The last f gets cautionary natural because fis was only in the other voice. +" +} + +#(define (lo-octave p) + (let* ((a (pitch-alteration p)) + (n (pitch-notename p))) + (make-pitch -1 n a))) + +#(define (no-octaves music) + (let* ((es (ly-get-mus-property music 'elements)) + (e (ly-get-mus-property music 'element)) + (p (ly-get-mus-property music 'pitch))) + + (if (pair? es) + (ly-set-mus-property + music 'elements + (map no-octaves es))) + + (if (music? e) + (ly-set-mus-property + music 'element + (no-octaves e))) + + (if (pitch? p) + (begin + (set! p (lo-octave p)) + (ly-set-mus-property music 'pitch p))) + + + music)) + +voicea = \notes \transpose c'' { + \stemUp + fis2 a2 f4 fis a2 +} +voiceb = \notes \transpose c'' { + \stemDown + c2 fis2 f4 c f2 +} + +\score { + < + \notes + \context NoteNames=namesa \apply #no-octaves \voicea + \context Staff < + \modernVoiceCautionaries + \context Voice = voicea \voicea + \context Voice = voiceb \voiceb + > + \context NoteNames=namesb \apply #no-octaves \voiceb + > +} diff --git a/input/regression/accidentals.ly b/input/regression/accidentals.ly index 71a534d1b4..42b957eac0 100644 --- a/input/regression/accidentals.ly +++ b/input/regression/accidentals.ly @@ -1,4 +1,4 @@ -\version "1.5.24.rz2" +\version "1.5.43.rz1" \header{ texidoc=" @@ -45,14 +45,14 @@ mel = \notes { \key d \major \time 4/4 \context Staff \transpose c''' { \mel \property Score.oneMeasureLazy = ##t - \property Score.autoAccidentals = #'((measure-same-octave . 0)) - < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 0))" \mel > - \property Score.autoAccidentals = #'((measure-same-octave . 1)) - < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-same-octave . 1))" \mel > - \property Score.autoAccidentals = #'((measure-any-octave . 0)) - < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 0))" \mel > - \property Score.autoAccidentals = #'((measure-any-octave . 1)) - < s1^"$\\backslash$property Score.autoAccidentals = \\#'((measure-any-octave . 1))" \mel > + \property Score.autoAccidentals = #'(Staff (same-octave . 0)) + < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 0))" \mel > + \property Score.autoAccidentals = #'(Staff (same-octave . 1)) + < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 1))" \mel > + \property Score.autoAccidentals = #'(Staff (any-octave . 0)) + < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 0))" \mel > + \property Score.autoAccidentals = #'(Staff (any-octave . 1)) + < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 1))" \mel > \modernAccidentals < s1^"$\\backslash$modernAccidentals" \mel > \modernCautionaries diff --git a/input/regression/system-extents.ly b/input/regression/system-extents.ly new file mode 100644 index 0000000000..3d6ec4a3d1 --- /dev/null +++ b/input/regression/system-extents.ly @@ -0,0 +1,20 @@ +\header { + + texidoc = "LilyPond correctly determines the size of every + system. This includes postscript constructs such as slurs." + + } + +\score { \notes +\context Voice +{\slurDown c4 ( g4 ) c''4 + +} + + \paper { + \translator { + \ScoreContext + System \override #'molecule-callback = #box-grob-molecule + } + } +} diff --git a/input/test/boxed-molecule.ly b/input/test/boxed-molecule.ly index 0aeb856200..b45f6cfb86 100644 --- a/input/test/boxed-molecule.ly +++ b/input/test/boxed-molecule.ly @@ -11,18 +11,6 @@ texidoc = "overriding the molecule callback can also be used to draw a " } -#(define (box-molecule xext yext) - (ly-make-molecule - (list 'filledbox (- (car xext)) (cdr xext) - (- (car yext)) (cdr yext)) - xext yext) -) - -#(define (widen-interval iv amount) - (cons (- (car iv) amount) - (+ (cdr iv) amount)) -) - #(define (make-molecule-boxer callback) (define (molecule-boxer grob) (let* diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 14dd955cd3..5b476a05cb 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -2,7 +2,7 @@ accidental-engraver.cc -- implement accidental_engraver (c) 1997--2002 Han-Wen Nienhuys - Modified 2001 by Rune Zedeler + Modified 2001-2002 by Rune Zedeler */ #include "musical-request.hh" @@ -19,6 +19,8 @@ #include "arpeggio.hh" #include "warn.hh" +#include "translator-group.hh" + /** @@ -43,7 +45,7 @@ protected: virtual void finalize (); public: - // todo -> property + // todo -> property (why? -rz) SCM last_keysig_; /* @@ -56,6 +58,7 @@ public: Link_array head_l_arr_; Link_array forced_l_arr_; Link_array tie_l_arr_; + Link_array origin_l_arr_; }; @@ -70,14 +73,22 @@ void Accidental_engraver::initialize () { last_keysig_ = get_property ("keySignature"); - daddy_trans_l_->set_property ("localKeySignature", last_keysig_); + + Translator_group * trans_ = daddy_trans_l_; + while (trans_) { + trans_ -> set_property ("localKeySignature", ly_deep_copy(last_keysig_)); + trans_ = trans_->daddy_trans_l_; + } + daddy_trans_l_->set_children_property("localKeySignature",last_keysig_); + } /** calculates the number of accidentals on basis of the current local key sig - * (passed as argument). + * (passed as argument) * Returns number of accidentals (0, 1 or 2). * Negative (-1 or -2) if accidental has changed. **/ +// FIXME: Use references for SCM-values static int number_accidentals (SCM sig, Note_req * note_l, SCM curbarnum, SCM lazyness, bool ignore_octave_b) @@ -114,31 +125,46 @@ number_accidentals (SCM sig, Note_req * note_l, SCM curbarnum, SCM lazyness, return a==p ? num : -num; } -static int -number_accidentals (SCM localsig, Note_req * note_l, SCM accidentals_l, - SCM curbarnum) { +int +number_accidentals (Note_req * note_l, Translator_group * origin_l, + SCM accidentals_sl, SCM curbarnum_s) { int number=0; int diff=0; - while(gh_pair_p(accidentals_l)) { - if(gh_pair_p(ly_car(accidentals_l))) { - SCM type = gh_caar(accidentals_l); - SCM lazyness = gh_cdar(accidentals_l); - bool measure_same_octave_b = - gh_eq_p(ly_symbol2scm("measure-same-octave"),type); - bool measure_any_octave_b = - gh_eq_p(ly_symbol2scm("measure-any-octave"),type); - if(measure_same_octave_b || measure_any_octave_b) { + if(gh_pair_p(accidentals_sl) && !gh_symbol_p(ly_car(accidentals_sl))) + warning(_f("Accidental typesetting list must begin with context-name: %s", + ly_scm2string(ly_car(accidentals_sl)).ch_C())); + while(gh_pair_p(accidentals_sl) && origin_l) { + // If pair then it is a new accidentals typesetting rule to be checked + if(gh_pair_p(ly_car(accidentals_sl))) { + SCM type = gh_caar(accidentals_sl); + SCM lazyness = gh_cdar(accidentals_sl); + SCM localsig = origin_l->get_property ("localKeySignature"); + bool same_octave_b = + gh_eq_p(ly_symbol2scm("same-octave"),type); + bool any_octave_b = + gh_eq_p(ly_symbol2scm("any-octave"),type); + if(same_octave_b || any_octave_b) { int n = number_accidentals - (localsig,note_l,curbarnum,lazyness,measure_any_octave_b); + (localsig,note_l,curbarnum_s,lazyness,any_octave_b); diff |= n<0; number = max(number,abs(n)); } - else warning(_f("unknown accidental typesetting: %s", + else warning(_f("unknown accidental typesetting: %s. Ignored", ly_symbol2string(type).ch_C())); } - else warning(_f("Accidental typesetting must be pair: %s", - ly_scm2string(ly_car(accidentals_l)).ch_C())); - accidentals_l = ly_cdr(accidentals_l); + // if symbol then it is a context name. Scan parent contexts to find it. + else if (gh_symbol_p(ly_car(accidentals_sl))) { + String context = ly_symbol2string(ly_car(accidentals_sl)); + while (origin_l && !origin_l->is_alias_b(context)) { + origin_l = origin_l->daddy_trans_l_; + } + if (!origin_l) + warning(_f("Symbol is not a parent context: %s. Ignored", + context.ch_C())); + } + else warning(_f("Accidental typesetting must be pair or context-name: %s", + ly_scm2string(ly_car(accidentals_sl)).ch_C())); + accidentals_sl = ly_cdr(accidentals_sl); } return diff ? -number : number; } @@ -148,9 +174,9 @@ Accidental_engraver::create_grobs () { if (!key_item_p_ && mel_l_arr_.size ()) { - SCM localsig = get_property ("localKeySignature"); - SCM accidentals_l = get_property ("autoAccidentals"); - SCM cautionaries_l = get_property ("autoCautionaries"); + //SCM localsig = get_property ("localKeySignature"); + SCM accidentals_sl = get_property ("autoAccidentals"); + SCM cautionaries_sl = get_property ("autoCautionaries"); SCM barnum = get_property ("currentBarNumber"); bool extra_natural_b = get_property ("extraNatural")==SCM_BOOL_T; @@ -158,9 +184,10 @@ Accidental_engraver::create_grobs () { Grob * support_l = head_l_arr_[i]; Note_req * note_l = mel_l_arr_[i]; + Translator_group * origin_l = origin_l_arr_[i]; - int num = number_accidentals(localsig,note_l,accidentals_l,barnum); - int num_caut = number_accidentals(localsig,note_l,cautionaries_l,barnum); + int num = number_accidentals(note_l,origin_l,accidentals_sl,barnum); + int num_caut = number_accidentals(note_l,origin_l,cautionaries_sl,barnum); bool cautionary = to_boolean (note_l->get_mus_property ("cautionary")); if (abs(num_caut)>abs(num)) { @@ -178,8 +205,8 @@ Accidental_engraver::create_grobs () Grob *tie_break_reminder = 0; bool tie_changes = false; - for (int i=0; i < tie_l_arr_.size (); i++) - if (support_l == Tie::head (tie_l_arr_[i], RIGHT)) + for (int j=0; j < tie_l_arr_.size (); j++) + if (support_l == Tie::head (tie_l_arr_[j], RIGHT)) { tie_changes = different; /* Enable accidentals for broken tie @@ -189,7 +216,7 @@ Accidental_engraver::create_grobs () Maybe check property noTieBreakForceAccidental? */ if (different) - tie_break_reminder = tie_l_arr_[i]; + tie_break_reminder = tie_l_arr_[j]; break; } @@ -231,30 +258,40 @@ Accidental_engraver::create_grobs () int n = pitch->notename_i_; int o = pitch->octave_i_; int a = pitch->alteration_i_; - SCM on = gh_cons (gh_int2scm (o), gh_int2scm (n)); - if (tie_changes) - { - /* - Remember an alteration that is different both from - that of the tied note and of the key signature. - */ - localsig = ly_assoc_front_x - (localsig, on, gh_cons(SCM_BOOL_T,barnum)); - } - else - { - /* - not really really correct if there are more than one - noteheads with the same notename. - */ - localsig = ly_assoc_front_x - (localsig, on, gh_cons(gh_int2scm (a),barnum)); - } - } - - daddy_trans_l_->set_property ("localKeySignature", localsig); + SCM on_s = gh_cons (gh_int2scm (o), gh_int2scm (n)); + + /* + TODO: Speed this up! + Perhaps only check translators mentioned in the auto-accidentals? + -rz + */ + Translator_group * trans_ = origin_l_arr_[i]; + while (trans_) { + SCM localsig = trans_->get_property ("localKeySignature"); + if (tie_changes) + { + /* + Remember an alteration that is different both from + that of the tied note and of the key signature. + */ + localsig = ly_assoc_front_x + (localsig, on_s, gh_cons(SCM_BOOL_T,barnum)); + } + else + { + /* + not really really correct if there are more than one + noteheads with the same notename. + */ + localsig = ly_assoc_front_x + (localsig, on_s, gh_cons(gh_int2scm (a),barnum)); + } + trans_->set_property ("localKeySignature", localsig); + trans_ = trans_->daddy_trans_l_; + } + } } - + if (key_item_p_) { @@ -293,7 +330,8 @@ Accidental_engraver::stop_translation_timestep () arpeggios_.clear (); tie_l_arr_.clear (); head_l_arr_.clear (); - forced_l_arr_.clear (); + forced_l_arr_.clear (); + origin_l_arr_.clear (); } void @@ -305,6 +343,7 @@ Accidental_engraver::acknowledge_grob (Grob_info info) { mel_l_arr_.push (note_l); head_l_arr_.push (info.grob_l_); + origin_l_arr_.push (info.origin_trans_l_->daddy_trans_l_); } else if (Tie::has_interface (info.grob_l_)) { @@ -327,12 +366,19 @@ Accidental_engraver::process_music () SCM sig = get_property ("keySignature"); - /* Detect key sig changes. */ - if (last_keysig_ != sig) - { - daddy_trans_l_->set_property ("localKeySignature", ly_deep_copy (sig)); - last_keysig_ = sig; + /* Detect key sig changes. + Update all parents and children + */ + if (last_keysig_ != sig) { + Translator_group * trans_ = daddy_trans_l_; + while (trans_) { + trans_ -> set_property ("localKeySignature", ly_deep_copy(sig)); + trans_ = trans_->daddy_trans_l_; } + daddy_trans_l_->set_children_property("localKeySignature",sig); + + last_keysig_ = sig; + } } @@ -340,6 +386,7 @@ Accidental_engraver::process_music () ENTER_DESCRIPTION(Accidental_engraver, +/* The FIXME below is deprecated and should be removed. -rz */ /* descr */ "Make accidentals. Catches note heads, ties and notices key-change events. Due to interaction with ties (which don't come together with note heads), this needs to be in a context higher than Tie_engraver. FIXME", diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index c9751f049b..35ba768395 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -38,7 +38,7 @@ Beaming_info_list::best_splitpoint_index (Moment &beat_length,bool subdivide) co beat_pos = infos_[i].start_mom_ / beat_length; int den = beat_pos.den (); if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && !subdivide) - den *= 4; + den *= 2; if (den < minden) { minidx = i; diff --git a/lily/grob.cc b/lily/grob.cc index c6088ff5f1..94758b7990 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -151,7 +151,7 @@ Grob::remove_grob_property (const char* key) /* Puts the k, v in the immutable_property_alist_, which is convenient for storing variables that are needed during the breaking process. (eg. - Line_of_score::rank : int) + System::rank : int) */ void Grob::set_immutable_grob_property (const char*k, SCM v) @@ -331,7 +331,7 @@ Grob::do_break_processing () -Line_of_score * +System * Grob::line_l () const { return 0; @@ -379,8 +379,8 @@ Grob::handle_broken_grobs (SCM src, SCM criterion) } else { - Line_of_score * line - = dynamic_cast (unsmob_grob (criterion)); + System * line + = dynamic_cast (unsmob_grob (criterion)); if (sc->line_l () != line) { sc = sc->find_broken_piece (line); @@ -452,7 +452,7 @@ Grob::handle_broken_dependencies () for (int i = 0; i< s->broken_into_l_arr_ .size (); i++) { Grob * sc = s->broken_into_l_arr_[i]; - Line_of_score * l = sc->line_l (); + System * l = sc->line_l (); sc->mutable_property_alist_ = handle_broken_grobs (mutable_property_alist_, l ? l->self_scm () : SCM_UNDEFINED); @@ -460,7 +460,7 @@ Grob::handle_broken_dependencies () } - Line_of_score *line = line_l (); + System *line = line_l (); if (line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS)) { @@ -468,7 +468,7 @@ Grob::handle_broken_dependencies () = handle_broken_grobs (mutable_property_alist_, line ? line->self_scm () : SCM_UNDEFINED); } - else if (dynamic_cast (this)) + else if (dynamic_cast (this)) { mutable_property_alist_ = handle_broken_grobs (mutable_property_alist_, SCM_UNDEFINED); @@ -479,7 +479,7 @@ Grob::handle_broken_dependencies () This element is `invalid'; it has been removed from all dependencies, so let's junk the element itself. - do not do this for Line_of_score, since that would remove + do not do this for System, since that would remove references to the originals of score-elts, which get then GC'd (a bad thing.) */ @@ -514,7 +514,7 @@ Grob::handle_prebroken_dependencies () } Grob* -Grob::find_broken_piece (Line_of_score*) const +Grob::find_broken_piece (System*) const { return 0; } @@ -886,6 +886,30 @@ ly_get_paper_var (SCM grob, SCM sym) +SCM +ly_get_extent (SCM grob, SCM refp, SCM axis) +{ + Grob * sc = unsmob_grob (grob); + Grob * ref = unsmob_grob (refp); + SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob"); + SCM_ASSERT_TYPE(ref, refp, SCM_ARG2, __FUNCTION__, "grob"); + + SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG3, __FUNCTION__, "axis"); + + return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis)))); +} + +SCM +ly_get_parent (SCM grob, SCM axis) +{ + Grob * sc = unsmob_grob (grob); + SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob"); + SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis"); + + return sc->get_parent (Axis (gh_scm2int (axis)))->self_scm(); +} + + static void init_functions () { @@ -895,8 +919,10 @@ init_functions () (Scheme_function_unknown)ly_set_grob_property); scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound); - scm_c_define_gsubr ("ly-get-paper-variable", 2 , 0, 0, - (Scheme_function_unknown) ly_get_paper_var); + scm_c_define_gsubr ("ly-get-extent", 3, 0, 0, + (Scheme_function_unknown) ly_get_extent); + scm_c_define_gsubr ("ly-get-parent", 2, 0, 0, + (Scheme_function_unknown) ly_get_parent); } bool diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 98c0b7ae82..028f5a14b7 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -89,7 +89,7 @@ public: add a dependency. It may be the 0 pointer, in which case, it is ignored. */ void add_dependency (Grob*); - virtual Line_of_score * line_l () const; + virtual System * line_l () const; bool linked_b () const; @@ -107,7 +107,7 @@ public: static SCM handle_broken_grobs(SCM, SCM criterion); virtual void do_break_processing (); - virtual Grob *find_broken_piece (Line_of_score*) const; + virtual Grob *find_broken_piece (System*) const; virtual void discretionary_processing (); virtual SCM do_derived_mark (); diff --git a/lily/include/item.hh b/lily/include/item.hh index 6c4aa91bba..77fd2be900 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -36,9 +36,9 @@ public: Direction break_status_dir () const; Item * find_prebroken_piece (Direction) const; - Grob * find_broken_piece (Line_of_score*) const; + Grob * find_broken_piece (System*) const; - virtual Line_of_score * line_l () const; + virtual System * line_l () const; virtual Paper_column * column_l () const; virtual void handle_prebroken_dependencies (); protected: diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index b5451eb06f..e250a6a7ef 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -75,7 +75,7 @@ class Key_performer; class Keyword_ent; class Keyword_table; class Line_group_engraver_group; -class Line_of_score; +class System; class Local_key_item; class Lookup; class Lyric_combine_music; diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh index 61a755e347..4ff07730ef 100644 --- a/lily/include/line-of-score.hh +++ b/lily/include/line-of-score.hh @@ -11,13 +11,13 @@ #include "column-x-positions.hh" #include "spanner.hh" -class Line_of_score : public Spanner +class System : public Spanner { public: int rank_i_; void post_processing (bool); - Line_of_score (SCM); + System (SCM); /// is #c# contained in #*this#? bool contains_b (Paper_column const *c) const; int element_count () const; diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index 59e2c797df..ed850c4e24 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -22,10 +22,10 @@ public: int rank_i_; virtual void do_break_processing (); virtual Paper_column *column_l () const; - virtual Line_of_score *line_l () const; + virtual System *line_l () const; /// if lines are broken then this column is in #line# - Line_of_score *line_l_; + System *line_l_; static int rank_i (Grob*); diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index 2e238c4807..940a4fb62b 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -28,7 +28,7 @@ public: Paper_def *paper_l_; Paper_outputter *outputter_l_; - Line_of_score * line_l_; + System * line_l_; Paper_score (); @@ -38,7 +38,7 @@ public: int find_col_idx (Paper_column const *) const; Link_array broken_col_range (Item const*,Item const*) const; - void typeset_line (Line_of_score*); + void typeset_line (System*); protected: /* MAIN ROUTINES */ diff --git a/lily/include/score-engraver.hh b/lily/include/score-engraver.hh index 7bad0008a6..0f0218ddc8 100644 --- a/lily/include/score-engraver.hh +++ b/lily/include/score-engraver.hh @@ -19,7 +19,7 @@ class Score_engraver : public Engraver_group_engraver, public Global_translator { - Line_of_score * scoreline_l_; + System * scoreline_l_; int breaks_i_; Link_array elem_p_arr_; diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index e2b4a2a1bb..ebf5af6a86 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -52,14 +52,14 @@ public: Real spanner_length () const; static int compare (Spanner * const &,Spanner * const &); - virtual Grob* find_broken_piece (Line_of_score*) const; + virtual Grob* find_broken_piece (System*) const; virtual SCM do_derived_mark (); protected: void set_my_columns (); VIRTUAL_COPY_CONS (Grob); virtual void do_break_processing (); - virtual Line_of_score*line_l () const; + virtual System*line_l () const; }; diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 74a3490d3c..1b7069e740 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -20,6 +20,7 @@ // egcs typedef void (Translator::*Method_pointer) (void); #define set_property(x,y) internal_set_property(ly_symbol2scm(x),y) +#define set_children_property(x,y) internal_set_children_property(ly_symbol2scm(x),y) class Scheme_hash_table; @@ -43,6 +44,7 @@ public: void unset_property (SCM var_sym); void internal_set_property (SCM var_sym, SCM value); + void internal_set_children_property (SCM var_sym, SCM value); Translator_group *where_defined (SCM name_sym) const; String id_str_; diff --git a/lily/item.cc b/lily/item.cc index b07210f8bc..2d161192f6 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -51,7 +51,7 @@ Item::column_l () const return parent ? parent->column_l () : 0; } -Line_of_score * +System * Item::line_l () const { Grob *g = get_parent (X_AXIS); @@ -97,7 +97,7 @@ Item::discretionary_processing () } Grob* -Item::find_broken_piece (Line_of_score*l) const +Item::find_broken_piece (System*l) const { if (line_l () == l) return (Item*) (this); diff --git a/lily/molecule.cc b/lily/molecule.cc index 634ec726bd..4efdcfaf1d 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -184,6 +184,22 @@ Molecule::ly_molecule_combined_at_edge (SCM first, SCM axis, SCM direction, return result.smobbed_copy (); } +SCM +ly_add_molecule (SCM first, SCM second) +{ + Molecule * m1 = unsmob_molecule (first); + Molecule * m2 = unsmob_molecule (second); + Molecule result; + + + if (m1) + result = *m1; + if (m2) + result.add_molecule (*m2); + + return result.smobbed_copy (); +} + SCM make_molecule (SCM expr, SCM xext, SCM yext) @@ -232,7 +248,8 @@ molecule_init () { scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule); scm_c_define_gsubr ("ly-fontify-atom", 2, 0, 0, (Scheme_function_unknown) ly_fontify_atom); - scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x); + scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x); + scm_c_define_gsubr ("ly-add-molecule", 2, 0,0,(Scheme_function_unknown) ly_add_molecule); scm_c_define_gsubr ("ly-combine-molecule-at-edge", 5 , 0, 0, (Scheme_function_unknown) Molecule::ly_molecule_combined_at_edge); scm_c_define_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x); scm_c_define_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 7296041000..3f7d17a400 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -20,7 +20,7 @@ /* Paper_columns form the top-most item parent. (The Paper_columns X - parent is Line_of_score, which is a spanner.) + parent is System, which is a spanner.) Paper_columns form the units for the spacing engine. They are numbered, the first (leftmost) is column 0. Numbering happens before @@ -45,7 +45,7 @@ Paper_column::rank_i (Grob*me) return dynamic_cast (me)->rank_i_; } -Line_of_score* +System* Paper_column::line_l () const { return line_l_; diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 7971743be4..2154b40bf5 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -31,7 +31,7 @@ Paper_score::Paper_score () } void -Paper_score::typeset_line (Line_of_score *l) +Paper_score::typeset_line (System *l) { if (!line_l_) { diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 690b05af26..899b1d0208 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -90,9 +90,9 @@ Score_engraver::initialize () pscore_p_ = new Paper_score; pscore_p_->paper_l_ = dynamic_cast (output_def_l_); - SCM props = get_property ("LineOfScore"); + SCM props = get_property ("System"); - pscore_p_->typeset_line (new Line_of_score (props)); + pscore_p_->typeset_line (new System (props)); make_columns (); scoreline_l_ = pscore_p_->line_l_; @@ -303,7 +303,7 @@ Score_engraver::acknowledge_grob (Grob_info gi) ENTER_DESCRIPTION(Score_engraver, -/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. LineOfScore) +/* descr */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) This engraver decides whether a column is breakable. The default is @@ -315,7 +315,7 @@ that there are no beams or notes that prevent a breakpoint.) ", -/* creats*/ "LineOfScore PaperColumn NonMusicalPaperColumn", +/* creats*/ "System PaperColumn NonMusicalPaperColumn", /* acks */ "note-spacing-interface staff-spacing-interface", /* reads */ "currentMusicalColumn currentCommandColumn", /* write */ ""); diff --git a/lily/spanner.cc b/lily/spanner.cc index bc8cb45a09..0b6573dd72 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -173,9 +173,9 @@ Spanner::set_bound (Direction d, Grob*s) spanned_drul_[d] =i; /** - We check for Line_of_score to prevent the column -> line_of_score + We check for System to prevent the column -> line_of_score -> column -> line_of_score -> etc situation */ - if (d== LEFT && !dynamic_cast (this)) + if (d== LEFT && !dynamic_cast (this)) { set_parent (i, X_AXIS); } @@ -219,7 +219,7 @@ Spanner::spanner_length () const return r-l; } -Line_of_score * +System * Spanner::line_l () const { if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT]) @@ -231,7 +231,7 @@ Spanner::line_l () const Grob* -Spanner::find_broken_piece (Line_of_score*l) const +Spanner::find_broken_piece (System*l) const { int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare); diff --git a/lily/line-of-score.cc b/lily/system.cc similarity index 93% rename from lily/line-of-score.cc rename to lily/system.cc index c65b9ac44c..3405d68f28 100644 --- a/lily/line-of-score.cc +++ b/lily/system.cc @@ -1,5 +1,5 @@ /* - scoreline.cc -- implement Line_of_score + system.cc -- implement System source file of the GNU LilyPond music typesetter @@ -32,7 +32,7 @@ fixup_refpoints (SCM s) } -Line_of_score::Line_of_score (SCM s) +System::System (SCM s) : Spanner (s) { rank_i_ = 0; @@ -42,13 +42,13 @@ Line_of_score::Line_of_score (SCM s) } int -Line_of_score::element_count () const +System::element_count () const { return scm_ilength (get_grob_property ("all-elements")); } void -Line_of_score::typeset_grob (Grob * elem_p) +System::typeset_grob (Grob * elem_p) { elem_p->pscore_l_ = pscore_l_; Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"),elem_p); @@ -56,7 +56,7 @@ Line_of_score::typeset_grob (Grob * elem_p) } void -Line_of_score::output_lines () +System::output_lines () { for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) @@ -98,7 +98,7 @@ Line_of_score::output_lines () for (int i=0; i < broken_into_l_arr_.size (); i++) { - Line_of_score *line_l = dynamic_cast (broken_into_l_arr_[i]); + System *line_l = dynamic_cast (broken_into_l_arr_[i]); if (verbose_global_b) progress_indication ("["); @@ -134,7 +134,7 @@ Line_of_score::output_lines () Find the loose columns in POSNS, and drape them around the columns specified in BETWEEN-COLS. */ void -set_loose_columns (Line_of_score* which, Column_x_positions const *posns) +set_loose_columns (System* which, Column_x_positions const *posns) { for (int i = 0; i < posns->loose_cols_.size (); i++) { @@ -240,11 +240,11 @@ set_loose_columns (Line_of_score* which, Column_x_positions const *posns) // const? void -Line_of_score::break_into_pieces (Array const &breaking) +System::break_into_pieces (Array const &breaking) { for (int i=0; i < breaking.size (); i++) { - Line_of_score *line_l = dynamic_cast (clone ()); + System *line_l = dynamic_cast (clone ()); line_l->rank_i_ = i; // line_l->set_immutable_grob_property ("rank", gh_int2scm (i)); Link_array c (breaking[i].cols_); @@ -281,7 +281,7 @@ GLOBAL_SYMBOL (combine_sym , "combine-molecule"); void -Line_of_score::output_molecule (SCM expr, Offset o) +System::output_molecule (SCM expr, Offset o) { while (1) @@ -332,13 +332,13 @@ Line_of_score::output_molecule (SCM expr, Offset o) } void -Line_of_score::output_scheme (SCM s) +System::output_scheme (SCM s) { pscore_l_->outputter_l_->output_scheme (s); } void -Line_of_score::add_column (Paper_column*p) +System::add_column (Paper_column*p) { Grob *me = this; SCM cs = me->get_grob_property ("columns"); @@ -357,7 +357,7 @@ Line_of_score::add_column (Paper_column*p) TODO: use scm_map iso. for loops. */ void -Line_of_score::pre_processing () +System::pre_processing () { for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) unsmob_grob (ly_car (s))->discretionary_processing (); @@ -388,7 +388,7 @@ Line_of_score::pre_processing () } void -Line_of_score::post_processing (bool last_line) +System::post_processing (bool last_line) { for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) @@ -400,7 +400,7 @@ Line_of_score::post_processing (bool last_line) Interval i (extent (this, Y_AXIS)); if (i.empty_b ()) - programming_error ("Huh? Empty Line_of_score?"); + programming_error ("Huh? Empty System?"); else translate_axis (- i[MAX], Y_AXIS); @@ -415,6 +415,7 @@ Line_of_score::post_processing (bool last_line) generate all molecules to trigger all font loads. (ugh. This is not very memory efficient.) */ + this->get_molecule(); for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) { unsmob_grob (ly_car (s))->get_molecule (); @@ -436,6 +437,13 @@ Line_of_score::post_processing (bool last_line) /* Output elements in three layers, 0, 1, 2. The default layer is 1. */ + + { + Molecule *m = this->get_molecule(); + if (m) + output_molecule (m->get_expr (), Offset(0,0)); + } + for (int i = 0; i < 3; i++) for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) @@ -462,6 +470,8 @@ Line_of_score::post_processing (bool last_line) output_molecule (m->get_expr (), o); } + + if (last_line) { @@ -475,7 +485,7 @@ Line_of_score::post_processing (bool last_line) Link_array -Line_of_score::broken_col_range (Item const*l, Item const*r) const +System::broken_col_range (Item const*l, Item const*r) const { Link_array ret; @@ -507,7 +517,7 @@ Line_of_score::broken_col_range (Item const*l, Item const*r) const disrupt the spacing problem. */ Link_array -Line_of_score::column_l_arr ()const +System::column_l_arr ()const { Link_array acs = Pointer_group_interface__extract_grobs (this, (Grob*) 0, "columns"); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 2938b2b7cd..aee0c2309c 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -312,6 +312,16 @@ Translator_group::internal_set_property (SCM sym, SCM val) properties_dict ()->set (sym, val); } +void +Translator_group::internal_set_children_property (SCM sym, SCM val) +{ + internal_set_property (sym, val); + for (SCM p = trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) { + Translator_group *trg = dynamic_cast (unsmob_translator (ly_car (p))); + trg->internal_set_children_property(sym,ly_deep_copy(val)); + } +} + /* TODO: look up to check whether we have inherited var? */ diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 2db5d63839..ece2525443 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -38,6 +38,7 @@ StaffContext=\translator { MinimumVerticalExtent = #'(-4 . 4) ExtraVerticalExtent = ##f VerticalExtent = ##f + localKeySignature = #'() % explicitly set instrument, so we don't get % weird effects when doing instrument names for @@ -56,7 +57,8 @@ StaffContainerContext = \translator { MinimumVerticalExtent = ##f ExtraVerticalExtent = ##f VerticalExtent = ##f - + localKeySignature = #'() + \accepts Staff \name StaffContainer } @@ -67,6 +69,7 @@ InnerChoirStaffContext = \translator { alignmentReference = #0 \consists "System_start_delimiter_engraver" systemStartDelimiter = #'SystemStartBracket + localKeySignature = #'() \accepts "Staff" \accepts "RhythmicStaff" @@ -92,6 +95,7 @@ RhythmicStaffContext=\translator{ MinimumVerticalExtent = ##f ExtraVerticalExtent = ##f VerticalExtent = ##f + localKeySignature = #'() \consists "Pitch_squash_engraver" \consists "Separating_line_group_engraver" @@ -118,6 +122,7 @@ VoiceContext = \translator { \name Voice Generic_property_list = #generic-voice-properties + localKeySignature = #'() \consists "Font_size_engraver" % must come before all @@ -162,6 +167,7 @@ VoiceContext = \translator { ThreadContext = \translator{ \type Engraver_group_engraver \name Thread + localKeySignature = #'() \consists "Font_size_engraver" \consists "Thread_devnull_engraver" @@ -175,6 +181,7 @@ ThreadContext = \translator{ GrandStaffContext=\translator{ \type "Engraver_group_engraver" \name GrandStaff + localKeySignature = #'() \consists "Span_bar_engraver" \consists "Span_arpeggio_engraver" \consists "System_start_delimiter_engraver" @@ -186,6 +193,7 @@ GrandStaffContext=\translator{ PianoStaffContext = \translator{ \GrandStaffContext \name "PianoStaff" + \alias "GrandStaff" \consists "Vertical_align_engraver" \consists "Instrument_name_engraver" @@ -202,6 +210,7 @@ PianoStaffContext = \translator{ InnerStaffGroupContext= \translator { \type "Engraver_group_engraver" \name InnerStaffGroup + localKeySignature = #'() \consists "Span_bar_engraver" \consists "Span_arpeggio_engraver" @@ -323,6 +332,7 @@ HaraKiriStaffContext = \translator { ScoreContext = \translator { \type Score_engraver \name Score + localKeySignature = #'() \consists "Repeat_acknowledge_engraver" \consists "Staff_collecting_engraver" @@ -388,7 +398,7 @@ ScoreContext = \translator { subdivideBeams = ##f extraNatural = ##t - autoAccidentals = #'((measure-same-octave . 0)) + autoAccidentals = #'(Staff (same-octave . 0)) autoCautionaries = #'() diff --git a/ly/params-init.ly b/ly/params-init.ly index 5eb9d02646..e4c851f7eb 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -22,7 +22,8 @@ staffspace = \staffheight / 4.0 stafflinethickness = \staffspace / 10.0 outputscale = \staffheight / 4.0 -blotdiameter = 0.4 \pt +% blotdiameter = 0.4 \pt +blotdiameter = 0.04 \pt \translator { \NoteNamesContext } diff --git a/ly/property-init.ly b/ly/property-init.ly index 5601b73a33..c203bd6632 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -133,8 +133,17 @@ hideStaffSwitch = \property Voice.followVoice = ##f % accidentals as they were common in the 18th century. defaultAccidentals = { \property Score.extraNatural = ##t - \property Score.autoAccidentals = #'((measure-same-octave . 0)) - \property Score.autoCautionaries = #'() + \property Score.autoAccidentals = #'(Staff (same-octave . 0)) + \property Score.autoCautionaries = #'() +} + +% accidentals in voices instead of staves. +% Notice that accidentals from one voice do NOT get cancelled in other voices +voiceAccidentals = { + \property Score.extraNatural = ##t + \property Score.autoAccidentals = #'(Voice (same-octave . 0)) + \property Score.autoCautionaries = #'() + } % accidentals as suggested by Kurt Stone, Music Notation in the 20th century. @@ -142,22 +151,57 @@ defaultAccidentals = { % in other octaves and in the next measure. modernAccidentals = { \property Score.extraNatural = ##f - \property Score.autoAccidentals = #'((measure-same-octave . 0) (measure-any-octave . 0) (measure-any-octave . 1)) + \property Score.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)) \property Score.autoCautionaries = #'() } % the accidentals that Stone adds to the old standard as cautionaries modernCautionaries = { \property Score.extraNatural = ##f - \property Score.autoAccidentals = #'((measure-same-octave . 0)) - \property Score.autoCautionaries = #'((measure-any-octave . 0) (measure-any-octave . 1)) + \property Score.autoAccidentals = #'(Staff (same-octave . 0)) + \property Score.autoCautionaries = #'(Staff (any-octave . 0) (any-octave . 1)) +} + +% Multivoice accidentals to be read both by musicians playing one voice +% and musicians playing all voices. +% Accidentals are typeset for each voice, but they ARE cancelled across voices. +modernVoiceAccidentals = { + \property Staff.extraNatural = ##f + \property Staff.autoAccidentals = #'( + Voice (same-octave . 0) (any-octave . 0) (any-octave . 1) + Staff (same-octave . 0) (any-octave . 0) (any-octave . 1) + ) + \property Staff.autoCautionaries = #'() +} + +% same as modernVoiceAccidental eccept that all special accidentals are typeset +% as cautionaries +modernVoiceCautionaries = { + \property Staff.extraNatural = ##f + \property Staff.autoAccidentals = #'( + Voice (same-octave . 0) + ) + \property Staff.autoCautionaries = #'( + Voice (any-octave . 0) (any-octave . 1) + Staff (same-octave . 0) (any-octave . 0) (any-octave . 1) + ) +} + +% stone's suggestions for accidentals on grand staff. +% Accidentals are cancelled across the staves in the same grand staff as well +pianoAccidentals = { + \property GrandStaff.autoAccidentals = #'( + Staff (same-octave . 0) (any-octave . 0) (any-octave . 1) + GrandStaff (any-octave . 1) + ) + \property GrandStaff.autoCautionaries = #'() } % Do not reset the key at the start of a measure. Accidentals will be % printed only once and are in effect until overridden, possibly many % measures later. noResetKey = { - \property Score.autoAccidentals = #'((measure-same-octave . #t)) + \property Score.autoAccidentals = #'(Staff (same-octave . #t)) \property Score.autoCautionaries = #'() } @@ -167,7 +211,7 @@ noResetKey = { % remembered for the duration of a measure. % accidentals not being remembered, causing accidentals always to be typeset relative to the time signature forgetAccidentals = { - \property Score.autoAccidentals = #'((measure-same-octave . -1)) + \property Score.autoAccidentals = #'(Staff (same-octave . -1)) \property Score.autoCautionaries = #'() } diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 888be205fb..ca4e0756a6 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.5.44 -Entered-date: 20MRT02 +Version: 1.5.45 +Entered-date: 21MRT02 Description: @BLURB@ 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.5.44.tar.gz + 1000k lilypond-1.5.45.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.5.44.tar.gz + 1000k lilypond-1.5.45.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.mandrake.spec b/make/out/lilypond.mandrake.spec index e309c21d93..4d319008eb 100644 --- a/make/out/lilypond.mandrake.spec +++ b/make/out/lilypond.mandrake.spec @@ -1,5 +1,5 @@ %define name lilypond -%define version 1.5.44 +%define version 1.5.45 %define release 1mdk Name: %{name} diff --git a/make/out/lilypond.redhat.spec b/make/out/lilypond.redhat.spec index aa38813cc5..4bdc2c5213 100644 --- a/make/out/lilypond.redhat.spec +++ b/make/out/lilypond.redhat.spec @@ -3,11 +3,11 @@ %define info yes Name: lilypond -Version: 1.5.44 +Version: 1.5.45 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.44.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz Summary: Create and print music notation URL: http://www.lilypond.org/ BuildRoot: /tmp/lilypond-install diff --git a/make/out/lilypond.suse.spec b/make/out/lilypond.suse.spec index afaa58bb43..7617b7d05c 100644 --- a/make/out/lilypond.suse.spec +++ b/make/out/lilypond.suse.spec @@ -14,11 +14,11 @@ Distribution: SuSE Linux 7.0 (i386) Name: lilypond -Version: 1.5.44 +Version: 1.5.45 Release: 2 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.44.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.45.tar.gz # music notation software for.. ? Summary: A program for printing sheet music. URL: http://www.lilypond.org/ diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 453135ab52..ebde4b6a1b 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -214,7 +214,7 @@ paper-size % initialise paper dimensions staff-height init-paper -/line-x left-margin def +/line-x left-margin output-scale div def /line-y vsize top-margin sub def make-lilypond-title diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 997cbb755f..c55661e8a9 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -372,12 +372,6 @@ (meta . ,(grob-description lyric-hyphen-interface )) )) - (LineOfScore - . ( - (axes . (0 1)) - (meta . ,(grob-description line-of-score-interface axis-group-interface)) - )) - (LyricExtender . ( (molecule-callback . ,Lyric_extender::brew_molecule) @@ -809,6 +803,12 @@ (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface)) )) + (System + . ( + (axes . (0 1)) + (meta . ,(grob-description line-of-score-interface axis-group-interface)) + )) + (SystemStartBrace . ( (glyph . "brace") diff --git a/scm/molecule.scm b/scm/molecule.scm index 85176065ae..1d3c58d027 100644 --- a/scm/molecule.scm +++ b/scm/molecule.scm @@ -36,3 +36,35 @@ (set! mol (ly-combine-molecule-at-edge mol (other-axis axis) -1 rb padding)) mol )) + + + +(define (box-molecule xext yext) + "Make a filled box." + + (ly-make-molecule + (list 'filledbox (- (car xext)) (cdr xext) + (- (car yext)) (cdr yext)) + xext yext) +) + +(define (widen-interval iv amount) + (cons (- (car iv) amount) + (+ (cdr iv) amount)) +) + + +(define (box-grob-molecule grob) + "Make a box of exactly the extents of the grob." + (let* ((xext (ly-get-extent grob grob 0)) + (yext (ly-get-extent grob grob 1)) + (mol (ly-make-molecule '() '(10000 . -10000) '(10000 . -10000))) + (thick 0.1) + ) + (display "hoi") + (set! mol (ly-add-molecule mol (box-molecule xext (cons (car yext) (+ (car yext) thick))))) + (set! mol (ly-add-molecule mol (box-molecule xext (cons (- (cdr yext) thick) (cdr yext))))) + (set! mol (ly-add-molecule mol (box-molecule (cons (car xext) (+ (car xext) thick)) yext))) + (set! mol (ly-add-molecule mol (box-molecule (cons (- (cdr xext) thick) (cdr xext)) yext))) + mol + )) diff --git a/scm/ps.scm b/scm/ps.scm index 8ba55fba03..b7c1072b8f 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -93,7 +93,7 @@ (car name-mag) " findfont " "20 " (ly-number->string (cdr name-mag)) " mul " - "lilypondpaperoutputscale div scalefont setfont } bind def " + "output-scale div scalefont setfont } bind def " "\n")) (define (beam width slope thick) diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index 8cfeb298ca..9c7474ef2e 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -85,18 +85,23 @@ The head of the list: (translator-property-description 'autoAccidentals list? "List of different ways to typeset an accidental. All algorithms in the list are tried, and the one returning the most accidentals is used. -Each algorithm-description is a name-value pair. +Each entry is either a symbol containg a context name or a name-value +pair containing an algorithm-description. +The list must begin with a symbol (context name). +The symbols denote in which context THE FOLLOWING algorithms (until next symbol) +will be interpreted. All notes in the interpretation context will share accidentals. +The contexts must be stated in order, innermost first. The algorithms are: @table @samp -@item measure-same-octave: +@item same-octave: This is the default algorithm. Accidentals are typeset if the note changes the accidental of that note in that octave. Accidentals lasts to the end of the measure and then as many measures as specified in the value. I.e. 1 means to the end -of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. -@item measure-any-octave: +of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever. +@item any-octave: Accidentals are typeset if the note is different from the previous note on the same pitch in any octave. The value has same meaning as in -measure-same-octave. +same-octave. @end table ") diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index c47267cead..c948be1bd6 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -9,11 +9,11 @@ \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} % The feta characters -\input feta20.tex +%\input feta20.tex -\font\fetasixteen=feta16 -\def\fetafont{\fetasixteen} -\def\fetachar#1{\hbox{\fetasixteen#1}} +%\font\fetasixteen=feta16 +%\def\fetafont{\fetasixteen} +%\def\fetachar#1{\hbox{\fetasixteen#1}} % If we must make titles, do so, before we're Skipped. \ifx\mustmakelilypondtitle\undefined\else\makelilypondtitle\fi -- 2.39.5