}
@end lilypond
+@subsection Unfolding repeats for MIDI output.
+
+@cindex expanding repeats
+
+See @file{input/test/unfold-all-repeats.ly}.
+
+
@refbugs
Notice that timing information is not remembered at the start of an
This command creates @code{Voice.Arpeggio} grobs. Cross staff arpeggios
are @code{PianoStaff.Arpeggio}.
+To add an arrow head to explicitly specify the direction of the
+arpeggio, you should set the arpeggio grob property
+@code{arpeggio-type}.
+
+@lilypond[fragment,relative,verbatim]
+ \context Voice {
+ \property Voice.Arpeggio \override #'arpeggio-direction = #1
+ <c\arpeggio e g c>
+ \property Voice.Arpeggio \override #'arpeggio-direction = #-1
+ <c\arpeggio e g c>
+ }
+@end lilypond
+
+@ignore
+A square bracket on the left indicates that the player should not
+arpeggiate the chord.
+
+@lil ypond[fragment,relative,verbatim]
+ \context PianoStaff <
+ \property PianoStaff.connectArpeggios = ##t
+ \property PianoStaff.Arpeggio \override #'arpeggio-direction = #'bracket
+ \context Voice = one { <c'\arpeggio e g c> }
+ \context Voice = other { \clef bass <c,,\arpeggio e g>}
+ >
+@ e nd lilypond
+@end ignore
+
+
@refbugs
It is not possible to mix connected arpeggios and unconnected arpeggios
\context PianoStaff <
\context Staff=one \notes\relative c''{
\context Voice < fis,-\arpeggio d a >
+ \property Staff.Arpeggio \override #'arpeggio-direction = #1
+ \context Voice < fis,-\arpeggio d a >
%%\property PianoStaff.SpanArpeggio \override #'connect = ##t
\property PianoStaff.connectArpeggios = ##t
<fis,\arpeggio a c>
\context Staff=two \notes\relative c{
\clef bass
\context Voice < g b d-\arpeggio >
+ \property Staff.Arpeggio \override #'arpeggio-direction = #-1
+ \context Voice < g b d-\arpeggio >
<g\arpeggio b d>
}
>
*/
return SCM_EOL;
}
+
+ Direction dir = CENTER;
+ if (isdir_b (me->get_grob_property ("arpeggio-direction")))
+ {
+ dir = to_dir (me->get_grob_property ("arpeggio-direction"));
+ }
Molecule mol;
- Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
+ Font_metric *fm =Font_interface::get_default_font (me);
+ Molecule squiggle = fm->find_by_name ("scripts-arpeggio");
+ Real arrow_space = (dir) ? Staff_symbol_referencer::staff_space (me) : 0.0;
+
Real y = heads[LEFT];
- while (y < heads[RIGHT])
+ while (y < heads[RIGHT] - arrow_space)
{
- mol.add_at_edge (Y_AXIS, UP,arpeggio, 0.0);
- y+= arpeggio. extent (Y_AXIS).length ();
+ mol.add_at_edge (Y_AXIS, UP,squiggle, 0.0);
+ y+= squiggle. extent (Y_AXIS).length ();
}
mol.translate_axis (heads[LEFT], Y_AXIS);
-
+ if (dir)
+ mol.add_at_edge (Y_AXIS, dir,
+ fm->find_by_name ("scripts-arpeggio-arrow-" + to_str (dir)), 0.0);
+
return mol.smobbed_copy () ;
}
static bool has_interface (Grob*);
static void find_musical_sequences (Grob*);
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+ DECLARE_SCHEME_CALLBACK (set_spacing_rods_and_seqs, (SCM ));
};
#endif /* SEPARATING_GROUP_SPANNER_HH */
}
}
+MAKE_SCHEME_CALLBACK (Separating_group_spanner,set_spacing_rods_and_seqs,1);
+SCM
+Separating_group_spanner::set_spacing_rods_and_seqs (SCM smob)
+{
+ set_spacing_rods (smob);
+ find_musical_sequences (unsmob_grob (smob));
+ return SCM_UNSPECIFIED;
+}
+
MAKE_SCHEME_CALLBACK (Separating_group_spanner,set_spacing_rods,1);
SCM
Separating_group_spanner::set_spacing_rods (SCM smob)
find_rods (rb, ly_cdr (s));
}
find_musical_sequences (me);
+
#if 0
/*
TODO; restore this.
&& lrank - rank == 1
&& llmus && !lmus && mus)
{
+ /*
+ these columns are adjacent, so set spacing-sequence in
+ IT.
+
+ Q Q+1 Q+2 (rank)
+ Note Clef Note
+
+ IT LAST LLAST
+
+ */
SCM seq = col->get_grob_property ("spacing-sequence");
col->set_grob_property ("spacing-sequence",
gh_cons (gh_cons (it->self_scm (), last->self_scm ()), seq));
+
+ /*
+ lcol can not be a loose column, so we make sure
+ that is and will not be marked as such.
+ */
+ lcol->set_grob_property ("between-cols" , SCM_BOOL_F);
}
else if (!lmus)
{
SCM between = lcol->get_grob_property ("between-cols");
+ if (between == SCM_BOOL_F)
+ continue;
+
if (!gh_pair_p (between))
{
between = gh_cons (it->self_scm (), llast->self_scm ());
name. This is better than using find_font directly,
esp. because that triggers mktextfm for non-existent
fonts. */
- SCM alist = scm_list_n (gh_cons (ly_symbol2scm ("font-family"),
- ly_symbol2scm ("braces")),
- gh_cons (ly_symbol2scm ("font-relative-size"),
- gh_int2scm (i)),
- SCM_UNDEFINED);
+ SCM br = ly_symbol2scm ("braces");
+ SCM fam = gh_cons (ly_symbol2scm ("font-family"), br);
+ SCM sz = gh_cons (ly_symbol2scm ("font-relative-size"), gh_int2scm (i));
+
+ SCM alist = scm_list_n (fam, sz, SCM_UNDEFINED);
fm = Font_interface::get_font (me, scm_list_n (alist, SCM_UNDEFINED));
/* Hmm, if lookup fails, we get cmr10 anyway */
if (ly_scm2string (ly_car (fm->description_)) == "cmr10")
% \consists "Repeat_engraver"
\consists "Volta_engraver"
\consists "Separating_line_group_engraver"
-
+ SeparatingGroupSpanner \override #'spacing-procedure
+ = #Separating_group_spanner::set_spacing_rods_and_seqs
\consists "Clef_engraver"
currentpicture := currentpicture shifted (height/2, width/2);
fet_endchar;
+
+
+%
+% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
+%
+
+def draw_arpeggio_arrow =
+ save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
+ pair ne, nw, se, sw;
+ height# = staff_space#;
+ width# = 0.8height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height,overshoot,width);
+ set_char_box(0, width#, 0, height#);
+ alpha := -40;
+ nw = dir (alpha+180);
+ sw = dir (alpha-90); se = dir alpha;
+
+ penpos1(rthin, alpha+90);
+ penpos2(5/4 rthick, alpha);
+ penpos3(5/4 rthick, 0);
+
+ z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
+ z2 = 2[z4,(width/2,height/2)];
+ z3 = (0.5 width, 0.5 height);
+ z4 = (0.25 staff_space, rthin);
+ z6 = z2l + 1/2rthin*sw;
+ z9 = (width/2, height) + overshoot*se;
+ fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
+
+ bot z10 = ( 0.5w, 0 );
+ lft z11 = (-0.3w, 0.8h);
+ rt z12 = ( 1.3w, 0.8h);
+ pickup pencircle scaled 0.5 rthin;
+ filldraw z3 -- z12 {dir -130} .. {dir -110} z10 {dir 110} .. {dir 130} z11 -- cycle;
+enddef;
+
+fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
+ draw_arpeggio_arrow;
+fet_endchar;
+
+
+fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
+ draw_arpeggio_arrow;
+ currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
+fet_endchar;
+
+
+
+
% Hmm
input feta-slag;
+
+
fet_endgroup("scripts");
(grob-property-description 'arch-width number? "width of the hook of a system brace.")
(grob-property-description 'arithmetic-basicspace number? "see @ref{spacing-spanner-interface}.")
(grob-property-description 'arithmetic-multiplier number? "see @ref{spacing-spanner-interface}.")
+(grob-property-description 'arpeggio-direction dir? "If set, put an
+arrow on the arpeggio squiggly line.")
(grob-property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end.")
(grob-property-description 'stem-attachment-function procedure? "Where
(lily-interface
'arpeggio-interface
"Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
- '(stems))
+ '(stems arpeggio-direction))
\botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}%
% Are we using PDFTeX? If so, use pdf definitions.
+% MiKTeX checks \pdfoutput the wrong way, makes our
+% check more complicated.
\ifx\pdfoutput\undefined
\input lily-ps-defs
\else
- \pdfoutput=1
- \input lily-pdf-defs
+ \ifx\pdfoutput\relax
+ \input lily-ps-defs
+ \else
+ \pdfoutput=1
+ \input lily-pdf-defs
+ \fi
\fi
\def\EndLilyPondOutput{%