]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.5.7.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 25 Aug 2001 16:16:05 +0000 (18:16 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 25 Aug 2001 16:16:05 +0000 (18:16 +0200)
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)

CHANGES
Documentation/topdocs/AUTHORS.texi
Documentation/user/refman.itely
VERSION
input/regression/arpeggio.ly
lily/arpeggio.cc
mf/feta-schrift.mf
scm/grob-description.scm
scm/grob-property-description.scm

diff --git a/CHANGES b/CHANGES
index 843016ab2a1d3cac62dde3850030bbc43a6ed989..a4e58973acae86249e64128ce2349a7e7c18c5f6 100644 (file)
--- 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
 =========
  
index 269c1aeb01bcaa6a12a330182102ca203b27c88b..67b08d605f3a91dd8b29edf5e2fa9c32953d6708 100644 (file)
@@ -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/}
index 1c9d14271e92fee323dcf9931d71fc2985cb0d26..63e051ab692484be5d75668bfc29cde9caedcf6f 100644 (file)
@@ -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
+     <c\arpeggio e g c>
+     \property Voice.Arpeggio \override #'arpeggio-type = #'down
+     <c\arpeggio e g c>
+  }
+@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  { <c'\arpeggio e g c> }
+    \context Voice = other { \clef bass  <c,,\arpeggio e g>}
+  >  
+@end lilypond
+
 @refbugs
 
 It is not possible to mix connected arpeggios and unconnected arpeggios
diff --git a/VERSION b/VERSION
index 9df8ca014d05e64d7af1aab3029ab6d28f18ac9d..f7a846ab78175cea0cd35ecbc770f6c84ba1b914 100644 (file)
--- 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.
index 1f956f90a070e5773a3ba3d8ed06c38629a91c2d..82080d31c1dc16b6770085c7e8247c9f4ec4a620 100644 (file)
@@ -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
-            <fis,\arpeggio a c>
+            <b-\arpeggio d g b>
+            \property PianoStaff.Arpeggio \override #'arpeggio-type = #'bracket
+            <c-\arpeggio e g c>
+            \property PianoStaff.connectArpeggios = ##f
+            \property Voice.Arpeggio \override #'arpeggio-type = #'down
+            <a1-\arpeggio d fis a>
+
+           }
          }
-        \context Staff=two \notes\relative c{
+        \context Staff=two \notes\relative c {
             \clef bass
-           \context Voice < g b d-\arpeggio   >
-            <g\arpeggio b d>
-        }
+            \context Voice {
+            r4 r 
+            <d,\arpeggio a' d >
+            <d \arpeggio a' d >
+            \property Voice.Arpeggio \override #'arpeggio-type = #'up
+            <g1 \arpeggio b d g>
+           }
+         }
     >
 }
index 900949224c34ce87afb0529127e99b3b06f7562d..2df39d285b16713bc5a7cf46a8d7374ffba07685 100644 (file)
@@ -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 () ;
index bdb0ef87571255a68716dca3fe76b26f7b1f6bf5..95c0a7a3df83799c3058e7ffd1051613dca47898 100644 (file)
@@ -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?
index dc0fbd7a07376d092adad860f9620478da6a05d0..2ba790125560598ad9154b1e8d3f8f8f6c0d8d68 100644 (file)
@@ -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))
               ))
 
index 74dd0faf6237cd3e948961fb7e64b293020413a8..c32ecc7633ffd6b30d3a44ed2caba74cf4cbee78 100644 (file)
@@ -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