summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2008-05-01 18:52:39 -0300
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2008-05-01 18:52:39 -0300
commit1e45e3c5904f2eb7df2e0cbbd8d2b51b80bf282c (patch)
tree38cd45fe957fdb194cf211e5feac546eb6ca57a2
parenta8018f8eb0b76dbeaca33982d3306bcdafe372bb (diff)
Fix #455.
Add a vertical slur arpeggio. Tuning / parameterizing the code is left as an excercise to the user.
-rw-r--r--input/regression/arpeggio-parenthesis.ly17
-rw-r--r--lily/arpeggio.cc32
-rw-r--r--lily/include/arpeggio.hh1
3 files changed, 46 insertions, 4 deletions
diff --git a/input/regression/arpeggio-parenthesis.ly b/input/regression/arpeggio-parenthesis.ly
new file mode 100644
index 0000000000..b6660153ed
--- /dev/null
+++ b/input/regression/arpeggio-parenthesis.ly
@@ -0,0 +1,17 @@
+
+\header {
+
+ texidoc = "There is a variant of the arpeggio sign that uses a
+ `vertical slur' instead of the wiggle."
+
+}
+
+\version "2.11.46"
+
+\relative c' {
+ \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
+
+ % Note: does not work for cross staff arpeggios.
+ \override Arpeggio #'X-extent = #ly:grob::stencil-width
+ <c g' c>2\arpeggio ~ c
+}
diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc
index fe7b116821..a5c070398e 100644
--- a/lily/arpeggio.cc
+++ b/lily/arpeggio.cc
@@ -8,15 +8,16 @@
#include "arpeggio.hh"
+#include "bezier.hh"
+#include "font-interface.hh"
#include "grob.hh"
+#include "lookup.hh"
#include "output-def.hh"
-#include "stem.hh"
+#include "pointer-group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
+#include "stem.hh"
#include "warn.hh"
-#include "font-interface.hh"
-#include "lookup.hh"
-#include "pointer-group-interface.hh"
Grob *
Arpeggio::get_common_y (Grob *me)
@@ -136,6 +137,29 @@ Arpeggio::brew_chord_bracket (SCM smob)
return mol.smobbed_copy ();
}
+MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_slur, 1);
+SCM
+Arpeggio::brew_chord_slur (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Interval heads = robust_scm2interval (me->get_property ("positions"),
+ Interval())
+ * Staff_symbol_referencer::staff_space (me);
+
+ Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
+ Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
+ Real dy = heads.length ();
+
+ Real height_limit = 1.5;
+ Real ratio = .33;
+ Bezier curve = slur_shape (dy, height_limit, ratio);
+ curve.rotate (M_PI / 2);
+
+ Stencil mol (Lookup::slur (curve, lt, lt));
+ mol.translate_axis (heads[LEFT], Y_AXIS);
+ return mol.smobbed_copy ();
+}
+
/*
We have to do a callback, because print () triggers a
vertical alignment if it is cross-staff.
diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh
index 7db201bb00..373045bfca 100644
--- a/lily/include/arpeggio.hh
+++ b/lily/include/arpeggio.hh
@@ -20,6 +20,7 @@ public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
+ DECLARE_SCHEME_CALLBACK (brew_chord_slur, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
DECLARE_SCHEME_CALLBACK (height, (SCM));
DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));