From 3db71772f5cb820c233448af50042872d065647f Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 22 Jun 2002 21:18:44 +0000 Subject: [PATCH] '' --- ChangeLog | 7 +++++ Documentation/user/macros.itexi | 15 ++-------- config.make.in | 6 ++-- input/regression/beam-length.ly | 2 -- input/regression/rest-pitch.ly | 2 +- input/trip.ly | 50 +++++++++++++++------------------ input/tutorial/brahms.ly | 25 +++++++++++++++++ input/tutorial/sammartini.ly | 47 ++++++++++++++++++------------- lily/grob.cc | 5 ++++ lily/lily-guile.cc | 3 ++ lily/note-collision.cc | 10 ++++++- lily/parser.yy | 9 +++--- scm/music-functions.scm | 27 ++++++++---------- stepmake/bin/add-html-footer.py | 2 +- 14 files changed, 122 insertions(+), 88 deletions(-) create mode 100644 input/tutorial/brahms.ly diff --git a/ChangeLog b/ChangeLog index 06b993dc6e..666ca0a3e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2002-06-22 Han-Wen + * lily/note-collision.cc (check_meshing_chords): don't crash if no + stems. + + * scm/music-functions.scm (toplevel-music-functions): new + definition. Functions to apply automatically. Removes the need for + explicitly doing \apply #voicify-music + * lily/grob.cc (do_break_substitution): rename function, use global var for criterion argument. Reduces stack usage a little. diff --git a/Documentation/user/macros.itexi b/Documentation/user/macros.itexi index 9343d80c3f..bb7d7cacea 100644 --- a/Documentation/user/macros.itexi +++ b/Documentation/user/macros.itexi @@ -73,7 +73,7 @@ $\\flat$ @macro separate @tex -\\hbox to\\hsize{\\hfill\\smallrm*\\textrm*\\smallrm*\\hfill} +\medskip @end tex @end macro @@ -87,17 +87,6 @@ $\\flat$ @macro separate @quotation -@quotation -@quotation -@quotation -@quotation -@quotation -*** -@end quotation -@end quotation -@end quotation -@end quotation -@end quotation @end quotation @end macro @end ifinfo @@ -105,7 +94,7 @@ $\\flat$ @ifhtml @macro separate @html -

***

+



@end html @end macro @end ifhtml diff --git a/config.make.in b/config.make.in index e976cfe25f..b1cb9d2841 100644 --- a/config.make.in +++ b/config.make.in @@ -12,9 +12,9 @@ USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@ USER_LDFLAGS = @LDFLAGS@ @GUILE_LDFLAGS@ EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@ -PACKAGE = @PACKAGE@ -package = @package@ -PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE = LILYPOND # @PACKAGE@ +package = lilypond # @package@ +PACKAGE_NAME = LilyPond #@PACKAGE_NAME@ prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/input/regression/beam-length.ly b/input/regression/beam-length.ly index e1689107fc..8cabfb8dcc 100644 --- a/input/regression/beam-length.ly +++ b/input/regression/beam-length.ly @@ -8,9 +8,7 @@ beams should look the same \score { \context Voice \notes\relative c { - [d''8 d d] [d g d] c c - } } diff --git a/input/regression/rest-pitch.ly b/input/regression/rest-pitch.ly index e864dade12..5880a5246d 100644 --- a/input/regression/rest-pitch.ly +++ b/input/regression/rest-pitch.ly @@ -6,7 +6,7 @@ collision will leave it alone." } -\score { \notes\relative c'' \apply #voicify-music +\score { \notes\relative c'' { a4\rest b4\rest c4\rest diff --git a/input/trip.ly b/input/trip.ly index 7342f420fd..c0d78f20ff 100644 --- a/input/trip.ly +++ b/input/trip.ly @@ -99,44 +99,38 @@ fugaIIRight = \notes \relative c'' { %15 \context Staff < - \context Voice = VA { \stemUp [b8 fis8] b4 } - \context Voice = VB { \stemDown fis2 } + { [b8 fis8] b4 }\\ + { fis2 } > \context Staff \notes\relative c''< - \context Voice=one { - \shiftOff - \stemUp + { e4 -5 - } - \context Voice=two { - \shiftOn - \stemUp + }\\ + \\ + { cis-4 - } - \context Voice=three { - \shiftOnn - \stemUp + }\\ \\ + + { ais-3 - } - \context Voice=four { - \shiftOnnn - \stemUp + }\\ \\ + { fis-2 } > %16 \context Staff < - \context Voice = one { dis2 dis4 | + { dis2 dis4 | cis2 cis4 | - b4. [cis8 dis e] } - \context Voice = three { \stemUp \shiftOn [b8 fis] b2 ~ | + b4. [cis8 dis e] } \\ + { fis2. ~ | + fis ~ | + fis4 e2 } \\ + { [b8 fis] b2 ~ | [b8 a!16 gis] a2 ~ | a4 gis2 } - \context Voice = two { \stemDown fis2. ~ | - fis ~ | - fis4 e2 } > | %19 } @@ -149,14 +143,14 @@ fugaIILeft = \notes { %15 \context Staff < - \context Voice = one { \stemDown + { \gracetest \relative b, < )b2 dis fis a b cis dis> \stemUp ais4 | - b2 b4 } - \context Voice = two { \stemDown s2 e4 | - fis2 fis4 } + b2 b4 } \\ + { s2 e4 | fis2 fis4 } > - \stemBoth cis2 [e16( fis a \clef "treble" b] | + \stemBoth + cis2 [e16( fis a \clef "treble" b] | d'4 ) b8 b8 b4 | %19 } diff --git a/input/tutorial/brahms.ly b/input/tutorial/brahms.ly new file mode 100644 index 0000000000..02b0f48500 --- /dev/null +++ b/input/tutorial/brahms.ly @@ -0,0 +1,25 @@ +%{ + + Brahms Klavierst"ucke op 119, no 1. + +%} + +\score { + \notes\context PianoStaff < + \context Staff = up + \relative c'' < + { fis4-3 ( ~ fis16 )a-5 } \\ + { + \dynamicUp + fis16( \> d \! b \translator Staff = down \clef treble g ~ < g8 )e> } \\ + { s16 + \property Voice.Stem \set #'transparent = ##t + d' + \property Voice.Stem \revert #'transparent + ~ < d4 b4 > } + > + \context Staff = down { \time 3/8 \clef bass s4. } + > + \paper { linewidth = -1. } +} + diff --git a/input/tutorial/sammartini.ly b/input/tutorial/sammartini.ly index d9f648fa17..18b884eaac 100644 --- a/input/tutorial/sammartini.ly +++ b/input/tutorial/sammartini.ly @@ -1,55 +1,62 @@ \include "paper16.ly" - -stemDown = \property Voice.Stem \override #'direction = #-1 -stemUp = \property Voice.Stem \override #'direction = #1 -stemBoth = \property Voice.Stem \revert #'direction - -viola = \notes \relative c' \context Voice = viola { + +viola = \notes \relative c' \context Voice = viola { - \stemDown g'8. b,16 + \stemDown + g'8. b,16 s1 s2. r4 g } -oboes = \notes \relative c'' \context Voice = oboe { - \stemUp s4 g8. b,16 c8 r +oboes = \notes \relative c'' \context Voice = oboes { + \stemUp + s4 g8. b,16 c8 r \grace \times 2/3 { } < - { \times 2/3 { a8 g c } \! c2 } - \context Voice = oboeTwo { - \stemDown + { \stemUp \times 2/3 { a8 g c } \! c2 } + \context Voice = second { \stemDown \grace { \stemDown - [f,16 g] } + [f,16 g] + \stemBoth } f8 e e2 } > - \stemBoth + \grace <)b8. d8.-\trill> | [ < )f8. a>] <)b,8 d> r [ ] r | [ < )e8. g>] } hoomPah = \repeat unfold 8 \notes - \transpose c' { c8 \stemDown g'8 \stemUp } + \transpose c' { + \translator Staff = down + \stemUp + c8 + \translator Staff = up + \stemDown + c'8 } bassvoices = \notes \relative c' { c4 g8. b,16 \autochange Staff \context Voice \hoomPah + \translator Staff = down - \stemDown [c8 c'8] r4 + \stemBoth + + [c8 c'8] r4 r4 - < {\stemUp r2 } - \context Voice = reallyLow {\stemDown g2 ~ | g4 c8 } > + < { r2 } \\ + { g2 ~ | g4 c8 } > } \score { \context PianoStaff \notes < - \context Staff = up < \time 2/2 - \viola + \context Staff = up < \oboes + \viola > \context Staff = down < \time 2/2 \clef bass \bassvoices diff --git a/lily/grob.cc b/lily/grob.cc index eb42b0c497..3121658c01 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -390,6 +390,11 @@ set_break_subsititution (SCM criterion) break_criterion = criterion; } + +/* + TODO: check wether we can do this in-place; now we generate a lot of + garbage. + */ SCM do_break_substitution (SCM src) { diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e5595530ce..69fb7dfb2c 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -25,6 +25,9 @@ #include "pitch.hh" #include "dimensions.hh" + +// #define TEST_GC + #ifdef PARANOID #include #undef gh_pair_p diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 8dcbae3d2c..5468ff529f 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -80,6 +80,14 @@ check_meshing_chords (Grob*me, bool distant_half_collide = false; bool full_collide = false; + /* + Let's not crash. + */ + if (!Note_column::stem_l (cu) + || !Note_column::stem_l (cd)) + return ; + + /* TODO: @@ -329,7 +337,7 @@ Note_collision_interface::automatic_shift (Grob *me, { if (shift[i-1] == shift[i]) { - me->warning (_ ("Too many clashing notecolumns. Ignoring them.")); + clashes[0]->warning (_ ("Too many clashing notecolumns. Ignoring them.")); return tups; } } diff --git a/lily/parser.yy b/lily/parser.yy index cc806fe177..698398adcc 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -569,14 +569,15 @@ score_body: $$->set_spot (THIS->here_input ()); SCM m = $1->self_scm (); scm_gc_unprotect_object (m); - $$->music_ = m; /* guh. */ - SCM check_func = scm_c_eval_string ("check-start-chords"); - gh_call1 (check_func, m); - + SCM check_funcs = scm_c_eval_string ("toplevel-music-functions"); + for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs)) + m = gh_call1 (gh_car (check_funcs), m); + $$->music_ = m; + } | SCORE_IDENTIFIER { $$ = new Score (*unsmob_score ($1)); diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 8eca9bea45..c7031f4f42 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -35,7 +35,6 @@ written by Rune Zedeler. " music 'element (unfold-repeats e))) - music)) @@ -223,20 +222,17 @@ this is not an override ((es (ly-get-mus-property m 'elements)) (e (ly-get-mus-property m 'element)) ) - + (if (pair? es) + (ly-set-mus-property m 'elements (map voicify-music es))) + (if (music? e) + (ly-set-mus-property m 'element (voicify-music e))) (if (and (equal? (ly-music-name m) "Simultaneous_music") (reduce (lambda (x y ) (or x y)) (map music-separator? es))) (voicify-chord m) - (begin - (if (pair? es) - (ly-set-mus-property m 'elements (map voicify-music es))) - (if (music? e) - (ly-set-mus-property m 'element (voicify-music e))) - - m) - ) + + m )) ;;; @@ -260,8 +256,8 @@ this is not an override )) (define (check-start-chords music) - "Check music expression for a Simultaneous_music containing notes -(ie. Request_chords), without context specification. Called from parser." + "Check music expression for a Simultaneous_music containing notes\n(ie. Request_chords), without context specification. Called from parser." + (let* ((es (ly-get-mus-property music 'elements)) (e (ly-get-mus-property music 'element)) @@ -273,8 +269,7 @@ this is not an override ((equal? name "Simultaneous_music") (if (has-request-chord es) - (ly-music-message music "Starting score with a chord. -Please insert an explicit \\context before chord") + (ly-music-message music "Starting score with a chord.\nPlease insert an explicit \\context before chord") (map check-start-chords es))) ((equal? name "Sequential_music") @@ -283,6 +278,8 @@ Please insert an explicit \\context before chord") (else (if (music? e) (check-start-chords e ))) )) - music ) + + +(define toplevel-music-functions (list check-start-chords voicify-music)) diff --git a/stepmake/bin/add-html-footer.py b/stepmake/bin/add-html-footer.py index f7cdac7ffb..9e79f02683 100644 --- a/stepmake/bin/add-html-footer.py +++ b/stepmake/bin/add-html-footer.py @@ -235,7 +235,7 @@ def do_file (f): versiontup = string.split(package_version, '.') - branch_str = 'stable-branch' + branch_str = 'stable-branch' if string.atoi ( versiontup[1]) % 2: branch_str = 'development-branch' -- 2.39.2