From: Jan Nieuwenhuizen Date: Sun, 11 Aug 2002 17:42:15 +0000 (+0000) Subject: * lily/stem.cc (calc_stem_info): Use get_direction_beam_count. X-Git-Tag: release/1.5.72~7 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=5047559815e59d5892341003cbf6da949857a4c1;p=lilypond.git * lily/stem.cc (calc_stem_info): Use get_direction_beam_count. * lily/beam.cc (get_direction_beam_count): New function. --- diff --git a/ChangeLog b/ChangeLog index 0ff7486043..021c84da94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2002-08-11 Jan Nieuwenhuizen + * input: some fixes. + + * lily/stem.cc (calc_stem_info): Use get_direction_beam_count. + + * lily/beam.cc (get_direction_beam_count): New function. + * GNUmakefile.in: Fix config.h dependency. * input/test/beam-dir-function.ly: Fix for new default diff --git a/input/bugs/melisma-tie-rest.ly b/input/bugs/melisma-tie-rest.ly deleted file mode 100644 index 435048354c..0000000000 --- a/input/bugs/melisma-tie-rest.ly +++ /dev/null @@ -1,24 +0,0 @@ -\header{ - texidoc = "Lyric extenders that start because of an autmatic tie melisma, -extend during a subsequent rest, and cannot be forced to stop." -} -\score{ - < - \addlyrics - \context Staff = soprano { - \property Staff.automaticMelismata = ##t - \context Voice=soprano\notes\relative c'' { - c4 ~ c r2 r1 c - c4 ~ c - \melismaEnd - \property Staff.tieMelismaBusy = ##f - r2 r1 c - } - } - \context Lyrics = "soprano-1" \lyrics { - hey __ stop? - hey __ STOP!!! - } - > -} - diff --git a/input/bugs/steep-beam.ly b/input/bugs/steep-beam.ly deleted file mode 100644 index 6f37eb3373..0000000000 --- a/input/bugs/steep-beam.ly +++ /dev/null @@ -1,7 +0,0 @@ -\version "1.5.68" - -\header { -texidoc = "1st beam should prob. be horizontal." -} - -\score { \notes <{ [ r8 g''16 des'] [r8 c16 a] }>} diff --git a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly index 6f78570d62..b2ab3df550 100644 --- a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly +++ b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly @@ -1,4 +1,5 @@ + #(set! point-and-click line-column-location) forcedBreak = \notes { } diff --git a/input/regression/abe.ly b/input/regression/abe.ly index ecf0fd8f2e..d2e948b0df 100644 --- a/input/regression/abe.ly +++ b/input/regression/abe.ly @@ -15,7 +15,7 @@ texidoc="Automatic beamer behaves nicely." \translator { \StaffContext \remove "Clef_engraver" - \remove "Staff_symbol_engraver" +%% \remove "Staff_symbol_engraver" } } } diff --git a/input/regression/lyric-combine.ly b/input/regression/lyric-combine.ly index 3a72cb4d48..98c51a104e 100644 --- a/input/regression/lyric-combine.ly +++ b/input/regression/lyric-combine.ly @@ -2,7 +2,7 @@ \header{ texidoc=" Lyrics can be set to a melody automatically. Excess lyrics will be -dumped. Lyrics will not be set over rests. You can have melismata +discarded. Lyrics will not be set over rests. You can have melismata either by setting a property melismaBusy, or by setting automaticMelismas (which will set melismas during slurs and ties). If you want a different order than first Music, then Lyrics, you must @@ -11,14 +11,6 @@ precook a chord of staves/lyrics and label those. Of course extenders do not assume anything about lyric lengths, so they continue to work. " - - -filename = "twinkle-pop.ly" -xtitle = "Ah, vous dirais-je, maman " -description = "twinkle twinkle in pop-song-settings" -composer = "traditional" -enteredby = "HWN, chords by Johan Vromans" -copyright = "public domain" } @@ -26,26 +18,26 @@ copyright = "public domain" m = \notes \relative c'' { \property Staff.automaticMelismata = ##t \autoBeamOff - g4 r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4 + g8 () a r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4 \emptyText d8.^"melisma" \melisma c16 \melismaEnd b } -noisebeat = \notes \relative c'' {g16 g g g } -noise = { \noisebeat \noisebeat \noisebeat \noisebeat \noisebeat \noisebeat } -textI = \lyrics { la2 __ la -- la __ la la la la la } -textII = \lyrics { da -- da __ da -- da da da da da } +noise = \repeat unfold 6 \notes \relative c'' {g16 g g g } +q +textI = \context LyricsVoice = "middle-1" \lyrics { la2 __ la -- la __ la la la la la } +textII = \context LyricsVoice = "middle-1" \lyrics { da -- da __ da -- da da da da da } \score { - \notes < \context Staff = SA \m + \notes < \context Staff = SA \noise \context Lyrics = LA { s1 } \context Staff = SB { s1 } \context Lyrics = LB { s1 } \context Staff = SC \noise \addlyrics - \context Staff = SB \m + \context Staff = SB \context Voice="middle" \m < \context Lyrics = LA \textI \context Lyrics = LB \textII > diff --git a/input/test/beam-chord.ly b/input/test/beam-chord.ly index 268998f916..fba54aa63b 100644 --- a/input/test/beam-chord.ly +++ b/input/test/beam-chord.ly @@ -1,10 +1,17 @@ \version "1.5.68" - +\header { +texidoc = "Hmm. what's this supposed to test?" +} \score{ \notes\transpose c'{ - \property Score.beamQuantisation = #'none - +\property Voice.Beam \set #'position-callbacks = + #`(,Beam::least_squares + ,Beam::check_concave + ,Beam::slope_damping + ,Beam::shift_region_to_valid + + ) [a'8 ] [c ] [a'16 ] @@ -14,6 +21,6 @@ } \paper{ - linewidth = 60.0\mm + linewidth = 66.0\mm } } diff --git a/lily/beam.cc b/lily/beam.cc index d3e2d0b525..8c06658d4a 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -161,7 +161,7 @@ Beam::before_line_breaking (SCM smob) { Direction d = get_default_dir (me); - consider_auto_knees (me, d); + consider_auto_knees (me); set_stem_directions (me, d); connect_beams (me); @@ -625,7 +625,7 @@ struct Int_set knee-beams, should set the directions manually. */ void -Beam::consider_auto_knees (Grob* me, Direction d) +Beam::consider_auto_knees (Grob* me) { SCM scm = me->get_grob_property ("auto-knee-gap"); if (!gh_number_p (scm)) @@ -636,7 +636,6 @@ Beam::consider_auto_knees (Grob* me, Direction d) Int_set gaps; gaps.set_full (); - Link_array stems= Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems"); @@ -1444,7 +1443,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) } bool -Beam::knee_b (Grob*me) +Beam::knee_b (Grob* me) { SCM k = me->get_grob_property ("knee"); if (gh_boolean_p (k)) @@ -1469,6 +1468,26 @@ Beam::knee_b (Grob*me) return knee; } +int +Beam::get_direction_beam_count (Grob *me, Direction d ) +{ + Link_arraystems = + Pointer_group_interface__extract_grobs (me, (Grob*) 0, "stems"); + int bc = 0; + + for (int i = stems.size (); i--;) + { + /* + Should we take invisible stems into account? + */ + if (Stem::get_direction (stems[i]) == d) + bc = bc >? (Stem::beam_multiplicity (stems[i]).length () + 1); + } + + return bc; +} + + ADD_INTERFACE (Beam, "beam-interface", "A beam. diff --git a/lily/include/beam.hh b/lily/include/beam.hh index b9d74d91ab..b06afc0e4e 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -48,11 +48,12 @@ public: Real, Real, Real, Real, int, Direction, Direction); - + + static int get_direction_beam_count (Grob *me, Direction d); private: static Direction get_default_dir (Grob*); static void set_stem_directions (Grob*, Direction ); - static void consider_auto_knees (Grob*, Direction d); + static void consider_auto_knees (Grob*); static void set_stem_shorten (Grob*); static Real calc_stem_y (Grob*, Grob* s, Grob**c, Real, Real, diff --git a/lily/stem.cc b/lily/stem.cc index 20c5bc79e8..2ed0f4fb78 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -804,7 +804,7 @@ Stem::calc_stem_info (Grob*me) Real half_space = staff_space / 2; Grob * beam = get_beam (me); - int beam_count = beam_multiplicity(me).length()+1; + int beam_count = Beam::get_direction_beam_count (beam, mydir); Real beam_translation= Beam::get_beam_translation (beam); Real thick = gh_scm2double (beam->get_grob_property ("thickness")); Real note_start = chord_start_y (me);