* scripts/convert-ly.py (conv): warn about dash-length.
* lily/dynamic-engraver.cc (try_music): end (de)crescendo
automatically if we get a new one.
* lily/lookup.cc (dashed_line): new function
* lily/line-spanner.cc (dashed_line_molecule): cleanups. Use
dash-fraction.
+2003-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * input/regression/hairpin-dashed.ly: new file.
+
+ * scripts/convert-ly.py (conv): warn about dash-length.
+
+ * lily/dynamic-engraver.cc (try_music): end (de)crescendo
+ automatically if we get a new one.
+
+ * lily/lookup.cc (dashed_line): new function
+
+ * lily/line-spanner.cc (dashed_line_molecule): cleanups. Use
+ dash-fraction.
+
2003-09-18 Heikki Junes <hjunes@cc.hut.fi>
* buildscripts/lilypond.words.py: extract note names.
2003-09-18 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/breathing-sign.cc: remove railtracks() function.
+
+ * input/regression/arpeggio-bracket.ly (texidoc): add file.
+
+ * lily/arpeggio.cc (brew_chord_bracket): clean-up
+ (brew_molecule): bugfix don't make arpeggio shorter when
+ arpeggio-direction is set.
+
* debian/rules: small corrections in the (Pedro K)
* Documentation/user/tutorial.itely (Tutorial): use lyinc in
@subsection Ambitus
@cindex ambitus
-The term @emph{ambitus} denotes a range of pitches for a given voice in
-a part of music. It also may denote the pitch range that a musical
-instrument is capable of playing. Most musical instruments have their
-ambitus standardized (or at least there is agreement upon the minimal
-ambitus of a particular type of instrument), such that a composer or
-arranger of a piece of music can easily meet the ambitus constraints of
-the targeted instrument. However, the ambitus of the human voice
-depends on individual physiological state, including education and
-training of the voice. Therefore, a singer potentially has to check for
-each piece of music if the ambitus of that piece meets his individual
-capabilities. This is why the ambitus of a piece may be of particular
-value to vocal performers.
+The term @emph{ambitus} (plural: ambituses) denotes a range of pitches
+for a given voice in a part of music. It also may denote the pitch
+range that a musical instrument is capable of playing. Most musical
+instruments have their ambitus standardized (or at least there is
+agreement upon the minimal ambitus of a particular type of
+instrument), such that a composer or arranger of a piece of music can
+easily meet the ambitus constraints of the targeted instrument.
+However, the ambitus of the human voice depends on individual
+physiological state, including education and training of the voice.
+Therefore, a singer potentially has to check for each piece of music
+if the ambitus of that piece meets his individual capabilities. This
+is why the ambitus of a piece may be of particular value to vocal
+performers.
The ambitus is typically notated on a per-voice basis at the very
beginning of a piece, e.g. nearby the initial clef or time signature of
@internalsref{Ambitus_engraver} to the @internalsref{Staff} context
rather than to the @internalsref{Voice} context.
-It is possible to tune individual ambiti for multiple voices on a
+It is possible to tune individual ambituses for multiple voices on a
single staff, for example by erasing or shifting them horizontally. An
example is in @inputfileref{input/test,ambitus-mixed.ly}
--- /dev/null
+
+\score {
+ \notes \relative c' {
+ \property Voice.Hairpin \set #'dash-fraction = #0.4
+ \property Voice.Hairpin \set #'dash-period = #1
+ f2\< g c1 d4\> b a gis\! }
+ }
texidoc = "Ambituses can be switched off or translated by using
applyoutput.
-If you want to mix per-voice and per-staff ambiti, then you have to
+If you want to mix per-voice and per-staff ambituses, then you have to
define you have to declare a new context type derived from the
@code{Voice} context or @code{Staff} context. The derived context
must consist of the @code{Ambitus_engraver} and it must be accepted by
return SCM_EOL;
}
+ SCM ad = me->get_grob_property ("arpeggio-direction");
Direction dir = CENTER;
- if (ly_dir_p (me->get_grob_property ("arpeggio-direction")))
+ if (ly_dir_p (ad))
{
- dir = to_dir (me->get_grob_property ("arpeggio-direction"));
+ dir = to_dir (ad);
}
Molecule mol;
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] - arrow_space)
+ Molecule arrow ;
+ if (dir)
{
- mol.add_at_edge (Y_AXIS, UP,squiggle, 0.0, 0);
- y+= squiggle. extent (Y_AXIS).length ();
+ arrow = fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir));
+ heads[dir] -= dir * arrow.extent (Y_AXIS).length();
}
+
+ for (Real y= heads[LEFT] ; y < heads[RIGHT];
+ y+= squiggle. extent (Y_AXIS).length ())
+ mol.add_at_edge (Y_AXIS, UP,squiggle, 0.0, 0);
+
mol.translate_axis (heads[LEFT], Y_AXIS);
if (dir)
- mol.add_at_edge (Y_AXIS, dir,
- fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir)), 0.0, 0);
+ mol.add_at_edge (Y_AXIS, dir,arrow, 0,0);
return mol.smobbed_copy () ;
}
Real dy = heads.length() + sp;
Real x = 0.7;
- Molecule l1 = Lookup::line (lt, Offset(0, 0), Offset (0, dy));
- Molecule bottom = Lookup::line (lt, Offset(0, 0), Offset (x, 0));
- Molecule top = Lookup::line (lt, Offset(0, dy), Offset (x, dy));
- Molecule mol;
- mol.add_molecule (l1);
- mol.add_molecule (bottom);
- mol.add_molecule (top);
+ Molecule mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x));
mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS);
return mol.smobbed_copy();
}
-/*
- Simplistic caesura.
- */
-MAKE_SCHEME_CALLBACK (Breathing_sign,railtracks,1);
-SCM
-Breathing_sign::railtracks (SCM smob)
-{
- Grob * me = unsmob_grob (smob);
- Real space = Staff_symbol_referencer::staff_space (me);
- Real th = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
- SCM lt = me->get_grob_property ("thickness");
- if (gh_number_p (lt))
- th *= gh_scm2double (lt);
-
- Offset x1 (0, -space);
- Offset x2 (space / 3, space);
- Molecule l1 (Lookup::line (th, x1, x2));
- Molecule l2 (l1);
- l2.translate_axis (space *0.6 , X_AXIS);
- l1.add_molecule (l2);
- return l1.smobbed_copy();
-}
-
/*
Gregorian chant divisio minima. (Actually, this was the original
breathing sign by Michael. -- jr)
|| m->is_mus_type ("crescendo-event"))
{
Direction d = to_dir (m->get_mus_property ("span-direction"));
+
accepted_spanreqs_drul_[d] = m;
+ if (current_cresc_ev_ && d == START)
+ accepted_spanreqs_drul_[STOP] = m;
return true;
}
return false;
endh = height;
}
+ /*
+ should do relative to staff-symbol staff-space?
+ */
+
+ Real period = 1.0;
+ s = me->get_grob_property ("dash-period");
+ if (gh_number_p (s))
+ period = gh_scm2double (s);
+
+ Real fraction = 1.0;
+ s = me->get_grob_property ("dash-fraction");
+ if (gh_number_p (s))
+ fraction = gh_scm2double (s);
+
/*
TODO: set line style.
*/
- Molecule mol = Lookup::line (thick,
+ Molecule mol = Lookup::dashed_line (thick,
Offset (0, starth),
- Offset (width, endh));
- mol.add_molecule (Lookup::line (thick,
+ Offset (width, endh),
+ period, fraction);
+ mol.add_molecule (Lookup::dashed_line (thick,
Offset (0, -starth),
- Offset (width, -endh)));
-
+ Offset (width, -endh),
+ period, fraction));
+
mol.translate_axis (x_points[LEFT]
- bounds[LEFT]->relative_coordinate (common, X_AXIS),
X_AXIS);
ADD_INTERFACE (Hairpin, "hairpin-interface",
"hairpin crescendo.",
- "grow-direction thickness height if-text-padding");
+ "dash-period dash-fraction grow-direction thickness height if-text-padding");
static Molecule round_filled_box (Box b, Real blotdiameter);
static Molecule repeat_slash (Real w, Real slope, Real th);
static Molecule line (Real th, Offset from, Offset to);
+ static Molecule dashed_line (Real th, Offset from, Offset to, Real, Real);
static Molecule horizontal_line (Interval w, Real th);
static Molecule triangle (Interval, Real, Real);
};
#include "font-interface.hh"
#include "warn.hh"
#include "align-interface.hh"
+#include "lookup.hh"
#include <math.h>
grob-properties. Make arbitrary paths.
*/
-
-/*
- slightishly clumsy interface?
-
- Make a Scheme expression for a line going from (0,0) to (dx,dy).
- */
-
-static SCM
-line_atom (Grob *me, Real thick, Real dx, Real dy)
+Molecule
+dashed_line_molecule (Grob *me, Real thick, Offset from, Offset to)
{
SCM type = me->get_grob_property ("style");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
-
- // maybe these should be in line-thickness?
- Real length = staff_space;
- SCM s = me->get_grob_property ("dash-length");
- if (gh_number_p (s))
- length = gh_scm2double (s) * staff_space;
+ if (type == ly_symbol2scm ("dotted-line")
+ || type == ly_symbol2scm ("dashed-line"))
+ {
+ Real fraction = (type == ly_symbol2scm ("dotted-line")) ? 0.0 : 0.4;
- Real period = 2 * length + thick;
- s = me->get_grob_property ("dash-period");
- if (gh_number_p (s))
- period = gh_scm2double (s) * staff_space;
- if (type == ly_symbol2scm ("dotted-line"))
- length = thick;
-
- if (type == ly_symbol2scm ("line"))
- length = period + thick;
+ SCM s = me->get_grob_property ("dash-fraction");
+ if (gh_number_p (s))
+ fraction = gh_scm2double (s);
+ fraction = (fraction >? 0) <? 1.0;
- Real on = length - thick;
- Real off = period - on;
-
- SCM list = scm_list_n (ly_symbol2scm ("dashed-line"),
- gh_double2scm (thick),
- gh_double2scm (on),
- gh_double2scm (off),
- gh_double2scm (dx),
- gh_double2scm (dy),
- SCM_UNDEFINED);
+ Real period = Staff_symbol_referencer::staff_space (me);
+ s = me->get_grob_property ("dash-period");
+ if (gh_number_p (s))
+ period *= gh_scm2double (s);
- return list;
+ return Lookup::dashed_line (thick, from, to, period, fraction);
+ }
+ else
+ {
+ return Lookup::line (thick, from, to);
+ }
}
-static SCM
-zigzag_atom (Grob *me, Real thick, Real dx, Real dy)
+Molecule
+zigzag_molecule (Grob *me, Real thick,
+ Offset from,
+ Offset to)
{
+ Offset dz = to -from;
+ Real dx = dz[X_AXIS];
+ Real dy = dz[Y_AXIS];
+
Real staff_space = Staff_symbol_referencer::staff_space (me);
SCM ws = me->get_grob_property ("zigzag-width");
SCM ls = me->get_grob_property ("zigzag-length");
gh_double2scm (dx),
gh_double2scm (dy),
SCM_UNDEFINED);
-
- return list;
+ Box b;
+ b.add_point (Offset (0,0));
+ b.add_point (dz);
+ b[X_AXIS].widen (thick/2);
+ b[Y_AXIS].widen (thick/2);
+
+ return Molecule (b, list);
}
MAKE_SCHEME_CALLBACK(Line_spanner, after_line_breaking, 1);
Offset to)
{
Offset dz = to -from ;
- Molecule mol;
SCM type = me->get_grob_property ("style");
if (gh_symbol_p (type)
&& (type == ly_symbol2scm ("line")
|| type == ly_symbol2scm ("zigzag")
|| (type == ly_symbol2scm ("trill") && dz[Y_AXIS] != 0)))
{
- Box b;
- b.add_point (Offset (0,0));
- b.add_point (dz);
- b[X_AXIS].widen (thick/2);
- b[Y_AXIS].widen (thick/2);
-
- SCM atom = (type == ly_symbol2scm ("zigzag"))
- ? zigzag_atom (me, thick, dz[X_AXIS], dz[Y_AXIS])
- : line_atom (me, thick, dz[X_AXIS], dz[Y_AXIS]);
-
- mol = Molecule (b, atom);
- mol.translate (from);
+ return (type == ly_symbol2scm ("zigzag"))
+ ? zigzag_molecule (me, thick, from, to)
+ : dashed_line_molecule (me, thick, from, to);
}
else if (gh_symbol_p (type)
&& type == ly_symbol2scm ("trill"))
gh_cons (style_alist,
alist_chain));
Molecule m = fm->find_by_name ("scripts-trill-element");
+ Molecule mol;
+
do
mol.add_at_edge (X_AXIS, RIGHT, m, 0,0);
while (m.extent (X_AXIS).length ()
+ mol.extent (Y_AXIS).length ())/2, Y_AXIS);
mol.translate (from);
+ return mol;
}
-
- return mol;
+ return Molecule();
}
/*
"gap is measured in staff-spaces.\n"
"The property 'type is one of: line, dashed-line, trill, dotted-line or zigzag.\n"
"\n",
- "gap dash-period dash-length zigzag-width zigzag-length thickness style");
+ "gap dash-period dash-fraction zigzag-width zigzag-length thickness style");
return Molecule (box, at);
}
+Molecule
+Lookup::dashed_line (Real thick, Offset from, Offset to,
+ Real dash_period, Real dash_fraction)
+{
+ dash_fraction = (dash_fraction >? 0) <? 1.0;
+ Real on = dash_fraction * dash_period + thick;
+ Real off = dash_period - on;
+
+ SCM at = scm_list_n (ly_symbol2scm ("dashed-line"),
+ gh_double2scm (thick),
+ gh_double2scm (on),
+ gh_double2scm (off),
+ gh_double2scm (to[X_AXIS] - from[X_AXIS]),
+ gh_double2scm (to[Y_AXIS] - from[Y_AXIS]),
+ SCM_UNDEFINED);
+
+ Box box;
+ box.add_point (Offset (0,0));
+ box.add_point (to - from);
+
+ box[X_AXIS].widen (thick/2);
+ box[Y_AXIS].widen (thick/2);
+
+ Molecule m = Molecule (box, at);
+ m.translate (from);
+ return m;
+}
+
Molecule
Lookup::horizontal_line (Interval w, Real th)
{
ADD_INTERFACE (Text_spanner,"text-spanner-interface",
"generic text spanner",
- "dash-period if-text-padding dash-length edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds width-correct");
+ "dash-period if-text-padding dash-fraction edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds width-correct");
(grob-property-description 'control-points list? "List of 4 offsets (number-pairs) that form control points for the tie/slur shape.")
(grob-property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams .")
-(grob-property-description 'dash-length number? "the length of a dash.")
(grob-property-description 'dash-period number? "the length of one dash + white space.")
+(grob-property-description 'dash-fraction number? "Size of the dashes, relative to dash-period. Should be between 0.0 (no line) and 1.0 (continuous line).")
(grob-property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.")
(grob-property-description 'descendens boolean? "is this neume of a descendent type?.")
(grob-property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
. (
(molecule-callback . ,Text_spanner::brew_molecule)
(font-family . roman)
- (style . line)
+ (style . dashed-line)
;; urg, only for (de)cresc. text spanners
(if-text-padding . 1.0)
(width-correct . -1)
+ (dash-fraction . 0.2)
+ (dash-period . 3.0)
(direction . 1)
(meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
))
(enclose-bounds . #t)
(width-correct . 0.0)
(style . dashed-line)
+ (dash-fraction . 0.3)
(edge-height . (0 . 1.5))
(direction . 1)
(meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))
remove \\outputproperty, move ly:verbose into ly:get-option'''))
+def conv (str):
+ if re.search ("dash-length",str):
+ sys.stderr.write ("""dash-length has been removed. Use dash-fraction instead.""")
+ raise FatalConversionError()
+ return str
+
+conversions.append (((1,9,8), conv, """dash-length -> dash-fraction""")
################################
# END OF CONVERSIONS