From d9a5aa8fc7317f62d760023c22c4bfd7caa77052 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:03:38 +0000 Subject: [PATCH] lilypond-1.5.17 --- Documentation/user/refman.itely | 35 ++++++++++++++++ input/regression/arpeggio.ly | 4 ++ lily/arpeggio.cc | 22 +++++++--- lily/include/separating-group-spanner.hh | 1 + lily/separating-group-spanner.cc | 29 +++++++++++++ lily/system-start-delimiter.cc | 10 ++--- ly/engraver-init.ly | 3 +- mf/feta-schrift.mf | 52 ++++++++++++++++++++++++ scm/grob-property-description.scm | 2 + scm/interface-description.scm | 2 +- tex/lilyponddefs.tex | 10 ++++- 11 files changed, 156 insertions(+), 14 deletions(-) diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index fac04df277..093637d504 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1621,6 +1621,13 @@ the specified number of repeats. } @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 @@ -1907,6 +1914,34 @@ to the chords in both staves, and set 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 + + \property Voice.Arpeggio \override #'arpeggio-direction = #-1 + + } +@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 { } + \context Voice = other { \clef bass } + > +@ e nd lilypond +@end ignore + + @refbugs It is not possible to mix connected arpeggios and unconnected arpeggios diff --git a/input/regression/arpeggio.ly b/input/regression/arpeggio.ly index 1f956f90a0..405098dd6c 100644 --- a/input/regression/arpeggio.ly +++ b/input/regression/arpeggio.ly @@ -11,6 +11,8 @@ Arpeggios are supported, both cross-staff and broken single staff. \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 @@ -18,6 +20,8 @@ Arpeggios are supported, both cross-staff and broken single staff. \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 > } > diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 5b0e755577..931030a16c 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -66,18 +66,30 @@ Arpeggio::brew_molecule (SCM smob) */ 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 () ; } diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index c394821df4..848b429104 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -21,6 +21,7 @@ public: 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 */ diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index f989389674..66935cbd4a 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -71,6 +71,15 @@ Separating_group_spanner::find_rods (Item * r, SCM next) } } +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) @@ -96,6 +105,7 @@ Separating_group_spanner::set_spacing_rods (SCM smob) find_rods (rb, ly_cdr (s)); } find_musical_sequences (me); + #if 0 /* TODO; restore this. @@ -162,14 +172,33 @@ Separating_group_spanner::find_musical_sequences (Grob *me) && 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 ()); diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 48522d74c6..ef0b23afee 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -143,11 +143,11 @@ System_start_delimiter::staff_brace (Grob*me, Real y) 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") diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 450d5b7784..c70ccf51f9 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -18,7 +18,8 @@ StaffContext=\translator { % \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" diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index bdb0ef8757..b0481341a7 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -782,8 +782,60 @@ fet_beginchar("Trill-element","trill-element","trill-element"); currentpicture := currentpicture shifted (height/2, width/2); fet_endchar; + + +% +% Arpeggio arrow by Chris Jackson +% + +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"); diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 85a6b931f4..6920e911be 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -45,6 +45,8 @@ This procedure is called (using dependency resolution) after line breaking. Retu (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 diff --git a/scm/interface-description.scm b/scm/interface-description.scm index 9d2249cac2..60b76f8d79 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -374,7 +374,7 @@ padding -- horizontal padding. This is useful if a crescendo is set next to a te (lily-interface 'arpeggio-interface "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads." - '(stems)) + '(stems arpeggio-direction)) diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 0b00c76eb1..bc30d54039 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -55,11 +55,17 @@ \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{% -- 2.39.5