}
-twovoice = \context Staff \notes <
- \context Voice=i { \stemDown c4 d e f g2~ g4 a [c8 d e f] c2| }
- \context Voice=ii { \stemUp g4 f e g ~ g2 g2 c4 g4 g2 }
+twovoice =
+\notes \relative c' \context Staff \notes <
+ \context Voice=i { \stemDown c4 c d d e e f f }
+ \context Voice=ii { \stemUp g4 f f e e d d c }
>
-twovoicesteminvert = \context Staff \notes <
- % the f and g on 4th beat are exceptionally ugh.
- \context Voice=i { \stemUp c4 d e f g2 g4 a | }
- \context Voice=ii { \stemDown g4 f e g g2 g2 }
+twovoicechords = \context Staff \notes <
+ \context Voice = i \relative c' {
+ \stemUp e4 d c b a g f
+ }
+ \context Voice = ii \relative c' {
+ \stemDown <a4 c> <a4 c> <a4 c> <a4 c> <a c>
+ <a c> <a c>
+ }
>
+
threevoice = \context Staff \notes <
\context Voice=i { \stemUp g4 f e f g a g2 }
- \context Voice=ii { \stemUp \property Voice.NoteColumn \override #'horizontal-shift = #1
- e2 e2 e2 e2 }
+ \context Voice=ii { \stemUp \shiftOn
+ e4 e e e e e e e }
\context Voice=iii { \stemDown c4 d e d c d es }
>
-chordstest = \context Staff \notes <
- \context Voice = i \relative c {
- \stemUp e4 dis c f g f a b b
- }
- \context Voice = ii \relative c {
- \stemDown <a4 c> <a4 c> <a4 e'> <a4 c> <e' a> <e a> <e a> <a c> <a d>
- }
->
-
hairyChord = \context Staff \notes\relative c' <
\context Voice=one {
- \property Voice.NoteColumn \override #'horizontal-shift = #0
+\shiftOff
\stemUp
e4
}
\context Voice=two {
\stemUp
+ \shiftOn
\property Voice.NoteColumn \override #'horizontal-shift = #1
cis
}
- \context Voice=three {
- \property Voice.NoteColumn \override #'horizontal-shift = #2
-
+ \context Voice=three { \shiftOnn
\stemUp
ais
}
\context Voice=four {
\stemDown
- \property Voice.NoteColumn \override #'horizontal-shift = #1
+ \shiftOn
fis
}
\score{
- \notes \transpose c'' { \twovoice
- \twovoicesteminvert
- \threevoice \break
- \chordstest
+ \notes \transpose c'' {
+ \twovoice
+ \twovoicechords
+
+ \threevoice
\hairyChord
}
Grob * nd_l = Note_column::first_head (cd);
+
+ /*
+ this case (distant half collide),
+
+ |
+ x |
+ | x
+ |
+
+ the noteheads may be closer than this case (close half collide)
+
+ |
+ |
+ x
+ x
+ |
+ |
+
+ */
- bool half_collide = false;
+ bool close_half_collide = false;
+ bool distant_half_collide = false;
bool full_collide = false;
/*
bool touch = (ups[0] - dps.top () >= 0);
- bool merge_possible = (ups[0] >= dps[0]) && (ups.top () <= dps.top ());
+ bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
merge_possible = merge_possible &&
Rhythmic_head::balltype_i (nu_l) == Rhythmic_head::balltype_i (nd_l);
if (abs (ups[i] - dps[j]) == 1)
{
merge_possible = false;
- half_collide = true;
+ if (ups[i] > dps[j])
+ close_half_collide = true;
+ else
+ distant_half_collide = true;
}
else if (ups[i]==dps[j])
full_collide = true;
Real shift_amount = 1;
- if ( touch)
+ if (touch)
shift_amount *= -1;
- else
+
/*
for full collisions, the right hand head may obscure dots, so
make sure the dotted heads go to the right.
*/
- if ((Rhythmic_head::dot_count (nu_l) < Rhythmic_head::dot_count (nd_l)
- && full_collide))
- shift_amount *= -1;
+ if ((Rhythmic_head::dot_count (nu_l) > Rhythmic_head::dot_count (nd_l)
+ && full_collide))
+ shift_amount = 1;
+ /*
+ TODO: these numbers are magic; should devise a set of grob props
+ to tune this behavior. */
+
if (merge_possible)
shift_amount *= 0.0;
- else if (half_collide || full_collide)
+ else if (close_half_collide && !touch)
+ shift_amount *= 0.52;
+ else if (distant_half_collide && !touch)
+ shift_amount *= 0.4;
+ else if (distant_half_collide || close_half_collide || full_collide)
shift_amount *= 0.5;
+ /*
+ we're meshing.
+ */
+ else if (Rhythmic_head::dot_count (nu_l) || Rhythmic_head::dot_count (nd_l))
+ shift_amount *= 0.1;
else
shift_amount *= 0.25;
check_meshing_chords (me, &offsets, extents, clash_groups);
-#if 0
- /*
- if the up and down version are close, and can not be merged, move
- all of them again. */
- if (extents[UP].size () && extents[DOWN].size ())
- {
- Grob *cu_l =clash_groups[UP][0];
- Grob *cd_l =clash_groups[DOWN][0];
-
-
- /*
- TODO.
- */
- Grob * nu_l= Note_column::first_head (cu_l);
- Grob * nd_l = Note_column::first_head (cd_l);
-
- int downpos = Note_column::head_positions_interval (cd_l)[BIGGER];
- int uppos = Note_column::head_positions_interval (cu_l)[SMALLER];
-
- bool merge =
- downpos == uppos
- && Rhythmic_head::balltype_i (nu_l) == Rhythmic_head::balltype_i (nd_l);
-
-
- if (!to_boolean (me->get_grob_property ("merge-differently-dotted")))
- merge = merge && Rhythmic_head::dot_count (nu_l) == Rhythmic_head::dot_count (nd_l);
-
- /*
- notes are close, but can not be merged. Shift
- */
- if (abs (uppos - downpos) < 2 && !merge)
- do
- {
- for (int i=0; i < clash_groups[d].size (); i++)
- {
- if(Rhythmic_head::dot_count (nu_l) > Rhythmic_head::dot_count (nd_l))
- offsets[d][i] += d * 0.5;
- else
- offsets[d][i] -= d * 0.5;
- }
- }
- while ((flip (&d))!= UP);
- }
-#endif
-
do
{
for (int i=0; i < clash_groups[d].size (); i++)