2002-06-22 Han-Wen <hanwen@cs.uu.nl>
+ * 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.
@macro separate
@tex
-\\hbox to\\hsize{\\hfill\\smallrm*\\textrm*\\smallrm*\\hfill}
+\medskip
@end tex
@end macro
@macro separate
@quotation
-@quotation
-@quotation
-@quotation
-@quotation
-@quotation
-***
-@end quotation
-@end quotation
-@end quotation
-@end quotation
-@end quotation
@end quotation
@end macro
@end ifinfo
@ifhtml
@macro separate
@html
-<p></p><center>*<font size="+1">*</font>*</center><br>
+<p></p><br><br>
@end html
@end macro
@end ifhtml
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@
\score {
\context Voice \notes\relative c {
-
[d''8 d d] [d g d]
c c
-
}
}
}
-\score { \notes\relative c'' \apply #voicify-music
+\score { \notes\relative c''
{
a4\rest b4\rest c4\rest
%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
}
%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
}
--- /dev/null
+%{
+
+ 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. }
+}
+
\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 {
<c4-\f-\arpeggio g' c>
- \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 <e'8.^\p g> <f16 a>
+oboes = \notes \relative c'' \context Voice = oboes {
+ \stemUp
+ s4 g8. b,16 c8 r <e'8.^\p g> <f16 a>
\grace <e8( g> <d4 f> <c2 e>
\times 2/3 { <d8 \< f> <e g> <f a> }
<
- { \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 <c,8( e> <)b8. d8.-\trill> <c16 e> |
[<d ( f> < )f8. a>] <)b,8 d> r [<d16( f> <f8. )a>] <b,8 d> r |
[<c16( e> < )e8. g>] <c8 e,>
}
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
<g d'> r4
- < {\stemUp r2 <e4 c'> <c8 g'> }
- \context Voice = reallyLow {\stemDown g2 ~ | g4 c8 } >
+ < { r2 <e4 c'> <c8 g'> } \\
+ { 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
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)
{
#include "pitch.hh"
#include "dimensions.hh"
+
+// #define TEST_GC
+
#ifdef PARANOID
#include <libguile/gc.h>
#undef gh_pair_p
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:
{
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;
}
}
$$->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));
music 'element
(unfold-repeats e)))
-
music))
((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
))
;;;
))
(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))
((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")
(else (if (music? e) (check-start-chords e )))
))
-
music
)
+
+
+(define toplevel-music-functions (list check-start-chords voicify-music))
versiontup = string.split(package_version, '.')
- branch_str = 'stable-branch'
+ branch_str = 'stable-branch'
if string.atoi ( versiontup[1]) % 2:
branch_str = 'development-branch'