* lily/beam.cc (get_direction_beam_count): New function.
2002-08-11 Jan Nieuwenhuizen <janneke@gnu.org>
+ * 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
+++ /dev/null
-\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!!!
- }
- >
-}
-
+++ /dev/null
-\version "1.5.68"
-
-\header {
-texidoc = "1st beam should prob. be horizontal."
-}
-
-\score { \notes <{ [ r8 g''16 des'] [r8 c16 a] }>}
+
#(set! point-and-click line-column-location)
forcedBreak = \notes { }
\translator {
\StaffContext
\remove "Clef_engraver"
- \remove "Staff_symbol_engraver"
+%% \remove "Staff_symbol_engraver"
}
}
}
\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
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"
}
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
>
\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 <a' g''>]
[c <c e,>]
[a'16 <a' g''>]
}
\paper{
- linewidth = 60.0\mm
+ linewidth = 66.0\mm
}
}
{
Direction d = get_default_dir (me);
- consider_auto_knees (me, d);
+ consider_auto_knees (me);
set_stem_directions (me, d);
connect_beams (me);
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))
Int_set gaps;
gaps.set_full ();
-
Link_array<Grob> stems=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
}
bool
-Beam::knee_b (Grob*me)
+Beam::knee_b (Grob* me)
{
SCM k = me->get_grob_property ("knee");
if (gh_boolean_p (k))
return knee;
}
+int
+Beam::get_direction_beam_count (Grob *me, Direction d )
+{
+ Link_array<Grob>stems =
+ 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.
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,
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);