From: Jan Nieuwenhuizen Date: Sat, 25 Aug 2001 16:16:05 +0000 (+0200) Subject: patch::: 1.5.7.jcn2 X-Git-Tag: release/1.5.8~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1cc9a861dceeb8091853ebcc0c9a9306b012457f;p=lilypond.git patch::: 1.5.7.jcn2 1.5.7 ===== * Arpeggios can now have arrows on the top or bottom to determine their direction, and a chord can be bracketed to indicate no arpeggio. (Chris Jackson) --- diff --git a/CHANGES b/CHANGES index 843016ab2a..a4e58973ac 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +1.5.7 +===== + +* Arpeggios can now have arrows on the top or bottom to determine + their direction, and a chord can be bracketed to indicate no + arpeggio. (Chris Jackson) + 1.5.6.jcn2 ========= diff --git a/Documentation/topdocs/AUTHORS.texi b/Documentation/topdocs/AUTHORS.texi index 269c1aeb01..67b08d605f 100644 --- a/Documentation/topdocs/AUTHORS.texi +++ b/Documentation/topdocs/AUTHORS.texi @@ -33,6 +33,8 @@ list is alphabetically ordered. American chord names, gnu-windows testing @item @email{bjoern.jacke@@gmx.de, Bjoern Jacke} German glossary stuff. +@item @email{chris-lilypond@@fluffhouse.org.uk, Chris Jackson} + Directed arpeggios and chord brackets. @item @email{nj104@@cus.cam.ac.uk, Neil Jerram}. parts of Documentation/Vocab* @item Donald Ervin Knuth, @uref{http://www-cs-staff.stanford.edu/~knuth/} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 1c9d14271e..63e051ab69 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1879,6 +1879,31 @@ 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-type = #'up + + \property Voice.Arpeggio \override #'arpeggio-type = #'down + + } +@end lilypond + +A square bracket on the left indicates that the player should not +arpeggiate the chord. + +@lilypond[fragment,relative,verbatim] + \context PianoStaff < + \property PianoStaff.connectArpeggios = ##t + \property PianoStaff.Arpeggio \override #'arpeggio-type = #'bracket + \context Voice = one { } + \context Voice = other { \clef bass } + > +@end lilypond + @refbugs It is not possible to mix connected arpeggios and unconnected arpeggios diff --git a/VERSION b/VERSION index 9df8ca014d..f7a846ab78 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 PATCH_LEVEL=7 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/regression/arpeggio.ly b/input/regression/arpeggio.ly index 1f956f90a0..82080d31c1 100644 --- a/input/regression/arpeggio.ly +++ b/input/regression/arpeggio.ly @@ -2,23 +2,40 @@ \header{ texidoc=" Arpeggios are supported, both cross-staff and broken single staff. +Directed arpeggios are indicated by arrows, while a square bracket +to the left prevents arpeggiation. " } -\score{ - \context PianoStaff < - \context Staff=one \notes\relative c''{ - \context Voice < fis,-\arpeggio d a > - %%\property PianoStaff.SpanArpeggio \override #'connect = ##t +\score { + \context PianoStaff < + \context Staff=one \notes\relative c'{ + \context Voice { + < a4 d fis-\arpeggio a > + \property Voice.Arpeggio \override #'arpeggio-type = #'bracket + < d fis-\arpeggio a d > + %%\property PianoStaff.SpanArpeggio \override #'connect = ##t \property PianoStaff.connectArpeggios = ##t - + + \property PianoStaff.Arpeggio \override #'arpeggio-type = #'bracket + + \property PianoStaff.connectArpeggios = ##f + \property Voice.Arpeggio \override #'arpeggio-type = #'down + + + } } - \context Staff=two \notes\relative c{ + \context Staff=two \notes\relative c { \clef bass - \context Voice < g b d-\arpeggio > - - } + \context Voice { + r4 r + + + \property Voice.Arpeggio \override #'arpeggio-type = #'up + + } + } > } diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 900949224c..2df39d285b 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -67,15 +67,40 @@ Arpeggio::brew_molecule (SCM smob) return SCM_EOL; } + SCM s = me->get_grob_property ("arpeggio-type"); + String arpegtype = ly_scm2string (scm_symbol_to_string (s)); + Molecule arpegbottom = ( (arpegtype=="bracket") ? + Font_interface::get_default_font (me)->find_by_name ("scripts-bracebottom") : + ((arpegtype=="down") ? + Font_interface::get_default_font (me)->find_by_name ("scripts-arrowdown") : + Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio")) + ); + Molecule arpegmiddle = ( (arpegtype=="bracket") ? + Font_interface::get_default_font (me)->find_by_name ("scripts-braceseg") : + Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio") ); + Molecule arpegtop = ( (arpegtype=="bracket") ? + Font_interface::get_default_font (me)->find_by_name ("scripts-bracetop") : + ((arpegtype=="up") ? + Font_interface::get_default_font (me)->find_by_name ("scripts-arrowup") : + Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio")) + ); + Molecule mol; - Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio"); - Real y = heads[LEFT]; - while (y < heads[RIGHT]) + + mol.add_at_edge (Y_AXIS, UP, arpegbottom, 0.0); + y+= arpegbottom. extent (Y_AXIS).length (); + + Grob * stem = unsmob_grob (gh_car ( me->get_grob_property ("stems") )); + Grob * ss = Staff_symbol_referencer::staff_symbol_l (stem); + + while (y < heads[RIGHT] - Staff_symbol::staff_space (ss)) { - mol.add_at_edge (Y_AXIS, UP,arpeggio, 0.0); - y+= arpeggio. extent (Y_AXIS).length (); + mol.add_at_edge (Y_AXIS, UP, arpegmiddle, 0.0); + y+= arpegmiddle. extent (Y_AXIS).length (); } + mol.add_at_edge (Y_AXIS, UP, arpegtop, 0.0); + mol.translate_axis (heads[LEFT], Y_AXIS); return mol.smobbed_copy () ; diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index bdb0ef8757..95c0a7a3df 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -766,6 +766,81 @@ fet_beginchar("Arpeggio","arpeggio","arpeggio"); draw_arpeggio; fet_endchar; +% Arrowhead nestles underneath / on top of the arpeggio symbol + +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/4rthick, alpha); + penpos3(rthin, alpha); + + 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; + + z10 = (0.5w, -0.5h); + z11 = (0, 0); + z12 = (w, 0); + + fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle; + + pickup pencircle scaled rthin; + draw z3 -- z10 -- z11; + draw z10 -- z12; + enddef; + +fet_beginchar("Arpeggio arrow down", "arrowdown", "arrowdown"); + draw_arpeggio_arrow; +fet_endchar; + +fet_beginchar("Arpeggio arrow up", "arrowup", "arrowup"); + draw_arpeggio_arrow; + currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space); +fet_endchar; + + +def draw_chordbrace_end = + save thinness; + set_char_box(0, staff_space#, 0, staff_space#); + pickup pencircle scaled stemthickness; + bot rt z1 = (w, -h); + bot lft z2 = (0, -h); + top lft z3 = (0, h); + draw z1 -- z2 -- z3; +enddef; + +fet_beginchar("Bottom of chord brace", "bracebottom", "bracebottom"); + draw_chordbrace_end; + labels (1, 2, 3); +fet_endchar; + +fet_beginchar("Top of chord brace", "bracetop", "bracetop"); + draw_chordbrace_end; + y_mirror_char; +fet_endchar; + +%% Same as a note stem, but only a staff-space long. +fet_beginchar("chord brace segment (up)", "braceseg", "braceseg") + set_char_box(stemthickness#/2, stemthickness#/2, 0, staff_space#); + pickup pencircle scaled stemthickness; + bot lft z1 = (0, 0); + top lft z2 = (0, h); + draw z1 -- z2; +fet_endchar; + % Extendable Trill symbol. % Not yet used % Rename me to Trill, rename Trill to Tr? diff --git a/scm/grob-description.scm b/scm/grob-description.scm index dc0fbd7a07..2ba7901255 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -28,6 +28,7 @@ (X-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . -1) (staff-position . 0.0) + (arpeggio-type . plain) (meta . ,(grob-description "Arpeggio" arpeggio-interface side-position-interface font-interface)) )) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 74dd0faf62..c32ecc7633 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -41,6 +41,11 @@ 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-type symbol? "Type of arpeggio. +up: a squiggly line with upward arrow, +down: a squiggly line with upward arrow, +bracket: a square bracket, +plain: a plain squiggly line (default)") (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