From 3f0c0f19dac072ad2ba39b254ef51962fc1c7353 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 21 Aug 2003 17:57:35 +0000 Subject: [PATCH] * input/mutopia/F.Schubert/standchen.ly (trebleThrough): fixes * lily/simultaneous-music.cc (to_relative_octave): add Event_chord. * lily/parser.yy (pre_events): remove prefix articulations. * lily/music-sequence.cc (do_relative_octave): change relative meaning. --- ChangeLog | 6 +++- GNUmakefile.in | 2 +- input/mutopia/F.Schubert/standchen.ly | 29 ++++++++++++------- lily/include/music-list.hh | 9 ++---- lily/music-sequence.cc | 20 ++++---------- lily/parser.yy | 5 ++-- lily/simultaneous-music.cc | 40 +++++++++++++++++++++++++-- scm/define-music-types.scm | 3 +- 8 files changed, 74 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index e28a6f553b..2f5a8e9003 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ 2003-08-21 Han-Wen Nienhuys + * input/mutopia/F.Schubert/standchen.ly (trebleThrough): fixes + + * lily/simultaneous-music.cc (to_relative_octave): add Event_chord. + * lily/music.cc (var): add ly:music-transpose function. - * Lily/parser.yy (pre_events): remove prefix articulations. + * lily/parser.yy (pre_events): remove prefix articulations. * lily/music-sequence.cc (do_relative_octave): change relative meaning. diff --git a/GNUmakefile.in b/GNUmakefile.in index 83eecd0082..703d4f177f 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -151,5 +151,5 @@ $(config_h): configure.in aclocal.m4 # maybe move into private script? rsync-web: cd out-www && mkdir web && tar -xzf web.tar.gz -C web - cd out-www/web && rsync --delete --stats --progress -rltvu -e ssh . x:/var/www/lilypond/doc/v1.8/ + cd out-www/web && rsync --delete --stats --progress -rltvu -e ssh . x:/var/www/lilypond/doc/v1.9/ cd out-www && rm -rf web/ diff --git a/input/mutopia/F.Schubert/standchen.ly b/input/mutopia/F.Schubert/standchen.ly index 6f83435155..1d510340ec 100644 --- a/input/mutopia/F.Schubert/standchen.ly +++ b/input/mutopia/F.Schubert/standchen.ly @@ -152,15 +152,23 @@ trebleVerseOne = \notes\relative c{ r8 <> <> <> <> <> | r8 <> <> <> <> <> | <>4.-( <>8-) - \times 2/3 < { f-[( es d-) ] } { d c b } > | + \times 2/3 { <>-(-[ <>-]-) <> } + %10 <>2. | r8 <> <> <> <> <> | r8 <> <> <> <> <> | r8 <> <> <> <> <> | - r8 < { es-[ g es g ] } { g bes g bes } { bes es bes es } > - <{ es'( d4.-)( f8-)}{ c' | bes4. as8 } > - \times 2/3 < { f-[( es d-) ] } { as' g f } > | + r8 + <>-[ + <> + <> + <>-] + <>-( + <>4.-(-) + <>8-) + + \times 2/3 { <>-(-[ <> <>-)-] } %16 <>2. | r8 <> <> <> <> <> | @@ -169,15 +177,16 @@ trebleVerseOne = \notes\relative c{ %20 r8 <> <> <> <> <> | \property Voice.Slur \override #'attachment = #'(stem . stem) - \grace { as'32-[( bes ] } \times 2/3 { as8-[-)( g as] } c4.-> as8-) | + \grace { as'32-[( bes ] } + \times 2/3 { as8-[-)( g as] } c4.-> as8-) | \property Voice.Slur \revert #'attachment g2. | r8 <> <> <> <> <> | r8 <> <> <> <> <> | r8 <> <> <> <> <> | r8 <> <> <> <> <> | - \times 2/3 < { f'8-[-\f( e f] } { f' e f } > - < {a4.- > f8-)} { a'4. f8 } > | + \times 2/3 { <>-\f-( <> <> } + <>4.-> <>8-) | } trebleEentje = \notes \relative c' \context Voice { @@ -227,7 +236,7 @@ trebleThrough = \notes \relative c'{ <>2. | <>2. | \property Voice . TextScript \override #'font-shape = #'italic - | + <>2._"decresc." \property Voice . TextScript \revert #'font-shape %75 @@ -241,7 +250,7 @@ trebleThrough = \notes \relative c'{ %80 \property Voice . TextScript \override #'font-shape = #'italic - | + <>_"dim." \property Voice . TextScript \revert #'font-shape <>2. | @@ -304,7 +313,7 @@ bassEentje = \notes\relative c{ bassThrough = \notes\relative c{ \dynamicUp %61 - [<> <> <> <>-> <>] | + <>8^"cresc." [<> <> <> <>-> <>] | <>8 [<> <> <> <>-> <>] | % copied <>8 [<> <> <> <>-> <>] | diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 1d74ba0438..4c7707ede5 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -26,17 +26,14 @@ public: Simultaneous_music (); }; -/** - The event is a collection of Events. A note that you enter in lilypond is - one Event_chord, one syllable of lyrics is one Event_chord +/* + A chord. */ class Event_chord : public Simultaneous_music { public: VIRTUAL_COPY_CONS (Music); - virtual Moment start_mom () const; - - Event_chord (); + virtual Pitch to_relative_octave (Pitch); }; /** diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 1d967a3dde..cc9a1ed1c9 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -100,12 +100,7 @@ Music_sequence::do_relative_octave (Pitch p, bool ret_first) Pitch last = p; for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s)) { - Music *m = unsmob_music (ly_car (s)); - if (!m) - { - programming_error ("Music_sequence should only contain music!"); - } - else + if (Music *m = unsmob_music (ly_car (s))) { last = m->to_relative_octave (last); if (!count ++) @@ -113,15 +108,10 @@ Music_sequence::do_relative_octave (Pitch p, bool ret_first) } } - if (ret_first && first != last) - { - String str = _("Changing relative definition causes pitch change."); - str += "\nWas: " + first.to_string () - + "Will be: " + last.to_string () + "\n"; - - origin()->warning (str); - } - return last; + if (ret_first) + return first; + else + return last; } void diff --git a/lily/parser.yy b/lily/parser.yy index 249bdbbe6e..54f23241c1 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2129,11 +2129,12 @@ step_number: /* UTILITIES + +TODO: should deprecate in favor of Scheme? + */ number_expression: number_expression '+' number_term { - - THIS-> $$ = scm_sum ($1, $3); } | number_expression '-' number_term { diff --git a/lily/simultaneous-music.cc b/lily/simultaneous-music.cc index 108ba5dbb6..aa7ecd40f9 100644 --- a/lily/simultaneous-music.cc +++ b/lily/simultaneous-music.cc @@ -1,7 +1,6 @@ - +#include "input.hh" #include "moment.hh" #include "pitch.hh" -#include "simultaneous-music-iterator.hh" #include "music-list.hh" Moment @@ -21,9 +20,44 @@ Simultaneous_music::Simultaneous_music() } +/* + Cut & paste from Music_sequence, (ugh) , but we must add an error + message. + */ Pitch Simultaneous_music::to_relative_octave (Pitch p) { - return do_relative_octave (p, true); + Pitch first; + int count=0; + + Pitch last = p; + for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s)) + { + if (Music *m = unsmob_music (ly_car (s))) + { + last = m->to_relative_octave (last); + if (!count ++) + first = last; + } + } + + if (count && first != last) + { + String str = _("Changing relative definition causes pitch change."); + str += "\nWas: " + first.to_string () + + " -- now returning: " + last.to_string () + "\n"; + + origin()->warning (str); + } + + return last; } + ADD_MUSIC (Simultaneous_music); + +Pitch +Event_chord::to_relative_octave (Pitch p) +{ + return do_relative_octave (p, true); +} +ADD_MUSIC(Event_chord); diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 0b758bc901..1eabfbe00f 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -484,8 +484,7 @@ For example, transposed music.") (EventChord . ( (description . "Internally used to group a set of events.") - - (internal-class-name . "Simultaneous_music") + (internal-class-name . "Event_chord") (iterator-ctor . ,Event_chord_iterator::constructor) (types . (general-music event-chord simultaneous-music)) ) -- 2.39.2