From fd5395dda5a102c09b1f9dfb3eed79290667bc4c Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:05:53 +0000 Subject: [PATCH] lilypond-1.5.34 --- ChangeLog | 31 ++++++++++++++++++++++++++++++ Documentation/regression-test.tely | 5 ++++- Documentation/user/refman.itely | 26 +++++++++++++------------ VERSION | 2 +- input/regression/rest-pitch.ly | 16 +++++++++++++++ input/regression/staccato-pos.ly | 8 ++------ lily/collision.cc | 8 +++----- lily/note-column.cc | 9 +++++---- lily/request-chord.cc | 23 ++++++++++++++++------ lily/rest-engraver.cc | 25 +++++++++++++++++++----- lily/staff-symbol-referencer.cc | 6 +----- 11 files changed, 114 insertions(+), 45 deletions(-) create mode 100644 input/regression/rest-pitch.ly diff --git a/ChangeLog b/ChangeLog index 0d0686bc4f..c8671a34e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2002-02-27 Han-Wen Nienhuys + + * VERSION: 1.5.34 released. + + * lily/rest-engraver.cc (create_grobs): rests can have pitches. + + * lily/staff-symbol-referencer.cc (callback): assume that + staff-position is unset in general. + + * input/regression/rest-pitch.ly: new file. + + * lily/parser.yy (simple_element): rests can have pitch. Syntax: + a4\rest + +2002-02-26 Han-Wen Nienhuys + + * lily/scm-option.cc (set_lily_option): add internal-type-checks + as Scheme option. Run regression test by default with + internal-type-checking. + + * lily/separating-group-spanner.cc (find_musical_sequences): removed. + + * lily/lily-guile.cc (type_check_assignment): changed functions. + + * scm/*description*.scm: be anal about typechecks. Some changes + for internal variable names. + +2002-02-25 Han-Wen Nienhuys + + * scm/ps.scm: -f ps output for GUILE 1.4 and 1.3.4 + 2002-02-25 Han-Wen * VERSION: 1.5.33 released. diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 6dbe5dd5b9..208904fae8 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -39,6 +39,7 @@ documenting bugfixes. @lilypondfile[printfilename]{mm-rests2.ly} +@lilypondfile[printfilename]{rest-pitch.ly} @section Accidentals @@ -64,7 +65,6 @@ Accidentals are currently in a development stage. @lilypondfile[printfilename]{stem-direction-down.ly} - @section Scripts @lilypondfile[printfilename]{staccato-pos.ly} @@ -114,6 +114,8 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{grace-sync.ly} +@lilypondfile[printfilename]{grace-bar-number.ly} + @section Beams @@ -280,6 +282,7 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{part-combine.ly} +@lilypondfile[printfilename]{font-magnification.ly} @lilypondfile[printfilename,nofragment]{size11.ly} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index cad14bd54a..133e45f318 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -255,6 +255,14 @@ r1 r2 r4 r8 The grob is @internalsref{Rest}. Whole bar rests centered in the bar are specified using @code{R}, see @ref{Multi measure rests}. +For polyphonic music, it can be convenient to specify the rest position +directly. You can do that by entering a note, with the keyword +@code{\rest} appended, e.g. Rest collisions will leave these rests alone. + +@lilypond[singleline,verbatim] +a'4\rest d'4\rest +@end lilypond + @c . {Skips} @c FIXME: naming. @@ -855,12 +863,10 @@ The easiest way to enter such fragments, is the Scheme function @code{\\}, to make multiple voices. You can use it for small, short-lived voices (make a chord of voices) or for single chords: -@lilypond -\score { -\notes \context Voice = VA \apply #voicify-music \relative c'' { +@lilypond[verbatim,fragment] +\context Voice = VA \apply #voicify-music \relative c'' { c4 < { f d e } \\ { b c2 } > c4 < g' \\ c, \\ f \\ d > } -} @end lilypond The function @code{voicify-music} instantiates @internalsref{Voice} @@ -2869,12 +2875,11 @@ block: Figured bass is printed by @internalsref{FiguredBass} context. This context will print notes (relative to the central C) as figures. To -ease entering these notes, the special @code{\figures} mode, is +ease entering these notes, the special @code{\figures} mode is available which allows you to type numbers, like @code{<4 6+>}. -@lilypond -\score { \notes < - \context FiguredBass \transpose c'' { +@lilypond[verbatim,fragment] +< \context FiguredBass \transpose c'' { \figures { @@ -2884,10 +2889,7 @@ available which allows you to type numbers, like @code{<4 6+>}. } \context Voice { c g8 g f4 d c - } - -> - } + } > @end lilypond @c . {Tuning output} diff --git a/VERSION b/VERSION index f0962d6456..01b2d92cf8 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 -PATCH_LEVEL=33 +PATCH_LEVEL=34 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/regression/rest-pitch.ly b/input/regression/rest-pitch.ly new file mode 100644 index 0000000000..e864dade12 --- /dev/null +++ b/input/regression/rest-pitch.ly @@ -0,0 +1,16 @@ +\header { + +texidoc = "Rests can have pitches--these will be affected by +transposition and relativization. If a rest has a pitch, rest +collision will leave it alone." + +} + +\score { \notes\relative c'' \apply #voicify-music +{ + a4\rest b4\rest c4\rest + + + +} +} diff --git a/input/regression/staccato-pos.ly b/input/regression/staccato-pos.ly index 38ff46b086..053307faa7 100644 --- a/input/regression/staccato-pos.ly +++ b/input/regression/staccato-pos.ly @@ -7,14 +7,10 @@ not be on staff lines. " } \score { - \context Voice \notes\relative c { - - e''4-. f-. d-. - c,-. b-. c'''-. d-. - + \context Voice \notes\relative c' { + e'4-. f-. d-. c-. b-. } \paper { linewidth=-1.0 } - \midi { } } diff --git a/lily/collision.cc b/lily/collision.cc index 7ae57a8ec6..2dea673021 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -25,12 +25,10 @@ Collision::force_shift_callback (SCM element_smob, SCM axis) assert (a == X_AXIS); me = me->get_parent (a); - /* - ugh. the way DONE is done is not clean - */ - if (!unsmob_grob (me->get_grob_property ("done"))) + + if (! to_boolean (me->get_grob_property ("collision-done"))) { - me->set_grob_property ("done", me->self_scm ()); + me->set_grob_property ("collision-done", SCM_BOOL_T); do_shifts (me); } diff --git a/lily/note-column.cc b/lily/note-column.cc index 27fd96730a..b53a18deb4 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -105,13 +105,14 @@ Note_column::add_head (Grob*me,Grob *h) } /** - translate the rest symbols vertically by amount DY_I. - */ + translate the rest symbols vertically by amount DY_I, but only if + they have no staff-position set. +*/ void Note_column::translate_rests (Grob*me,int dy_i) { Grob * r = unsmob_grob (me->get_grob_property ("rest")); - if (r) + if (r && !gh_number_p (r->get_grob_property ("staff-position"))) { r->translate_axis (dy_i * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS); } @@ -150,7 +151,7 @@ Note_column::accidentals (Grob *me) for (;gh_pair_p (heads); heads =gh_cdr (heads)) { Grob * h = unsmob_grob (gh_car (heads)); - Grob *a = h ? unsmob_grob(h->get_grob_property ("accidentals")) : 0; + Grob *a = h ? unsmob_grob(h->get_grob_property ("accidentals-grob")) : 0; if (a) return a; } diff --git a/lily/request-chord.cc b/lily/request-chord.cc index 170d4996df..322cf49e03 100644 --- a/lily/request-chord.cc +++ b/lily/request-chord.cc @@ -22,15 +22,26 @@ Request_chord::to_relative_octave (Pitch last) for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s)) { Music * mus = unsmob_music (ly_car (s)); - if (Melodic_req *m= dynamic_cast (mus)) + Melodic_req *m= dynamic_cast (mus); + + /* + kLudge: rests have pitches now as well. + */ + Rest_req *r = dynamic_cast (mus); + + if (r || m) { - Pitch pit = *unsmob_pitch (m->get_mus_property ("pitch")); + Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch")); + if (!old_pit) + continue; - pit.to_relative_octave (last); - m->set_mus_property ("pitch", pit.smobbed_copy ()); - - return pit; + Pitch new_pit = *old_pit; + new_pit.to_relative_octave (last); + mus->set_mus_property ("pitch", new_pit.smobbed_copy ()); + + return new_pit; } + } return last; } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 72582135c2..cb92159fec 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -22,10 +22,9 @@ protected: virtual bool try_music (Music *); virtual void stop_translation_timestep (); virtual void start_translation_timestep (); - virtual void create_grobs (); + virtual void process_music (); public: - TRANSLATOR_DECLARATIONS(Rest_engraver); }; @@ -62,13 +61,13 @@ Rest_engraver::stop_translation_timestep () } void -Rest_engraver::create_grobs () +Rest_engraver::process_music () { if (rest_req_l_ && !rest_p_) { rest_p_ = new Item (get_property ("Rest")); Rhythmic_head::set_interface (rest_p_); - Staff_symbol_referencer::set_interface (rest_p_); + int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log (); @@ -87,6 +86,22 @@ Rest_engraver::create_grobs () announce_grob (dot_p_, SCM_EOL); } + Pitch *p = unsmob_pitch (rest_req_l_->get_mus_property ("pitch")); + + /* + This is ridiculous -- rests don't have pitch, but we act as if + our nose is bleeding. + */ + if (p) + { + int pos= p->steps (); + SCM c0 = get_property ("centralCPosition"); + if (gh_number_p (c0)) + pos += gh_scm2int (c0); + + rest_p_->set_grob_property ("staff-position", gh_int2scm (pos)); + } + announce_grob(rest_p_, rest_req_l_->self_scm()); } } @@ -108,5 +123,5 @@ ENTER_DESCRIPTION(Rest_engraver, /* descr */ "", /* creats*/ "Rest Dots", /* acks */ "", -/* reads */ "", +/* reads */ "centralCPosition", /* write */ ""); diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 57cf6ec0b5..e63efa1b30 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -99,10 +99,9 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM) { Real space = Staff_symbol_referencer::staff_space (me); off = gh_scm2double (pos) * space/2.0; + me->set_grob_property ("staff-position", gh_double2scm (0.0)); } - me->set_grob_property ("staff-position", gh_double2scm (0.0)); - return gh_double2scm (off); } @@ -164,9 +163,6 @@ compare_position (Grob *const &a, Grob * const &b) void Staff_symbol_referencer::set_interface (Grob * e) { - if (!gh_number_p (e->get_grob_property ("staff-position"))) - e->set_grob_property ("staff-position", gh_double2scm (0.0)); - e->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS); } -- 2.39.5