}
@end lilypond
+Possible symbols for the @code{break-align-symbols} list are
+@code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
+@code{staff-bar}, @code{left-edge}, @code{key-cancellation},
+@code{key-signature}, and @code{time-signature}.
+
The text marks will, by default, be aligned with the middle of the notation
object, but this can be changed by overriding the
@code{break-align-anchor-alignment} and
\once \override Staff.KeySignature #'break-align-anchor-alignment = #RIGHT
\mark \default
ces1
+ \key cis \major
- % the RehearsalMark will be aligned with the right edge of the KeySignature
- % and then shifted right by an additional 2 units.
+ % the RehearsalMark will be aligned with the left edge of the KeySignature
+ % and then shifted right by 2 units.
\once \override Staff.KeySignature #'break-align-anchor = #2
\mark \default
ces1
See @ref{The Feta font}, for a list of symbols which may be
printed with @code{\musicglyph}.
-The horizontal location of rehearsal marks can be adjusted by
-setting @code{break-align-symbol}
-
-@lilypond[fragment,quote,ragged-right,verbatim,relative]
-c1
-\key cis \major
-\clef alto
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
-\mark "on-key"
-cis
-\key ces \major
-\override Score.RehearsalMark #'break-align-symbols = #'(clef)
-\clef treble
-\mark "on clef"
-ces
-@end lilypond
-
-@code{break-align-symbol} may also accept the following values:
-@code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
-@code{staff-bar}, @code{left-edge}, @code{key-cancellation},
-@code{key-signature}, and @code{time-signature}. Setting
-@code{break-align-symbol} will only have an effect if the symbol
-appears at that point in the music.
-
+For common tweaks to the positioning of rehearsal marks, see @ref{Text marks}.
@seealso
--- /dev/null
+\version "2.11.29"
+
+\header {
+ texidoc = "Slurs that depend on a cross-staff beam are not calculated until after line-breaking."
+}
+
+\paper{ ragged-right=##t }
+\score {
+ \new PianoStaff <<
+ \context Staff = rh \relative { c'8([ d) \change Staff = lh c,] }
+ \context Staff = lh { s4. }
+ >>
+}
\ No newline at end of file
--- /dev/null
+\version "2.11.29"
+
+\header {
+ texidoc = "When space-to-barline is false, we measure the space between the note and the
+start of the clef. When space-to-barline is true, we measure the space between the note and
+the start of the barline."
+}
+
+\paper {ragged-right = ##t}
+
+{
+ \override Score.SpacingSpanner #'common-shortest-duration = #(ly:make-moment 1 16)
+ c'2 \clef bass c'2 \clef treble
+ \override NoteSpacing #'space-to-barline = ##f
+ c'2 \clef bass c'2 \clef treble
+
+ % the following two measures should be spaced identically
+ \override NoteSpacing #'space-to-barline = ##t
+ c'2 c'2
+ \override NoteSpacing #'space-to-barline = ##f
+ c'2 c'2
+ c'1
+}
\ No newline at end of file
/* If we have a NonMusical column on the right, we measure the ideal distance
to the bar-line (if present), not the start of the column. */
- if (!Paper_column::is_musical (right_col) && !skys[RIGHT].is_empty ())
+ if (!Paper_column::is_musical (right_col)
+ && !skys[RIGHT].is_empty ()
+ && to_boolean (me->get_property ("space-to-barline")))
{
Grob *bar = Pointer_group_interface::find_grob (right_col,
ly_symbol2scm ("elements"),
Bar_line::has_interface);
if (bar)
- ideal -= bar->extent (right_col, X_AXIS)[LEFT];
+ {
+ Real shift = bar->extent (right_col, X_AXIS)[LEFT];
+ ideal -= shift;
+ min_desired_space -= max (shift, 0.0);
+ }
+ else
+ ideal -= right_col->extent (right_col, X_AXIS)[RIGHT];
}
ideal = max (ideal, min_desired_space);
stem_dir_correction (me, right_col, increment, &ideal, &min_desired_space);
- Spring ret (ideal, min_dist);
+ Spring ret (max (0.0, ideal), min_dist);
ret.set_inverse_compress_strength (max (0.0, ideal - min_desired_space));
ret.set_inverse_stretch_strength (max (0.1, base_space - increment));
return ret;
"right-items "
"same-direction-correction "
"stem-spacing-correction "
+ "space-to-barline "
);
#include "system.hh"
#include "international.hh"
#include "accidental-placement.hh"
+#include "accidental-interface.hh"
#include "axis-group-interface.hh"
#include "context.hh"
#include "note-spacing.hh"
Item *elem = items_[i];
Grob *col = Item::is_non_musical (elem) ? command_column_ : musical_column_;
- if (!elem->get_parent (X_AXIS)
- || !unsmob_grob (elem->get_object ("axis-group-parent-X")))
- {
- Axis_group_interface::add_element (col, elem);
- }
- else if (Accidental_placement::has_interface (elem))
+ if (!elem->get_parent (X_AXIS))
+ elem->set_parent (col, X_AXIS);
+ if (!unsmob_grob (elem->get_object ("axis-group-parent-X")))
+ elem->set_object ("axis-group-parent-X", col->self_scm ());
+
+ if (Accidental_placement::has_interface (elem))
Separation_item::add_conditional_item (col, elem);
- else
+ else if (!Accidental_interface::has_interface (elem))
Separation_item::add_item (col, elem);
}
items_.clear ();
}
while (flip (&d) != LEFT);
+ skys[RIGHT].merge (Separation_item::conditional_skyline (right, left));
+
return max (0.0, skys[LEFT].distance (skys[RIGHT]));
}
#include "bezier.hh"
#include "directional-element-interface.hh"
#include "font-interface.hh"
+#include "item.hh"
#include "pointer-group-interface.hh"
#include "lookup.hh"
#include "main.hh" // DEBUG_SLUR_SCORING
extract_grob_set (me, "note-columns", cols);
extract_grob_set (me, "encompass-objects", extras);
+ for (vsize i = 0; i < cols.size (); i++)
+ {
+ if (Grob *s = Note_column::get_stem (cols[i]))
+ if (to_boolean (s->get_property ("cross-staff")))
+ return SCM_BOOL_T;
+ }
+
/* the separation items are dealt with in replace_breakable_encompass_objects
so we can ignore them here */
vector<Grob*> non_sep_extras;
Real base = note_spacing (me, lc, rc, options);
Spring spring = Note_spacing::get_spacing (sp, rc, base, options->increment_);
- dists[d] = max (dists[d], spring.distance () - options->increment_);
+ dists[d] = max (dists[d], spring.min_distance ());
}
else if (Staff_spacing::has_interface (sp))
{
this will add a new column to RIGHT-ITEMS. Here we look at the
columns, and return the left-most. If there are multiple columns, we
prune RIGHT-ITEMS.
+
+ If we end up pruning, we add a left-neighbor to every column that
+ gets pruned. This ensures that loose columns in cross-staff music
+ do indeed get marked as loose. The problem situation is when a voice
+ passes from staff 1 to staff 2 and a clef appears later on in staff 1.
+ Then the NoteSpacing attached to the last note in staff 1 has two
+ right-items: one pointing to the next note in staff 2 and one pointing
+ to the clef. We will prune the clef right-item here and, unless we add
+ a left-neighbor to the clef, it won't get marked as loose.
*/
Item *
Spacing_interface::right_column (Grob *me)
mincol = col;
}
+ else if (rank > min_rank)
+ prune = true;
}
if (prune && a)
for (vsize i = right.size (); i--;)
{
if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
- right.erase (right.begin () + i);
+ {
+ extract_grob_set (right[i], "left-neighbors", lns);
+ if (lns.empty ())
+ Pointer_group_interface::add_grob (right[i],
+ ly_symbol2scm ("left-neighbors"),
+ dynamic_cast<Item*> (me)->get_column ());
+
+ right.erase (right.begin () + i);
+ }
}
}
of spacing tuples: @code{(@var{break-align-symbol} @var{type}
. @var{distance})}, where @var{type} can be the symbols
@code{minimum-space} or @code{extra-space}.")
+ (space-to-barline ,boolean? "If set, the distance between a note
+and the following non-musical column will be measured to the barline
+instead of to the beginning of the non-musical column. If there is a
+clef change followed by a barline, for example, this means that we will
+try to space the non-musical column as though the clef is not there.")
(spacing-increment ,number? "Add this much space for a doubled
duration. Typically, the width of a note head. See also
@internalsref{spacing-spanner-interface}.")
. (
(stem-spacing-correction . 0.5)
(same-direction-correction . 0.25)
+ (space-to-barline . #t)
;; Changed this from 0.75.
;; If you ever change this back, please document! --hwn
(knee-spacing-correction . 1.0)
let current_compiler = "lilypond"
" default make
-setlocal makeprg=lilypond $*
+setlocal makeprg=lilypond\ $*
" errorformat for lily (with columns) and gcc
" (how to see multiple-line error messages?)
setlocal errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m