@lilypondfile[printfilename]{lyrics-bar.ly}
+@lilypondfile[printfilename]{spacing-knee.ly}
+
+
+
@lilypondfile[printfilename]{non-empty-text.ly}
@lilypondfile[printfilename]{prefatory-spacing-matter.ly}
+@lilypondfile[printfilename]{spacing-clef-first-note.ly}
+
@lilypondfile[printfilename]{spacing-bar-stem.ly}
* Figured bass support
-* Improved grace notes
+* Improved beam formatting.
+
+* Improved grace notes.
* Better spacing.
* More ancient notation support.
-* Some entry optimizations
+* Some entry optimizations.
--- /dev/null
+\header {
+
+ texidoc = "clef changes at the start of a line get much more space
+than clef changes halfway the line."
+
+}
+
+\score {\notes {
+ < \context Staff = SA {
+ c2
+ \clef bass e16 f a
+ \clef treble b
+ }
+ \context Staff = SB {
+ c4 c4 c4
+ }>
+ }
+ \paper { linewidth = -1.
+\translator { \StaffContext
+ TimeSignature = \turnOff
+ }
+
+ }}
--- /dev/null
+\header {
+texidoc = "For knees, the spacing correction is such that the
+stems are put at regular distances.
+"
+ }
+\score { \notes
+{
+[g''8 g g'' g'']
+
+ }
+\paper { linewidth = -1. }
+ }
+
if (!key_item_p_)
{
key_item_p_ = new Item (get_property ("Accidentals"));
- Local_key_item::set_interface (key_item_p_);
- Staff_symbol_referencer::set_interface (key_item_p_);
SCM c0 = get_property ("centralCPosition");
if (gh_number_p (c0))
Staff_symbol_referencer::set_position (key_item_p_, gh_scm2int (c0));
Axis_group_interface::add_element (me, s);
}
-
-void
-Align_interface::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("align-interface"));
-
- Axis_group_interface::set_interface (me);
-}
-
void
Align_interface::set_axis (Grob*me,Axis a)
{
return me && me->has_interface (ly_symbol2scm ("align-interface"));
}
+
+ADD_INTERFACE (Align_interface, "align-interface",
+ " Order grobs top to bottom/left to right/right to left etc.",
+ "forced-distance stacking-dir align-dir threshold alignment-done center-element elements axes");
+
+
+
+ADD_INTERFACE (Foobar, "aligned-interface",
+ "read by align-interface",
+ "minimum-space-pair extra-space");
return ly_interval2scm (arpeggio.extent (X_AXIS) * 1.5);
}
+
+
+ADD_INTERFACE (Arpeggio, "arpeggio-interface",
+ "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.",
+ "stems arpeggio-direction");
+
Axis_group_engraver::initialize ()
{
staffline_p_ = get_spanner_p ();
- Axis_group_interface::set_interface (staffline_p_);
- Axis_group_interface::set_axes (staffline_p_, Y_AXIS, Y_AXIS);
Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
Hara_kiri_engraver::get_spanner_p () const
{
Spanner * sp = new Spanner (get_property ("HaraKiriVerticalGroup"));
- Hara_kiri_group_spanner::set_interface (sp);
+
return sp;
}
return me && me->has_interface (ly_symbol2scm ("axis-group-interface"));
}
-void
-Axis_group_interface::set_interface (Grob*me)
-{
- if (!has_interface (me))
- {
- me->set_interface (ly_symbol2scm ("axis-group-interface"));
- }
-}
+
+ADD_INTERFACE (Axis_group_interface, "axis-group-interface",
+ "a group of coupled grobs",
+ "axes");
return SCM_UNSPECIFIED;
}
-void
-Bar_line::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("bar-line-interface"));
-}
bool
Bar_line::has_interface (Grob*m)
else
return gh_int2scm (0);
}
+
+
+
+ADD_INTERFACE (Bar_line, "bar-line-interface",
+ "Bar line.
+
+This is a request to print a special bar symbol. It replaces the
+regular bar symbol with a special
+symbol. The argument @var{bartype} is a string which specifies the
+kind of bar to print. Options are @code{:|}
+@cindex |A@@@code{:|}
+,
+@code{|:}
+@cindex |B@@@code{|:}
+, @code{:|:}
+@cindex |C@@@code{:|:}
+,
+@code{||}
+@cindex |D@@@code{||}
+, @code{|.}
+@cindex |E@@@code{|.}
+,
+@code{.|}
+@cindex |F@@@code{.|}
+, and @code{.|.}
+@cindex |G@@@code{.|.}
+.
+
+These produce, respectively, a right repeat, a left repeat, a double
+repeat, a double bar, a start bar, an end bar, and a thick double bar.
+If @var{bartype} is set to @code{empty} then nothing is printed,
+but a line break is allowed at that spot.
+"
+,
+ "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
TODO:
take some y-position (chord/beam/nearest?) into account
- scmify forced-fraction */
+ scmify forced-fraction
+
+ TODO:
+
+ why is shorten stored in beam, and not directly in stem?
+
+*/
void
Beam::set_stem_shorten (Grob *m)
{
/*
TODO:
+
- Make all demerits customisable
- - One sensible check per demerit
+
+ - One sensible check per demerit (what's this --hwn)
+
- Add demerits for quants per se, as to forbid a specific quant
entirely
- */
+
+*/
MAKE_SCHEME_CALLBACK (Beam, quanting, 1);
SCM
Beam::quanting (SCM smob)
-/*
-
-TODO:
-use filter and standard list functions.
-
-*/
int
Beam::visible_stem_count (Grob *me)
{
return me->has_interface (ly_symbol2scm ("beam-interface"));
}
+
+ADD_INTERFACE (Beam, "beam-interface",
+ "A beam.
+
+#'thickness= weight of beams, in staffspace
+ ",
+ "concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness");
+
if (!align_l_)
{
align_l_ = new Item (get_property ("BreakAlignment"));
- Break_align_interface::set_interface (align_l_);
+
announce_grob (align_l_, SCM_EOL);
Item * edge = new Item (get_property ("LeftEdge"));
{
group = new Item (get_property ("BreakAlignGroup"));
- Axis_group_interface::set_interface (group);
- Axis_group_interface::set_axes (group, X_AXIS,X_AXIS);
-
group->set_grob_property ("break-align-symbol", align_name);
group->set_parent (align_l_, Y_AXIS);
announce_grob(group, item_l->self_scm());
Axis_group_interface::add_element (me, toadd);
}
-void
-Break_align_interface::set_interface (Grob*me)
-{
- Align_interface::set_interface (me);
- Align_interface::set_axis (me,X_AXIS);
-}
-
void
Break_align_interface::do_alignment (Grob *me)
{
int idx = 0;
- while (extents[idx].empty_b ())
+ while (idx < extents.size () && extents[idx].empty_b ())
idx++;
Array<Real> offsets;
}
+
+ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
+ "Items that are aligned in prefatory matter.
+
+The spacing of these items is controlled by the space-alist
+property. It contains a list break-align-symbols with a specification
+of the associated space. The space definition is either (extra-space
+. @var{number}), which adds space after the symbol, (minimum-space
+. @var{ms}), which pads the space until it it is @var{ms}.
+
+
+Special keys for the alist are 'first-note and 'next-note, signifyign
+the first note on a line, and the next note halfway a line.
+
+",
+ "break-align-symbol break-alignment-done space-alist");
+
+ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
+ "See @ref{break-aligned-interface}.",
+ "break-alignment-done");
+
+
+
SCM b = get_property ("BreathingSign");
breathing_sign_p_ = new Item (b);
- Breathing_sign::set_interface (breathing_sign_p_);
-
announce_grob(breathing_sign_p_, breathing_sign_req_l_->self_scm());
breathing_sign_req_l_ = 0;
}
return gh_double2scm (inter_f * sz * d);
}
-void
-Breathing_sign::set_interface (Grob *b)
-{
- Staff_symbol_referencer::set_interface (b);
-}
+ADD_INTERFACE(Breathing_sign, "breathing-sign-interface",
+ "A breathing sign.",
+ "direction");
return mol.smobbed_copy ();
}
+
+
+ADD_INTERFACE (Chord_name, "chord-name-interface",
+ "generate a chord name",
+ "pitches chord inversion bass begin-of-line-visible");
+
if (flags)
{
stem_tremolo_ = new Item (get_property ("StemTremolo"));
- Stem_tremolo::set_interface (stem_tremolo_);
-
announce_grob(stem_tremolo_, repeat_->self_scm());
- stem_tremolo_->set_grob_property ("tremolo-flags",
+ stem_tremolo_->set_grob_property ("flag-count",
gh_int2scm (flags));
}
Item *c= new Item (get_property ("Clef"));
announce_grob(c, SCM_EOL);
- Staff_symbol_referencer::set_interface (c);
-
clef_p_ = c;
}
SCM cpos = get_property ("clefPosition");
}
-void
-Clef::set_interface (Grob* me)
-{
- me->set_interface (ly_symbol2scm ("clef-interface"));
-}
MAKE_SCHEME_CALLBACK (Clef,brew_molecule,1)
SCM
return SCM_EOL;
}
}
+
+
+ADD_INTERFACE (Clef, "clef-interface",
+ "A clef sign",
+ "non-default full-size-change glyph-name");
+
if (!col_p_)
{
col_p_ = new Item (get_property ("NoteCollision"));
- Axis_group_interface::set_interface (col_p_);
- Axis_group_interface::set_axes (col_p_, X_AXIS, Y_AXIS);
-
announce_grob (col_p_, SCM_EOL);
}
Axis_group_interface::add_element (me, ncol_l);
me->add_dependency (ncol_l);
}
+
+
+ADD_INTERFACE (Collision, "note-collision-interface",
+ "An object that handles collisions between notes with different
+stem directions and horizontal shifts. Most of the interesting
+properties are to be set in @ref{note-column-interface}",
+ "merge-differently-dotted note-width collision-done");
{
Item *note_p = new Item (get_property ("NoteHead"));
- Staff_symbol_referencer::set_interface (note_p);
-
Music * req = note_req_l_arr_[i];
if (scratch_note_reqs_.size())
{
/* TODO:
- merge create_ledger_line () and Note_head::create_ledger_line ()
-
- rewrite create_ledger_line () to support short and thin ledger lines
if (gh_symbol_p (scm_style))
{
String style = ly_scm2string (scm_symbol_to_string (scm_style));
+
+ /*
+ DOCME:
+
+ Why would we want it differently? What's the meaning of adjust ?
+ */
bool adjust =
to_boolean (me->get_grob_property ("adjust-if-on-staffline"));
{
return m && m->has_interface (ly_symbol2scm ("custos-interface"));
}
+
+
+ADD_INTERFACE (Custos, "custos-interface",
+ "A custos is a staff context symbol that appears at the end of a
+ staff line with monophonic musical contents (i.e. with a single
+ voice). It anticipates the pitch of the first note of the following
+ line and thus helps the player or singer to manage line breaks
+ during performance, thus enhancing readability of a score.
+
+ Custodes were frequently used in music notation until the 16th
+ century. There were different appearences for different notation
+ styles. Nowadays, they have survived only in special forms of
+ musical notation such as via the editio vaticana dating back to the
+ beginning of the 20th century.
+
+[TODO: add to glossary]",
+ "style adjust-if-on-staffline neutral-position");
#include "axis-group-interface.hh"
#include "stem.hh"
+/*
+ TODO: let Dot_column communicate with stem via Note_column.
+ */
+
MAKE_SCHEME_CALLBACK (Dot_column,force_shift_callback,2);
SCM
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
}
}
+
+
+
+ADD_INTERFACE (Dot_column, "dot-column-interface",
+ "Interface that groups dots so they form a column",
+ "stem");
+
+
+ADD_INTERFACE (Dots, "dots-interface",
+ "The dots to go with a notehead/rest. A separate interface, since they
+are a party in collision resolution.
+#'direction is the Direction to handle staff-line collisions in.",
+ "direction dot-count");
+
+
line_spanner_ = new Spanner (get_property ("DynamicLineSpanner"));
Side_position_interface::set_axis (line_spanner_, Y_AXIS);
- Axis_group_interface::set_interface (line_spanner_);
- Axis_group_interface::set_axes (line_spanner_, Y_AXIS, Y_AXIS);
Music * rq = accepted_spanreqs_drul_[START];
if (script_req_l_)
script_p_->set_grob_property ("text",
script_req_l_->get_mus_property ("text"));
- Side_position_interface::set_direction (script_p_, DOWN);
-
if (Direction d = script_req_l_->get_direction ())
Directional_element_interface::set (line_spanner_, d);
else
{
cresc_p_ = new Spanner (get_property ("TextSpanner"));
- cresc_p_->set_interface (ly_symbol2scm ("dynamic-interface"));
cresc_p_->set_grob_property ("type", s);
-
daddy_trans_l_->set_property ((start_type
+ "Spanner").ch_C(), SCM_UNDEFINED);
s = get_property ((start_type + "Text").ch_C ());
/*
- '''Done: eliminating useless broadcast/acknowledge'''
+ Done: eliminating useless broadcast/acknowledge
One cause for translation slowness: grob broadcasted/acknowledges
-(b/a): every grob is b/a'd to all peer-engravers and all
+ (b/a): every grob is b/a-ed to all peer-engravers and all
parent-engravers. This means that lots of (often) useless b/a is done
for large scores (the top-level engravers gets to know every detail of
every voice, thread, etc. Measurements indicate this is 10% of the
-interpretation time:
+ interpretation time:
-standchen
+ standchen
old: (pre 1.5.13) 10.28
new: 8.73
list itself, GC for the structure, looking up the list during the
acks.
- */
+*/
SCM find_acknowledge_engravers (SCM gravlist, SCM meta);
void
Engraver_group_engraver::acknowledge_grobs ()
ENTER_DESCRIPTION(Figured_bass_engraver,
-/* descr */ "Make volta brackets",
+/* descr */ "Make figured bass numbers.",
/* creats*/ "BassFigure",
/* acks */ "",
/* reads */ "",
return ly_str02scm ("cmr10");
}
+
+
+
+ADD_INTERFACE (Font_interface, "font-interface",
+ "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)",
+ "font-magnification font-style font font-series font-shape font-family font-name font-design-size font-relative-size");
--- /dev/null
+#include "protected-scm.hh"
+#include "grob-interface.hh"
+#include "lily-guile.hh"
+#include "grob.hh"
+#include "warn.hh"
+
+Protected_scm all_ifaces;
+
+
+void add_interface (const char * symbol,
+ const char * descr,
+ const char * vars)
+{
+ SCM s = ly_symbol2scm (symbol);
+ SCM d = gh_str02scm (descr);
+ SCM l = parse_symbol_list (vars);
+
+
+ ly_add_interface(s,d,l);
+}
+
+SCM
+ly_add_interface (SCM a, SCM b, SCM c)
+{
+ SCM_ASSERT_TYPE (gh_symbol_p(a), a, SCM_ARG1, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_string_p(b), b, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_list_p(c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+ if (!gh_vector_p (all_ifaces))
+ {
+ all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL);
+ }
+
+ SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
+
+ scm_hashq_set_x (all_ifaces, a, entry);
+
+
+ return SCM_UNSPECIFIED;
+}
+
+
+SCM
+ly_all_grob_interfaces ()
+{
+ return all_ifaces;
+}
+
+void
+init_iface_funcs ()
+{
+ scm_c_define_gsubr ("ly-add-interface", 3, 0, 0,
+ (Scheme_function_unknown)ly_add_interface);
+ scm_c_define_gsubr ("ly-all-grob-interfaces", 0, 0, 0,
+ (Scheme_function_unknown)ly_all_grob_interfaces);
+}
+
+ADD_SCM_INIT_FUNC(giface, init_iface_funcs);
+
+void
+check_interfaces_for_property (Grob *me, SCM sym)
+{
+ SCM ifs = me->get_grob_property ("interfaces");
+
+
+ bool found = false;
+ for (; !found && gh_pair_p (ifs); ifs =gh_cdr (ifs))
+ {
+ SCM iface = scm_hashq_ref (all_ifaces , gh_car (ifs), SCM_BOOL_F);
+ if (iface == SCM_BOOL_F)
+ {
+ String msg = to_str ("Unknown interface `%s'",
+ ly_scm2string (scm_symbol_to_string (gh_car(ifs))).ch_C());
+ programming_error (msg);
+ continue;
+ }
+
+ found= found || (scm_memq (sym, gh_caddr (iface)) != SCM_BOOL_F);
+ }
+
+ if (!found)
+ {
+ String str = to_str("Grob %s has no interface for property %s",
+ me->name ().ch_C(),
+ ly_symbol2string(sym).ch_C());
+ programming_error (str);
+ }
+}
/*
Should change default to be empty?
*/
- if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb))
+ if (cb != SCM_BOOL_F
+ && !gh_procedure_p (cb) && !gh_pair_p (cb)
+ && gh_procedure_p (get_grob_property ("molecule-callback"))
+ )
cb = molecule_extent_proc;
dim_cache_[a].dimension_ = cb;
if (gh_pair_p (meta))
{
SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
-
- set_grob_property ("interfaces",ly_cdr (ifs));
+
+ /*
+ do it directly to bypass interface checks.
+ */
+ mutable_property_alist_ = gh_cons (gh_cons (ly_symbol2scm ("interfaces"),
+ gh_cdr (ifs)),
+ mutable_property_alist_);
}
}
}
#endif
+extern void check_interfaces_for_property (Grob *me, SCM sym);
+
void
Grob::internal_set_grob_property (SCM s, SCM v)
{
#ifndef NDEBUG
if (internal_type_checking_global_b)
- assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?")));
+ {
+ assert (type_check_assignment (s, v, ly_symbol2scm ("backend-type?")));
+ check_interfaces_for_property(this, s);
+ }
#endif
Molecule *
Grob::get_molecule () const
{
+ if (immutable_property_alist_ == SCM_EOL)
+ {
+ return 0;
+
+ }
+
SCM mol = get_grob_property ("molecule");
if (unsmob_molecule (mol))
return unsmob_molecule (mol);
/* now: sc && sc->line_l () == line */
if (!line)
return sc->self_scm();
- /*
- This was introduced in 1.3.49 as a measure to prevent
- programming errors. It looks expensive (?). TODO:
- benchmark , document when (what kind of programming
- errors) this happens.
- */
+ /*
+ This was introduced in 1.3.49 as a measure to prevent
+ programming errors. It looks expensive (?).
+
+ TODO:
+
+ benchmark , document when (what kind of programming
+ errors) this happens.
+ */
if (sc->common_refpoint (line, X_AXIS)
&& sc->common_refpoint (line, Y_AXIS))
{
gh_procedure_p (dim_cache_[a].dimension_));
}
-/*
- TODO: add
-
- Grob *refpoint
-
- to arguments?
- */
Interval
Grob::extent (Grob * refp, Axis a) const
{
return scm_memq (k, ifs) != SCM_BOOL_F;
}
-void
-Grob::set_interface (SCM k)
-{
- if (has_interface (k))
- return ;
- else
- {
- set_grob_property ("interfaces",
- gh_cons (k, get_grob_property ("interfaces")));
- }
-}
-
ADD_SCM_INIT_FUNC (scoreelt, init_functions);
IMPLEMENT_TYPE_P (Grob, "ly-grob?");
+
+ADD_INTERFACE (Grob, "grob-interface",
+ "All grobs support this",
+ "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause
+Y-extent-callback molecule-callback font-relative-size extra-offset
+staff-symbol interfaces dependencies no-spacing-rods extra-extent-X causes
+layer extra-extent-Y minimum-extent-X minimum-extent-Y transparent");
+
+ADD_INTERFACE (Hairpin, "hairpin-interface",
+ "hairpin crescendo.
+
+padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
+
+",
+ "grow-direction thickness height padding");
+
}
-void
-Hara_kiri_group_spanner::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("hara-kiri-group-interface"));
-}
bool
me->add_dependency (n);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"),n);
}
+
+
+ADD_INTERFACE (Hara_kiri_group_spanner,"hara-kiri-group-interface",
+ " As Vertical_group_spanner, but keep track of interesting items. If
+we don't contain any interesting items after linebreaking, then
+gracefully commit suicide. Objective: don't disgrace Lily by
+typesetting empty lines in orchestral scores.",
+ "items-worth-living");
+
elt_l_ = s;
}
+
+
+ADD_INTERFACE (Hyphen_spanner, "lyric-hyphen-interface",
+ "A centred hyphen is a simple line between lyrics used to divide
+syllables. The length of the hyphen line should stretch based on the
+size of the gap between syllables.",
+ "thickness height minimum-length maximum-length word-space");
+
--- /dev/null
+/*
+ interface.hh -- declare Interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef INTERFACE_HH
+#define INTERFACE_HH
+
+
+void add_interface (const char * symbol,
+ const char * descr,
+ const char * vars);
+
+SCM ly_add_interface (SCM, SCM, SCM);
+
+#define ADD_INTERFACE(cl,a,b,c) \
+void cl ## _init_ifaces() {\
+ add_interface(a,b,c);\
+}\
+ADD_SCM_INIT_FUNC(cl ## ifaces, cl ## _init_ifaces);\
+
+
+#endif /* INTERFACE_HH */
+
#include "lily-proto.hh"
#include "smobs.hh"
#include "dimension-cache.hh"
+#include "grob-interface.hh"
/**
for administration of what was done already
static SCM ly_get_grob_property (SCM, SCM);
bool has_interface (SCM intf);
- void set_interface (SCM intf);
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM ,SCM));
static void add_element (Grob *me, Grob *e);
- static void set_interface (Grob*me);
static bool has_interface (Grob*);
static void consider_suicide (Grob*me);
static void add_interesting_item (Grob * me , Grob* n);
static bool has_interface (Grob*);
static void get_spacing (Grob *me, Item* , Real, Real, Real*, Real*);
- static Real stem_dir_correction (Grob *me, Item * next_col);
+ static Real stem_dir_correction (Grob *me, Item * next_col, Real incr);
static Item * right_column (Grob*);
static Item * left_column (Grob*);
};
#include "lily-proto.hh"
-/**
-*/
struct Separation_item
{
-
static bool has_interface (Grob*);
static Interval my_width (Grob*) ;
static void add_item (Grob*,Item*);
/// set a minimum distance
static void add_rod (Grob*me, Grob * to, Real distance);
static void add_spring (Grob*me,Grob * to, Real dist, Real strength, bool);
- static void set_interface (Grob*);
+
static void remove_interface (Grob*);
static SCM get_minimum_distances (Grob*);
static SCM get_ideal_distances (Grob*);
DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK (height, (SCM,SCM));
static bool has_interface (Grob*);
- static void set_interface (Grob*);
-
static void set_spacing_hints (Grob*me) ;
};
#endif
class Tie_column
{
public:
- static void set_interface (Grob*me);
static bool has_interface (Grob*);
static void add_tie (Grob*me,Grob*);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
--- /dev/null
+
+/*
+ tuplet-bracket.hh -- part of GNU LilyPond
+
+ (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef Tuplet_bracket_HH
+#define Tuplet_bracket_HH
+
+#include "lily-guile.hh"
+
+/*
+
+ TODO: quantise, we don't want to collide with staff lines.
+ (or should we be above staff?)
+
+ todo: handle breaking elegantly.
+*/
+class Tuplet_bracket
+{
+public:
+ DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+ static bool has_interface (Grob*);
+
+ static void add_column (Grob*me,Item*);
+ static void add_beam (Grob*me,Grob*);
+
+ static void calc_dy (Grob*,Real *) ;
+ static void calc_position_and_height (Grob*,Real*,Real *dy);
+
+ DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
+
+ static Direction get_default_dir (Grob*);
+};
+
+#endif // Tuplet_bracket_HH
+
-/*
- plet-spanner.hh -- part of GNU LilyPond
-
- (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef Tuplet_bracket_HH
-#define Tuplet_bracket_HH
-
-#include "lily-guile.hh"
-
-/*
-
- TODO: quantise, we don't want to collide with staff lines.
- (or should we be above staff?)
-
- todo: handle breaking elegantly.
-*/
-class Tuplet_bracket
-{
-public:
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
- static void set_interface (Grob*);
- static bool has_interface (Grob*);
-
- static void add_column (Grob*me,Item*);
- static void add_beam (Grob*me,Grob*);
-
- static void calc_dy (Grob*,Real *) ;
- static void calc_position_and_height (Grob*,Real*,Real *dy);
-
- DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
-
- static Direction get_default_dir (Grob*);
-};
-
-#endif // Tuplet_bracket_HH
+#error
--- /dev/null
+
+/*
+ volta-spanner.hh -- part of GNU LilyPond
+
+ (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#ifndef VOLTA_SPANNER_HH
+#define VOLTA_SPANNER_HH
+
+
+#include "spanner.hh"
+
+class Volta_bracket_interface
+{
+public:
+ static void set_interface (Grob*);
+ static bool has_interface (Grob*);
+
+ DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+ static void add_column (Grob*, Grob*col);
+ static void add_bar (Grob*me, Item*bar);
+};
+
+#endif // VOLTA_SPANNER_HH
+
#include "spanner.hh"
#include "lily-guile.hh"
#include "line-of-score.hh"
+#include "group-interface.hh"
Item::Item (SCM s)
: Grob (s)
{
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0;
+ Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface"));
+
}
/**
{
return dynamic_cast<Item*> (unsmob_grob (s));
}
+
+ADD_INTERFACE(Item,
+ "item-interface",
+ "",
+ "visibility-lambda breakable")
item_p_->set_grob_property ("old-accidentals", get_property ("lastKeySignature"));
item_p_->set_grob_property ("new-accidentals", get_property ("keySignature"));
- Staff_symbol_referencer::set_interface (item_p_);
announce_grob(item_p_, keyreq_l_ ? keyreq_l_->self_scm() : SCM_EOL);
}
struct Key_signature_interface
{
-
- static void set_interface (Grob*);
- static bool has_interface (Grob*);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
};
return mol.smobbed_copy ();
}
-bool
-Key_signature_interface::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("key-signature-interface"));
-}
-
+ADD_INTERFACE (Key_signature_interface, "key-signature-interface",
+ "A group of accidentals.",
+ "c0-position old-accidentals new-accidentals");
}
/*
- LIST has the form "sym1 sym2 sym3"
+ LIST has the form "sym1 sym2 sym3\nsym4\nsym5"
+
+ i.e. \n and ' ' can be used interchangeably as separators.
*/
SCM
parse_symbol_list (const char * list)
char * s = strdup (list);
char *orig = s;
SCM create_list = SCM_EOL;
+
+ for (char * p = s; *p; p++)
+ {
+ if (*p == '\n')
+ *p = ' ' ;
+ }
+
if (!s[0] )
s = 0;
+
+
while (s)
{
char *next = strchr (s, ' ');
Real thick = me->paper_l ()->get_var ("stafflinethickness");
- SCM s = me->get_grob_property ("line-thickness");
+ SCM s = me->get_grob_property ("thickness");
if (gh_number_p (s))
thick *= gh_scm2double (s);
}
+
+ADD_INTERFACE (Line_spanner, "line-spanner-interface",
+ "Generic line drawn between two objects, eg. for use with glissandi.
+gap is measured in staff-spaces. ",
+ "gap dash-period dash-length thickness type");
+
+
Molecule
Local_key_item::parenthesize (Grob*me, Molecule m)
{
- Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-("));
- Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-)"));
+ Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-leftparen"));
+ Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-rightparen"));
m.add_at_edge (X_AXIS, LEFT, Molecule (open), 0);
m.add_at_edge (X_AXIS, RIGHT, Molecule (close), 0);
return m;
}
-/* HW says: maybe move to tie.cc
+/*
+ HW says: maybe move to tie.cc
Note, tie should not kill all accidentals when broken, only the ones
that are indicated by a property tie-break-reminder, I guess
{
return m && m->has_interface (ly_symbol2scm ("accidentals-interface"));
}
-void
-Local_key_item::set_interface (Grob*m)
-{
- m->set_interface (ly_symbol2scm ("accidentals-interface"));
-}
+
+
+
+ADD_INTERFACE (Local_key_item, "accidentals-interface",
+ "Accidentals",
+ "accidentals left-padding right-padding paren-cautionaries cautionary-size");
return m;
}
-/*
- TODO: should use slope instead? Angle gives nasty rad <-> degree
- conversions.
-*/
Molecule
Lookup::repeat_slash (Real w, Real s, Real t)
{
}
+
+
+ADD_INTERFACE (Lyric_extender,"lyric-extender-interface",
+ "The extender is a simple line at the baseline of the lyric
+that helps show the length of a melissima (tied/slurred note).",
+ "word-space height right-trim-amount");
SCM
-make_molecule (SCM expr, SCM xext, SCM yext)
+ly_make_molecule (SCM expr, SCM xext, SCM yext)
{
- /*
- TODO: typechecking.
- */
+ SCM_ASSERT_TYPE (ly_number_pair_p (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
+ SCM_ASSERT_TYPE (ly_number_pair_p (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");
+
Box b (ly_scm2interval (xext), ly_scm2interval(yext));
Molecule m (b, expr);
return m.smobbed_copy ();
static void
molecule_init ()
{
- scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule);
+ scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) ly_make_molecule);
scm_c_define_gsubr ("ly-fontify-atom", 2, 0, 0, (Scheme_function_unknown) ly_fontify_atom);
scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x);
scm_c_define_gsubr ("ly-add-molecule", 2, 0,0,(Scheme_function_unknown) ly_add_molecule);
{
mmrest_p_ = new Spanner (get_property ("MultiMeasureRest"));
- Multi_measure_rest::set_interface (mmrest_p_);
- Staff_symbol_referencer::set_interface (mmrest_p_);
-
announce_grob(mmrest_p_, busy_span_req_l_->self_scm());
start_measure_i_
= gh_scm2int (get_property ("currentBarNumber"));
#include "text-item.hh"
#include "percent-repeat-item.hh"
-
-void
-Multi_measure_rest::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("multi-measure-rest-interface"));
-}
-
bool
Multi_measure_rest::has_interface (Grob*me)
{
return SCM_UNSPECIFIED;
}
+
+
+ADD_INTERFACE (Multi_measure_rest,"multi-measure-rest-interface",
+ "A rest that spans a whole number of measures. For typesetting the
+numbers, fields from font-interface may be used.
+
+padding is the space between number and rest. Measured in staffspace.
+
+",
+ "columns measure-count expand-limit minimum-width padding");
return h1 - h2;
}
-void
-Note_column::set_interface (Grob* me)
-{
- me->set_interface (ly_symbol2scm ("note-column-interface"));
-
- Axis_group_interface::set_interface (me);
- Axis_group_interface::set_axes (me, X_AXIS, Y_AXIS);
-}
-
Item *
Note_column::stem_l (Grob*me)
{
return 0;
}
+
+
+
+ADD_INTERFACE (Note_column,"note-column-interface",
+ "Stem and noteheads combined",
+ "arpeggio note-heads rest-collision rest horizontal-shift stem accidentals force-hshift");
+
*/
left_ledger_protusion *= 0.66;
- right_ledger_protusion *= 0.8;
+ right_ledger_protusion *= 0.9;
}
Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion,
return gh_number_p (result) ? gh_scm2double (result) : 0.0;
}
+
+ADD_INTERFACE (Note_head,"note-head-interface",
+ "Note head",
+ "accidentals-grob style stem-attachment-function");
+
{
Item *note_p = new Item (get_property ("NoteHead"));
- Staff_symbol_referencer::set_interface (note_p);
-
Music * req = note_req_l_arr_[i];
Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
{
it = it -> find_prebroken_piece (col_dir);
}
+
/*
some kind of mismatch, eg. a note column, that is behind a
linebreak.
*/
if (!it)
continue;
+
+ if (d == RIGHT && right_col != it->column_l ())
+ continue;
+
+ if (Separation_item::has_interface (it))
+ {
+ extents[d].unite (Separation_item::my_width (it));
+ continue;
+ }
extents[d].unite (it->extent (it->column_l (), X_AXIS));
if (d == RIGHT)
*space += 0.5 * (( -extents[RIGHT][LEFT]) >? 0);
}
- *space += stem_dir_correction (me, right_col);
+ *space += stem_dir_correction (me, right_col, increment);
}
Item *
TODO: have to check wether the stems are in the same staff.
- TODO: also correct for bar lines in RIGHT-ITEMS. Should check if
- the barline is the leftmost object of the break alignment.
-
*/
Real
-Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn)
+Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
+ Real increment)
{
Drul_array<Direction> stem_dirs(CENTER,CENTER);
Drul_array<Interval> stem_posns;
Drul_array<SCM> props(me->get_grob_property ("left-items"),
me->get_grob_property ("right-items"));
+ Drul_array<Grob*> beams_drul(0,0);
Real correction = 0.0;
stem_dirs[LEFT] = stem_dirs[RIGHT] = CENTER;
goto exit_func ;
}
+ beams_drul[d] = Stem::beam_l (stem);
+
+
Direction sd = Stem::get_direction (stem);
if (stem_dirs[d] && stem_dirs[d] != sd)
{
if (correct &&stem_dirs[LEFT] *stem_dirs[RIGHT] == -1)
{
-
- intersect = stem_posns[LEFT];
- intersect.intersect(stem_posns[RIGHT]);
- correct = correct && !intersect.empty_b ();
+ if (beams_drul[LEFT] == beams_drul[RIGHT])
+ {
+ /*
+ this is a knee: maximal correction.
+ */
+
+ correction = increment* stem_dirs[LEFT];
+ }
+ else
+ {
+ intersect = stem_posns[LEFT];
+ intersect.intersect(stem_posns[RIGHT]);
+ correct = correct && !intersect.empty_b ();
- if (!correct)
- return 0.0;
- /*
- Ugh. 7 is hardcoded.
- */
- correction = abs (intersect.length ());
- correction = (correction/7) <? 1.0;
- correction *= stem_dirs[LEFT] ;
- correction *= gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+ if (!correct)
+ return 0.0;
+
+ correction = abs (intersect.length ());
- if (!bar_yextent.empty_b())
- {
- correction *= 0.5;
+
+ /*
+ Ugh. 7 is hardcoded.
+ */
+ correction = (correction/7) <? 1.0;
+ correction *= stem_dirs[LEFT] ;
+ correction *= gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+
+ if (!bar_yextent.empty_b())
+ {
+ correction *= 0.5;
+ }
}
}
- else if (correct)
+ else if (correct && stem_dirs[LEFT] *stem_dirs[RIGHT] == UP)
{
/*
Correct for the following situation:
return correction;
}
+
+
+
+ADD_INTERFACE (Note_spacing,"note-spacing-interface",
+ "",
+ "left-items right-items stem-spacing-correction");
+
Paper_column::Paper_column (SCM l)
: Item (l) // guh.?
{
- Axis_group_interface::set_interface (this);
- Axis_group_interface::set_axes (this, X_AXIS, X_AXIS);
- Spaceable_grob::set_interface (this);
-
line_l_=0;
rank_i_ = -1;
}
return t.smobbed_copy ();
}
+
+
+
+ADD_INTERFACE (Paper_column, "paper-column-interface",
+ "",
+ "between-cols when bounded-by-me shortest-playing-duration shortest-starter-duration");
return m.smobbed_copy ();
}
-
-
-
+ADD_INTERFACE (Percent_repeat_item_interface,"percent-repeat-interface",
+ "Repeats that look like percent signs",
+ "slope thickness");
// push a new phrasing_slur onto stack.
// (use temp. array to wait for all phrasing_slur STOPs)
Grob* phrasing_slur = new Spanner (get_property ("PhrasingSlur"));
- Slur::set_interface (phrasing_slur);
+ Slur::set_interface (phrasing_slur); // can't remove.
SCM s = get_property ("phrasingSlurBeginAttachment");
if (gh_symbol_p (s))
{
Chris Jackson <chris@fluffhouse.org.uk> - extended to support
bracketed pedals.
+
TODO: support for __| |__ or __| Ped instead of ___/\__ for pedal up-down
- */
+
+*/
#include "engraver.hh"
#include "musical-request.hh"
{
p->line_spanner_ = new Spanner (get_property ( ( String (p->name_) + "PedalLineSpanner").ch_C() ));
Side_position_interface::set_axis (p->line_spanner_, Y_AXIS);
- Axis_group_interface::set_interface (p->line_spanner_);
- Axis_group_interface::set_axes (p->line_spanner_, Y_AXIS, Y_AXIS);
Music * rq = (p->req_l_drul_[START] ? p->req_l_drul_[START] : p->req_l_drul_[STOP]);
announce_grob (p->line_spanner_, rq->self_scm ());
}
p->current_bracket_req_ = p->req_l_drul_[START];
p->bracket_p_ = new Spanner (get_property ("PianoPedalBracket"));
- p->bracket_p_->set_interface (ly_symbol2scm ("piano-pedal-interface"));
// Set a property so that the molecule-creating function will know whether the left edge should be flared \___
p->bracket_p_->set_grob_property("left-widen", gh_bool2scm((bool) p->req_l_drul_[STOP]) );
bool solid = to_boolean (me->get_grob_property ("solid"));
bool add_stem = to_boolean (me->get_grob_property ("add-stem"));
- SCM stem_direction_scm = me->get_grob_property ("stem-direction");
+ /*
+
+ TODO:
+
+ ugr. why not called direction?
+
+ */
+ SCM stem_direction_scm = me->get_grob_property ("direction");
Direction stem_direction =
gh_number_p (stem_direction_scm) ? to_dir (stem_direction_scm) : DOWN;
if (!stem_direction)
stem_direction = DOWN;
+
+ /*
+ TODO: revise name.
+ */
bool auto_properties = to_boolean (me->get_grob_property ("auto-properties"));
if (auto_properties)
// determine add_stem and stem_direction automatically from durations
Molecule molecule;
- SCM line_thickness_scm = me->get_grob_property ("line-thickness");
+ SCM line_thickness_scm = me->get_grob_property ("thickness");
Real line_thickness;
if (gh_number_p (line_thickness_scm))
{
Real thickness =
line_thickness * me->paper_l ()->get_var ("stafflinethickness");
- SCM porrectus_width_scm = me->get_grob_property ("porrectus-width");
+ SCM porrectus_width_scm = me->get_grob_property ("width");
Real porrectus_width;
if (gh_number_p (porrectus_width_scm))
{
molecule.translate_axis (ypos_correction, Y_AXIS);
return molecule;
}
+
+
+ADD_INTERFACE (Porrectus,"porrectus-interface",
+ "A porrectus ligature, joining two note heads into a single grob.",
+ "left-head right-head width add-stem auto-properties solid direction");
+
return;
rest_collision_p_ = new Item (get_property ("RestCollision"));
- Rest_collision::set_interface (rest_collision_p_);
+
announce_grob(rest_collision_p_, SCM_EOL);
for (int i=0; i< note_column_l_arr_.size (); i++)
Rest_collision::add_column (rest_collision_p_,note_column_l_arr_[i]);
TODO: look at horizontal-shift to determine ordering between rests
for more than two voices.
-
*/
SCM
Rest_collision::do_shift (Grob *me, SCM elts)
return SCM_UNSPECIFIED;
}
-void
-Rest_collision::set_interface (Grob*me)
-{
- me->set_extent_callback (SCM_EOL, X_AXIS);
- me->set_extent_callback (SCM_EOL, Y_AXIS);
-}
-
+ADD_INTERFACE (Rest_collision,"rest-collision-interface",
+ "Move around ordinary rests (not multi-measure-rests) to avoid
+conflicts.",
+ "maximum-rest-count minimum-distance elements");
if (rest_req_l_ && !rest_p_)
{
rest_p_ = new Item (get_property ("Rest"));
- Rhythmic_head::set_interface (rest_p_);
+
int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log ();
{
return m && m->has_interface (ly_symbol2scm ("rest-interface"));
}
+
+
+ADD_INTERFACE (Rest,"rest-interface",
+ "a rest",
+ "style");
+
if (!note_column_)
{
note_column_ = new Item (get_property ("NoteColumn"));
- Note_column::set_interface (note_column_);
announce_grob(note_column_, SCM_EOL);
}
-void
-Rhythmic_head::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("rhythmic-head-interface"));
-}
bool
Rhythmic_head::has_interface (Grob*me)
{
return me && me->has_interface (ly_symbol2scm ("rhythmic-head-interface"));
}
+
+
+ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
+ "Note head or rest",
+ "dot stem duration-log");
+
/*
- TODO: verzin iets tegen optie code bloot
-
-
- other interesting stuff to add:
+add these as well:
@item -T,--no-timestamps
don't timestamp the output
/*
TODO: use property Score.breakForbidden = #t
*/
-
void
Score_engraver::forbid_breaks ()
{
#include "ly-smobs.icc"
-#include "scm-hash.hh"
#include "score.hh"
#include "debug.hh"
#include "music-output-def.hh"
#include "music-iterator.hh"
#include "music.hh"
#include "global-translator.hh"
-#include "scope.hh"
+#include "scm-hash.hh"
#include "cpu-timer.hh"
#include "main.hh"
#include "paper-def.hh"
Score::run_translator (Music_output_def *odef_l)
{
/*
- TODO: this is not very elegant....
+ We want to know if we want to store locations, since they take a
+ lot of overhead.
+
*/
store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F);
if (!header_p_)
header_p_ = new Scheme_hash_table; // ugh
- Scope bla (header_p_);
- output->header_l_ = &bla;
+
+ output->header_l_ = header_p_;
output->origin_str_ = location_str ();
progress_indication ("\n");
return SCM_UNSPECIFIED;
}
+
+ADD_INTERFACE (Script_column,"script-column-interface",
+ "An interface that sorts scripts according to their @code{script-priority}",
+ "");
+
+
return me->has_interface (ly_symbol2scm ("script-interface"));
}
-void
-Script::set_interface (Grob*me)
-{
- return me->set_interface (ly_symbol2scm ("script-interface"));
-}
+
+ADD_INTERFACE (Text_script,"text-script-interface",
+ "Any text script",
+ "script-priority");
+
+ADD_INTERFACE (Skript, "script-interface",
+ "",
+ "script-priority script-molecule staff-support");
}
-void
-Separating_group_spanner::set_interface (Grob*)
-{
-}
-
bool
Separating_group_spanner::has_interface (Grob*)
{//todo
assert (false);
}
+
+
+
+ADD_INTERFACE (Separating_group_spanner,"separation-spanner-interface",
+ "Spanner that containing @code{separation-item-interface} grobs to calculate rods",
+ "");
/*
- single-malt-grouping-item.cc -- implement Separation_item
+ separation-item.cc -- implement Separation_item
source file of the GNU LilyPond music typesetter
s->add_dependency (i);
}
+/*
+ DOCME:
+
+ why don't we use extent()
+ */
Interval
Separation_item::my_width (Grob *me)
{
+
+
+ADD_INTERFACE (Separation_item,"separation-item-interface",
+ "Item that computes widths to generate spacing rods.
+
+Calc dimensions for the Separating_group_spanner; this has to be
+an item to get dependencies correct. It can't be an grob_group
+since these usually are in a different X_group
+",
+ "elements");
/*
- TODO: handling of grace notes is excuisite pain. This handling
+ TODO: handling of grace notes is exquisite pain. This handling
should be formally specified and then the implementation verified.
*/
Skip events till UNTIL. We don't do any other side effects such as
descending to child iterator contexts, because they might depend on
\context specs and \translator changes being executed
+
TODO: build support for grace notes here.
*/
void
}
+
+
+ADD_INTERFACE (Side_position_interface,"side-position-interface",
+ "Position a victim object (this one) next to other objects (the support).
+#'direction = where to put the victim object (left or right?)
+",
+ "side-support-elements direction-source direction side-relative-direction minimum-space padding self-alignment-X self-alignment-Y");
// push a new slur onto stack.
// (use temp. array to wait for all slur STOPs)
Grob* slur = new Spanner (get_property ("Slur"));
- Slur::set_interface (slur);
+ Slur::set_interface (slur); // cannot remove yet!
SCM s = get_property ("slurBeginAttachment");
if (gh_symbol_p (s))
{
/*
[TODO]
+
* should avoid stafflines with horizontal part.
+
* begin and end should be treated as a/acknowledge Scripts.
+
* smart changing of endings
+
* smart changing of (Y-?)offsets to avoid ugly beziers
(along-side-stem)
+
*/
#include "directional-element-interface.hh"
}
+ADD_INTERFACE (Slur,"slur-interface",
+ "A slur",
+ "slope-limit de-uglify-parameters details attachment direction attachment-offset beautiful y-free control-points extremity-rules extremity-offset-alist thickness dashed");
+
}
-void
-Spaceable_grob::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("spaceable-grob-interface"));
-}
+ADD_INTERFACE (Spaceable,"spaceable-grob-interface",
+ "An grob (generally a Paper_column) that takes part in the
+spacing problem. ",
+ "penalty minimum-distances ideal-distances
+left-neighbors right-neighbors");
+
Real space, fixed;
fixed = 0.0;
- bool expand_only;
- Real base = note_spacing (me, lc, rc, shortest, &expand_only);
- Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed);
- space -=base;
+ bool dummy;
+
+ if (d == LEFT)
+ {
+ /*
+ The note spacing should be taken from the musical
+ columns.
+
+ */
+ Real base = note_spacing (me, lc, rc, shortest, &dummy);
+ Note_spacing::get_spacing (sp, rc, base, increment, &space, &fixed);
+
+ space -= increment;
+
+ dists[d] = dists[d] >? space;
+ }
+ else
+ {
+ Real space, fixed_space;
+ Staff_spacing::get_spacing_params (sp,
+ &space, &fixed_space);
+
+ dists[d] = dists[d] >? fixed_space;
+ }
- dists[d] = dists[d] >? space;
}
}
while (flip (&d) != LEFT);
/*
- Read hints from L (todo: R) and generate springs.
+ Read hints from L and generate springs.
*/
void
Spacing_spanner::breakable_column_spacing (Item* l, Item *r)
return dist;
}
+
+
+ADD_INTERFACE (Spacing_spanner,"spacing-spanner-interface",
+ " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
+The space taken by a note is determined by the formula
+
+
+
+where TIME is the amount of time a note occupies. The value of C is
+chosen such that the smallest space within a measure is
+arithmetic_basicspace:
+
+C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8))
+
+The smallest space is the one following the shortest note in the
+measure, or the space following a hypothetical 1/8 note. Typically
+arithmetic_basicspace is set to a value so that the shortest note
+takes about two noteheads of space (ie, is followed by a notehead of
+space):
+
+@example
+2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
+
+@{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
+@{ assuming: SHORTEST <= 1/8 @}
+
+= arithmetic_multiplier *
+( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
+
+= arithmetic_multiplier * arithmetic_basicspace
+
+@{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
+
+= quartwidth * arithmetic_basicspace
+
+=>
+
+arithmetic_basicspace = 2/1 = 2
+
+
+If you want to space your music wider, use something like:
+
+arithmetic_basicspace = 4.;
+
+@end example",
+ "spacing-increment shortest-duration-space");
+
if (bar_l_arr_.size () >= 2 && !spanbar_p_)
{
spanbar_p_ = new Item (get_property ("SpanBar"));
- Span_bar::set_interface (spanbar_p_);
+
spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
announce_grob (spanbar_p_, SCM_EOL);
MAKE_SCHEME_CALLBACK (Span_bar,brew_molecule,1);
-/**
- * Limitations/Bugs:
- *
- * (1) Elements from 'me->get_grob_property ("elements")' must be
- * ordered according to their y coordinates relative to their common
- * axis group parent. Otherwise, the computation goes mad. (TODO:
- * apply a sort algorithm that ensures this precondition.) However,
- * until now, I have seen no case where lily has not fulfilled this
- * precondition.
- *
- * (2) This method depends on bar_engraver not being removed from
- * staff context. If bar_engraver is removed, the size of the staff
- * lines is evaluated as 0, which results in a solid span bar line
- * with faulty y coordinate.
+/*
+ Limitations/Bugs:
+
+ (1) Elements from 'me->get_grob_property ("elements")' must be
+ ordered according to their y coordinates relative to their common
+ axis group parent. Otherwise, the computation goes mad.
+
+ (TODO:
+ apply a sort algorithm that ensures this precondition.) However,
+ until now, I have seen no case where lily has not fulfilled this
+ precondition.
+
+ (2) This method depends on bar_engraver not being removed from
+ staff context. If bar_engraver is removed, the size of the staff
+ lines is evaluated as 0, which results in a solid span bar line
+ with faulty y coordinate.
*/
/*
return gh_double2scm (iv.length ());
}
-void
-Span_bar::set_interface (Grob *me)
-{
- Bar_line::set_interface (me);
-
- me->set_interface (ly_symbol2scm ("span-bar-interface"));
- me->set_extent_callback (SCM_EOL, Y_AXIS);
-}
bool
Span_bar::has_interface (Grob*m)
{
return m && m->has_interface (ly_symbol2scm ("span-bar-interface"));
}
+
+ADD_INTERFACE (Span_bar,"span-bar-interface",
+ "A bar line that spans other barlines (typically used to get cross-staff barlines.",
+ "");
+
+
#include "paper-outputter.hh"
#include "paper-column.hh"
#include "line-of-score.hh"
-
#include "group-interface.hh"
void
{
spanned_drul_[LEFT]=0;
spanned_drul_[RIGHT]=0;
+ Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface"));
+
+
}
Spanner::Spanner (Spanner const &s)
{
return dynamic_cast<Spanner*> (unsmob_grob (s));
}
+
+ADD_INTERFACE(Spanner,
+ "spanner-interface",
+ "",
+ "minimum-length");
*fixed = 1.0;
Grob * separation_item=0;
-
+ Item * me_item = dynamic_cast<Item*> (me);
+
for (SCM s = me->get_grob_property ("left-items");
gh_pair_p (s); s = gh_cdr(s))
{
if (!scm_list_p (alist))
return ;
- SCM space_def = scm_sloppy_assq (ly_symbol2scm ("begin-of-note"), alist);
+
+ SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist);
+ if (me_item->break_status_dir () == CENTER)
+ {
+ SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
+ if (gh_pair_p (nndef ))
+ space_def = nndef;
+ }
+
if (!gh_pair_p (space_def))
{
programming_error ("Unknown prefatory spacing. ");
*space += next_notes_correction (me, last_grob);
}
+
+
+ADD_INTERFACE (Staff_spacing,"staff-spacing-interface",
+ "",
+ "left-items right-items");
}
-void
-Staff_symbol_referencer::set_interface (Grob * e)
-{
- e->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS);
-}
+
+
+ADD_INTERFACE (Staff_symbol_referencer,"staff-symbol-referencer-interface",
+ "Object whose Y position is meaning with reference to a staff
+symbol. Objects that have this interface should include
+Staff_symbol_referencer::callback in their Y-offset-callback.
+",
+ "staff-position");
{
return m && m->has_interface (ly_symbol2scm ("staff-symbol-interface"));
}
+
+
+
+ADD_INTERFACE (Staff_symbol,"staff-symbol-interface",
+ "This spanner draws the lines of a staff. The middle line is
+position 0.",
+ "staff-space line-count invisible-staff");
+
if (!stem_p_)
{
stem_p_ = new Item (get_property ("Stem"));
- Stem::set_interface (stem_p_);
- Staff_symbol_referencer::set_interface (stem_p_);
-
+
stem_p_->set_grob_property ("duration-log", gh_int2scm (duration_log));
if (tremolo_req_l_)
if (requested_type)
{
tremolo_p_ = new Item (get_property ("StemTremolo"));
- Stem_tremolo::set_interface (tremolo_p_);
-
announce_grob(tremolo_p_, tremolo_req_l_->self_scm());
+
/*
The number of tremolo flags is the number of flags of
the tremolo-type minus the number of flags of the note
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags < 0)
tremolo_flags = 0;
- tremolo_p_->set_grob_property ("tremolo-flags",
+ tremolo_p_->set_grob_property ("flag-count",
gh_int2scm (tremolo_flags));
}
}
lengthen stem if necessary
*/
-void
-Stem_tremolo::set_interface (Grob *me)
-{
- me->set_interface (ly_symbol2scm ("stem-tremolo"));
-}
-
bool
Stem_tremolo::has_interface (Grob *me)
{
- return me->has_interface (ly_symbol2scm ("stem-tremolo"));
+ return me->has_interface (ly_symbol2scm ("stem-tremolo-interface"));
}
MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2);
if (beam)
{
Real dy = 0;
- SCM s = beam->get_grob_property ("dy");
- if (gh_number_p (s))
- dy = gh_scm2double (s);
+ SCM s = beam->get_grob_property ("positions");
+ if (gh_pair_p (s))
+ {
+ dy = -gh_scm2double (gh_car (s)) +gh_scm2double (gh_cdr (s));
+ }
Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
- Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
dydx = dx ? dy/dx : 0;
a.translate (Offset (-width/2, width / 2 * dydx));
int tremolo_flags;
- SCM s = me->get_grob_property ("tremolo-flags");
+ SCM s = me->get_grob_property ("flag-count");
if (gh_number_p (s))
tremolo_flags = gh_scm2int (s);
else
me->set_grob_property ("stem", s->self_scm ());
}
+
+ADD_INTERFACE (Stem_tremolo,"stem-tremolo-interface",
+ "",
+ "stem beam-width beam-thickness flag-count");
}
else
{
- n->set_grob_property ("rest", n->self_scm ());
+ /*
+ Apparently, this is never used.
+ */
+#if 0
+ me->set_grob_property ("rest", n->self_scm ());
+#endif
}
}
bool no_extend_b = to_boolean (me->get_grob_property ("no-stem-extend"));
- if (!grace_b && !no_extend_b && dir * st < 0) // junkme?
- st = 0.0;
+ if (!grace_b && !no_extend_b && dir * st < 0) // junkme?
+ st = 0.0;
return st;
}
return m && m->has_interface (ly_symbol2scm ("stem-interface"));
}
-void
-Stem::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("stem-interface"));
-}
+ADD_INTERFACE (Stem,"stem-interface",
+ "A stem",
+ "thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced");
+
Syllable_group *vi = new Syllable_group;
return vi->smobbed_self ();
}
+
+
+ADD_INTERFACE (Lyric_syllable,"lyric-syllable-interface",
+ "a single piece of lyrics",
+ "word-space alignment ignore-length-mismatch begin-alignment end-alignment");
+
return mol;
}
-void
-System_start_delimiter::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("system-start-delimiter-interface"));
-}
bool
System_start_delimiter::has_interface (Grob*me)
return Molecule (b, at);
}
+
+
+
+ADD_INTERFACE (System_start_delimiter,"system-start-delimiter-interface",
+ "#'style can be bar-line, bracket or brace",
+ "bar-line-collapse-height brace-collapse-height bracket-collapse-height thickness arch-height arch-angle arch-thick arch-width bracket-thick glyph");
: Spanner (s)
{
rank_i_ = 0;
-
- Axis_group_interface::set_interface (this);
- Axis_group_interface::set_axes (this, Y_AXIS,X_AXIS);
}
int
return acs;
}
+
+
+
+ADD_INTERFACE (System,"system-interface",
+ "Super grob, parent of all:
+
+The columns of a score that form one line. The toplevel grob. Any
+grob has a Line_of_score as both X and Y reference point. The
+Paper_score contains one grob of this type. Control enters the
+Grob dependency calculation from this single Line_of_score
+object.",
+ "between-system-string spacing-procedure before-line-breaking-callback after-line-breaking-callback all-elements columns");
return mol.smobbed_copy ();
}
+
+
+
+ADD_INTERFACE (Text_item,"text-interface",
+ "A scheme markup text",
+ "text align baseline-skip lookup raise kern word-space magnify");
/*
TODO:
- vertical start / vertical end (fixme-name) |
- - contination types (vert. star, vert. end) |-> eat volta-spanner
+ - contination types (vert. star, vert. end) |-> eat volta-bracket
- more styles
- more texts/positions
*/
me->set_grob_property ("shorten-pair", gh_cons ( gh_double2scm ( shorten[LEFT] ),
gh_double2scm ( shorten[RIGHT] ) ));
}
+
+
+
+ADD_INTERFACE (Pianopedal,"piano-pedal-interface",
+ "",
+ "pedal-type edge-width edge-height shorten-pair text-start left-widen right-widen");
+
+
+
+ADD_INTERFACE (Text_spanner,"text-spanner-interface",
+ "generic text spanner",
+ "dash-period dash-length edge-height edge-width edge-text shorten-pair type");
+
-void
-Tie_column::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("tie-column-interface"));
- me->set_extent_callback (SCM_EOL, X_AXIS);
- me->set_extent_callback (SCM_EOL, Y_AXIS) ;
-}
bool
Tie_column::has_interface (Grob*me)
set_directions (unsmob_grob (smob));
return SCM_UNSPECIFIED;
}
+
+
+
+ADD_INTERFACE (Tie_column,"tie-column-interface",
+ "that sets tie directions in a tied chord",
+ "direction");
+
Spanner * p = new Spanner (basic);
- Tie::set_interface (p);
+ Tie::set_interface (p); // cannot remove.
Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_grob (ly_car (pair))));
Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdr (pair))));
else for (SCM s = head_list; gh_pair_p (s); s = ly_cdr (s))
{
Grob * p = new Spanner (basic);
- Tie::set_interface (p);
+ Tie::set_interface (p); // cannot remove yet!
Tie::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_grob (ly_caar (s))));
Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdar (s))));
if (tie_p_arr_.size () > 1 && !tie_column_p_)
{
tie_column_p_ = new Spanner (get_property ("TieColumn"));
- Tie_column::set_interface (tie_column_p_);
+
for (int i = tie_p_arr_.size (); i--;)
Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
announce_grob(tie_column_p_, SCM_EOL);
Tie::set_interface (Grob*me)
{
me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
- me->set_interface (ly_symbol2scm ("tie-interface"));
}
bool
}
+
+ADD_INTERFACE (Tie,"tie-interface",
+ "A tie connecting two noteheads.
+direction = Forced direction for all ties",
+ "y-offset staffline-clearance control-points heads details thickness x-gap direction minimum-length");
return m;
}
+
+
+ADD_INTERFACE (Time_signature,"time-signature-interface",
+ "A time signature, in different styles.
+ The following values for 'style are are recognized:
+
+ @table @samp
+ @item @code{C}
+ 4/4 and 2/2 are typeset as C and struck C, respectively. All
+ other time signatures are written with two digits.
+
+ @item @code{old}
+ 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
+ typeset with old-style mensuration marks. All other time
+ signatures are written with two digits.
+
+ @item @code{1xxx}
+ All time signatures are typeset with a single
+ digit, e.g. 3/2 is written as 3. (Any symbol starting
+ with the digit @code{1} will do.)
+
+ @item @code{C}@var{M}@code{/}@var{N},
+@code{old}@var{M}@code{/}@var{N} or
+ @code{old6/8alt}
+ Tells LilyPond to use a specific symbol as time signature,
+ regardless of the actual time signature.
+ @end table
+
+See also the test-file @file{input/test/time.ly}.
+",
+ "fraction style");
#include "paper-column.hh"
#include "paper-def.hh"
#include "text-item.hh"
-#include "tuplet-spanner.hh"
+#include "tuplet-bracket.hh"
#include "stem.hh"
#include "note-column.hh"
#include "dimensions.hh"
#include "staff-symbol-referencer.hh"
/*
- TODO:
- staff-line collisions for horizontal tuplet brackets.
-
TODO:
in the case that there is no bracket, but there is a (single) beam,
*/
-
-void
-Tuplet_bracket::set_interface (Grob*me)
-{
- me->set_interface (ly_symbol2scm ("tuplet-bracket"));
-}
-
MAKE_SCHEME_CALLBACK (Tuplet_bracket,brew_molecule,1);
SCM
Tuplet_bracket::brew_molecule (SCM smob)
}
+bool
+Tuplet_bracket::has_interface (Grob*me)
+{
+ return me->has_interface (ly_symbol2scm ("tuplet-bracket-interface"));
+}
+
+
+
+
+ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface",
+ "A bracket with a number in the middle, used for tuplets.",
+ "columns number-gap delta-y tuplet-bracket-visibility tuplet-number-visibility thick direction");
+
#include "command-request.hh"
-#include "tuplet-spanner.hh"
+#include "tuplet-bracket.hh"
#include "note-column.hh"
#include "time-scaled-music.hh"
#include "beam.hh"
continue;
Spanner* glep = new Spanner (get_property ("TupletBracket"));
- Tuplet_bracket::set_interface (glep);
+
if (i >= started_span_p_arr_.size ())
started_span_p_arr_.push (glep);
else
--- /dev/null
+/*
+ volta-bracket.cc -- implement Volta_bracket_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include <string.h>
+
+#include "box.hh"
+#include "debug.hh"
+#include "font-interface.hh"
+#include "molecule.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "text-item.hh"
+#include "volta-bracket.hh"
+#include "group-interface.hh"
+#include "side-position-interface.hh"
+#include "directional-element-interface.hh"
+
+
+/*
+ this is too complicated. Yet another version of side-positioning,
+ badly implemented.
+
+ --
+
+ * Should look for system_start_delim to find left edge of staff.
+
+*/
+
+MAKE_SCHEME_CALLBACK (Volta_bracket_interface,brew_molecule,1);
+SCM
+Volta_bracket_interface::brew_molecule (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Link_array<Item> bar_arr
+ = Pointer_group_interface__extract_grobs (me, (Item*)0, "bars");
+
+ if (!bar_arr.size ())
+ return SCM_EOL;
+
+ Spanner *orig_span = dynamic_cast<Spanner*> (me->original_l_);
+
+ bool first_bracket = orig_span && (orig_span->broken_into_l_arr_[0] == (Spanner*)me);
+
+ bool last_bracket = orig_span && (orig_span->broken_into_l_arr_.top () == (Spanner*)me);
+
+ bool no_vertical_start = orig_span && !first_bracket;
+ bool no_vertical_end = orig_span && !last_bracket;
+ SCM bars = me->get_grob_property ("bars");
+ Grob * endbar = unsmob_grob (ly_car (bars));
+ SCM glyph = endbar->get_grob_property("glyph");
+ String str = ly_scm2string(glyph);
+ const char* cs = str.ch_C();
+ no_vertical_end |=
+ (strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0
+ && strcmp(cs,":|:")!=0 && strcmp(cs,".|")!=0);
+
+ Real staff_thick = me->paper_l ()->get_var ("stafflinethickness");
+ Real half_space = 0.5;
+
+ Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
+
+ /*
+ not a start, but really broken in two
+ */
+ Real left =0.;
+ if (bound->break_status_dir () == RIGHT)
+ {
+ Paper_column *pc = bound->column_l ();
+ left = pc->extent (pc, X_AXIS)[RIGHT] - bound->relative_coordinate (pc, X_AXIS);
+ }
+ else
+ {
+ /*
+ the volta spanner is attached to the bar-line, which is moved
+ to the right. We don't need to compensate for the left edge.
+ */
+ }
+
+ Real w = dynamic_cast<Spanner*> (me)->spanner_length () - left - half_space;
+ Real h = gh_scm2double (me->get_grob_property ("height"));
+ Real t = staff_thick * gh_scm2double (me->get_grob_property ("thickness"));
+
+ /*
+ ugh: should build from line segments.
+ */
+ SCM at = (scm_list_n (ly_symbol2scm ("volta"),
+ gh_double2scm (h),
+ gh_double2scm (w),
+ gh_double2scm (t),
+ gh_int2scm (no_vertical_start),
+ gh_int2scm (no_vertical_end),
+ SCM_UNDEFINED));
+
+ Box b (Interval (0, w), Interval (0, h));
+ Molecule mol (b, at);
+ SCM text = me->get_grob_property ("text");
+ SCM properties = scm_list_n (me->mutable_property_alist_,
+ me->immutable_property_alist_,SCM_UNDEFINED);
+ Molecule num = Text_item::text2molecule (me, text, properties);
+
+ mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
+ - 1.0);
+ mol.translate_axis (left, X_AXIS);
+ return mol.smobbed_copy ();
+}
+
+
+void
+Volta_bracket_interface::add_bar (Grob *me, Item* b)
+{
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("bars"), b);
+ Side_position_interface::add_support (me,b);
+ add_bound_item (dynamic_cast<Spanner*> (me), b);
+}
+
+void
+Volta_bracket_interface::add_column (Grob*me, Grob* c)
+{
+ Side_position_interface::add_support (me,c);
+}
+
+ADD_INTERFACE (Volta_bracket_interface,"volta-bracket-interface",
+ "Volta bracket with number",
+ "bars thickness height");
+
#include "engraver.hh"
#include "translator-group.hh"
-#include "volta-spanner.hh"
+#include "volta-bracket.hh"
#include "item.hh"
#include "note-column.hh"
#include "bar-line.hh"
started_mom_ = now_mom () ;
volta_span_p_ = new Spanner (get_property ("VoltaBracket"));
- Volta_spanner::set_interface (volta_span_p_);
+
announce_grob (volta_span_p_, SCM_EOL);
volta_span_p_->set_grob_property ("text", start_str_);
}
if (Note_column::has_interface (item))
{
if (volta_span_p_)
- Volta_spanner::add_column (volta_span_p_,item);
+ Volta_bracket_interface::add_column (volta_span_p_,item);
}
if (Bar_line::has_interface (item))
{
if (volta_span_p_)
- Volta_spanner::add_bar (volta_span_p_, item);
+ Volta_bracket_interface::add_bar (volta_span_p_, item);
if (end_volta_span_p_)
- Volta_spanner::add_bar (end_volta_span_p_ , item);
+ Volta_bracket_interface::add_bar (end_volta_span_p_ , item);
}
}
else if (Staff_symbol::has_interface (i.grob_l_))
(typename (type-name type))
(desc (object-property sym 'backend-doc)))
- (cons (string-append "@code{" name "} "
+
+ (if (equal? desc #f)
+ (error "Unknown property " sym)
+
+ (cons (string-append "@code{" name "} "
"(" typename ")"
": "
; index gets too messy
; "@vindex " name "\n"
-
-
)
- desc)))
+ desc))))
(define (document-grob-property sym grob-description )
+ "Document SYM, filling in default values."
(let* ((handle (assoc sym grob-description))
(defval (if (eq? handle #f)
"(unset)"
(scm->texi (cdr handle))))
(propdoc (backend-property->texi sym)))
-
+
(cons (car propdoc) (string-append (cdr propdoc)
"\nDefault value: "
- defval))))
+ defval)))
+ )
(define (document-interface where interface grob-description)
+
(let* ((level (if (eq? where 'grob) 3 2))
(name (car interface))
(desc (cadr interface))
(props (caddr interface))
- (docfunc (lambda (x)
+ (docfunc (lambda (pr)
(document-grob-property
- x grob-description )))
+ pr grob-description )))
(docs (map docfunc props)))
(string-append
(node (interface-name name))
(document-interface 'self interface '()))))
+
;; First level grob description
(define (document-grob iname description)
(processing iname)
(let* ((metah (assoc 'meta description))
- (meta (if (pair? metah)
- (cdr metah)
- '((properties . ()) (name . "huh?"))
- ))
-
+ (meta (cdr metah))
(name (cdr (assoc 'name meta)))
- (ifaces (cdr (assoc 'interface-descriptions meta)))
- (ifacedoc (map (lambda (x)
- (document-interface 'grob x description))
- (reverse ifaces))))
+ (ifaces (map lookup-interface (cdr (assoc 'interfaces meta))))
+ (ifacedoc (map (lambda (iface)
+ (document-interface 'grob iface description))
+ (reverse ifaces)))
+ )
+
(string-append
(node (grob-name name))
(texi-section 2 (grob-name name) #f)
(map engraver-name engraver-names)))))
(apply string-append ifacedoc))))
-
+
+
+
(define (engraver-makes-grob? name-symbol grav)
(memq name-symbol (assoc 'grobs-created (Translator::description grav)))
)
(define interface-description-alist
- (map (lambda (x) (cons (string->symbol x) (eval-string x)))
- (interface-names)))
+ (hash-fold
+ (lambda (key val prior)
+ (cons (cons key val) prior)
+ )
+ '() (ly-all-grob-interfaces)))
(set! interface-description-alist (sort interface-description-alist alist<?))
+
+;;;;;;;;;; check for dangling backend properties.
+(define (mark-interface-properties entry)
+ (map (lambda (x) (set-object-property! x 'iface-marked #t)) (caddr (cdr entry)))
+ )
+
+(map mark-interface-properties interface-description-alist)
+
+(define (check-dangling-properties prop)
+ (if (not (object-property prop 'iface-marked))
+ (error "\nDangling property: " prop))
+ )
+
+(map check-dangling-properties all-backend-properties)
+
+;;;;;;;;;;;;;;;;
+
+(define (lookup-interface name)
+ (let* (
+ (entry (hashq-ref (ly-all-grob-interfaces) name #f))
+ )
+
+ (if (equal? entry #f)
+ (error "Unknown interface" name))
+
+ entry
+))
+
+;(write (map car interface-description-alist) (current-error-port))
+;(display (lookup-interface 'volta-bracket-interface))
+
(define (document-all-interfaces name)
(string-append
(texi-node-menu name (map (lambda (x)
texi)
)
)
-
+
+;;;;;;;;;;;;;;;;
+
;; are described...
(define no-copies #f)
+
+
(let* ((doc (string-append
(document-music "LilyPond music properties")
(document-paper "LilyPond interpretation contexts")
. (
(molecule-callback . ,Local_key_item::brew_molecule)
(X-offset-callbacks . (,Side_position_interface::aligned_side))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(after-line-breaking-callback . ,Local_key_item::after_line_breaking)
(direction . -1)
(left-padding . 0.2)
(right-padding . 0.5)
(paren-cautionaries . #t)
(font-family . music)
- (meta . ,(grob-description accidentals-interface font-interface side-position-interface))
+ (meta . ((interfaces . (accidentals-interface staff-symbol-referencer-interface font-interface side-position-interface))))
))
(Arpeggio
(X-offset-callbacks . (,Side_position_interface::aligned_side))
(direction . -1)
(staff-position . 0.0)
- (meta . ,(grob-description arpeggio-interface side-position-interface font-interface))
+ (meta . ((interfaces . (arpeggio-interface staff-symbol-referencer-interface side-position-interface font-interface))))
))
(BarLine
(time-signature . (extra-space . 0.75))
(custos . (minimum-space . 2.0))
(clef . (minimum-space . 1.0))
- (begin-of-note . (extra-space . 1.3))
+ (first-note . (extra-space . 1.3))
))
;;
(thin-kern . 3.0)
(hair-thickness . 1.6)
(thick-thickness . 6.0)
- (meta . ,(grob-description bar-line-interface font-interface))
+ (meta . ((interfaces . (bar-line-interface font-interface))))
))
(font-family . roman)
(font-relative-size . -1)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (meta . ,(grob-description
- side-position-interface
- text-interface font-interface break-aligned-interface))
- ))
+ (meta .
+ ((interfaces . (side-position-interface
+ text-interface
+ font-interface break-aligned-interface))))
+
+ ))
(BassFigure
. (
(padding . 0.1)
(kern . 0.2)
(thickness . 1.0)
- (meta . ,(grob-description text-interface font-interface ))
+ (meta . ((interfaces . (text-interface font-interface))))
))
(Beam
. (
,Beam::check_concave
,Beam::slope_damping
,Beam::quanting
- ))
-
+ ))
+
+ ;; TODO: should be in SLT.
(thickness . 0.48) ; in staff-space
(before-line-breaking-callback . ,Beam::before_line_breaking)
(after-line-breaking-callback . (,Beam::after_line_breaking
,Beam::end_after_line_breaking))
-; (quant-score-functions . (
-; ,Beam::score_stem_lengths
-; ))
(neutral-direction . -1)
(dir-function . ,beam-dir-majority-median)
(beamed-stem-shorten . (1.0 0.5))
(damping . 1)
(auto-knee-gap . 7)
(font-name . "cmr10")
- (meta . ,(grob-description beam-interface))
+ (meta . ((interfaces . (staff-symbol-referencer-interface beam-interface))))
))
(BreakAlignment
. (
(breakable . #t)
(stacking-dir . 1)
- (axes 0)
- (meta . ,(grob-description
- axis-group-interface
- )
- )
- ))
+ (axes . (0))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (meta . ((interfaces . (break-alignment-interface axis-group-interface)))))
+ )
(BreakAlignGroup
. (
(axes . (0))
(X-offset-callbacks . (,Break_align_interface::alignment_callback))
-
- (meta . ,(grob-description axis-group-interface))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (meta . ((interfaces . (break-aligned-interface axis-group-interface))))
))
(BreathingSign
. (
(break-align-symbol . breathing-sign)
- (breakable . #t )
+ (breakable . #t)
(space-alist . (
(key-signature . (minimum-space . 1.5))
(staff-bar . (minimum-space . 1.5))
(clef . (minimum-space . 2.0))
- (begin-of-note . (minimum-space . 1.0))
+ (first-note . (minimum-space . 1.0))
))
(molecule-callback . ,Text_item::brew_molecule)
(lookup . name)
(text . "scripts-rcomma")
(Y-offset-callbacks . (,Breathing_sign::offset_callback))
(visibility-lambda . ,begin-of-line-invisible)
- (meta . ,(grob-description break-aligned-interface text-interface font-interface))
+ (meta . ((interfaces . (break-aligned-interface breathing-sign-interface text-interface font-interface))))
))
(Clef
(staff-bar . (minimum-space . 3.7))
(key-signature . (minimum-space . 4.0))
(time-signature . (minimum-space . 4.2))
- (begin-of-note . (minimum-space . 5.0))
+ (first-note . (minimum-space . 5.0))
+ (next-note . (extra-space . 0.5))
))
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (meta . ,(grob-description clef-interface font-interface break-aligned-interface ))
+ (meta . ((interfaces . (clef-interface staff-symbol-referencer-interface font-interface break-aligned-interface))))
))
(ChordName
(after-line-breaking-callback . ,Chord_name::after_line_breaking)
(chord-name-function . ,default-chord-name-function)
(font-family . roman)
- (meta . ,(grob-description font-interface text-interface chord-name-interface))
+ (meta . ((interfaces . (font-interface text-interface chord-name-interface))))
))
(Custos
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(font-family . music)
(space-alist . (
- (begin-of-note . (minimum-space . 0.0))
+ (first-note . (minimum-space . 0.0))
))
- (meta . ,(grob-description custos-interface staff-symbol-referencer-interface break-aligned-interface) )
+ (meta . ((interfaces . (custos-interface staff-symbol-referencer-interface break-aligned-interface))))
))
(DotColumn
. (
- (axes 0)
+ (axes . (0))
(direction . 1)
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
-
(X-offset-callbacks . (,Dot_column::side_position))
- (meta . ,(grob-description dot-column-interface axis-group-interface))
+ (meta . ((interfaces . (dot-column-interface axis-group-interface))))
))
(Dots
(dot-count . 1)
(staff-position . 0.0)
(Y-offset-callbacks . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback))
- (meta . ,(grob-description font-interface dots-interface ))
+ (meta . ((interfaces . (font-interface staff-symbol-referencer-interface dots-interface))))
))
(DoublePercentRepeat .
(thickness . 0.48)
(break-align-symbol . staff-bar)
(visibility-lambda . ,begin-of-line-invisible)
- (meta . ,(grob-description font-interface percent-repeat-interface))
- ))
+ (meta . ((interfaces . (font-interface percent-repeat-interface))))
+ ))
(DynamicText
. (
(font-family . dynamic)
(font-shape . italic)
(self-alignment-Y . 0)
- (meta . ,(grob-description font-interface text-interface dynamic-interface))
+ (meta . ((interfaces . (font-interface text-interface dynamic-interface))))
))
(DynamicLineSpanner
. (
- (axes . ( 1))
+ (axes . (1))
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+
(padding . 0.6)
(minimum-space . 1.2)
(direction . -1)
- (meta . ,(grob-description dynamic-interface axis-group-interface side-position-interface))
+ (meta . ((interfaces . (dynamic-interface axis-group-interface side-position-interface))))
))
(LeftEdge
(staff-bar . (extra-space . 0.0))
(breathing-sign . (minimum-space . 0.0))
(clef . (extra-space . 1.0))
- (begin-of-note . (extra-space . 0.0))
+ (first-note . (extra-space . 0.0))
(key-signature . (extra-space . 0.0))
))
- (meta . ,(grob-description break-aligned-interface))
+ (meta . ((interfaces . (break-aligned-interface))))
))
(Fingering
(font-family . number)
(font-relative-size . -3)
(font-shape . upright)
- (meta . ,(grob-description finger-interface font-interface
- text-script-interface text-interface side-position-interface))
+ (meta . ((interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface))))
))
. (
(Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback))
(Y-extent-callback . ,Hara_kiri_group_spanner::y_extent)
- (axes 1)
- (meta . ,(grob-description axis-group-interface hara-kiri-group-interface))
+ (axes . (1))
+ (meta . ((interfaces . (axis-group-interface hara-kiri-group-interface))))
))
(Hairpin
(dash-length . 4.0)
(self-alignment-Y . 0)
(Y-offset-callbacks . (,Side_position_interface::aligned_on_self))
- (meta . ,(grob-description hairpin-interface dynamic-interface))
+ (meta . ((interfaces . (hairpin-interface dynamic-interface))))
))
(InstrumentName
(visibility-lambda . ,begin-of-line-visible)
(baseline-skip . 2)
(font-family . roman)
- (meta . ,(grob-description font-interface text-interface break-aligned-interface))
+ (meta . ((interfaces . (font-interface side-position-interface text-interface break-aligned-interface))))
))
(KeySignature
(space-alist . (
(time-signature . (extra-space . 1.25))
(staff-bar . (extra-space . 1.1))
- (begin-of-note . (extra-space . 2.5))
+ (first-note . (extra-space . 2.5))
))
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(break-align-symbol . key-signature)
(visibility-lambda . ,begin-of-line-visible)
(breakable . #t)
- (meta . ,(grob-description key-signature-interface font-interface break-aligned-interface))
+ (meta . ((interfaces . (key-signature-interface font-interface break-aligned-interface))))
))
(maximum-length . 100)
(molecule-callback . ,Hyphen_spanner::brew_molecule)
(Y-extent-callback . ,Grob::point_dimension_callback)
- (meta . ,(grob-description lyric-hyphen-interface ))
+ (meta . ((interfaces . (lyric-hyphen-interface))))
))
(LyricExtender
(height . 0.8) ; stafflinethickness;
(right-trim-amount . 0.5)
(Y-extent-callback . ,Grob::point_dimension_callback)
- (meta . ,(grob-description lyric-extender-interface))
+ (meta . ((interfaces . (lyric-extender-interface))))
))
(LyricText
(end-alignment . 2)
(font-family . roman)
(font-shape . upright)
- (meta . ,(grob-description lyric-syllable-interface text-interface font-interface ))
+ ;; duh, side-position-interface?
+ (meta . ((interfaces . (lyric-syllable-interface side-position-interface text-interface font-interface))))
))
(Porrectus
(style . mensural)
(auto-properties . #f)
(solid . #f)
- (porrectus-width . 2.4)
- (line-thickness . 1.0)
+ (width . 2.4)
+ (thickness . 1.0)
(add-stem . #t)
- (stem-direction . 1)
+ (direction . 1)
(molecule-callback . ,Porrectus::brew_molecule)
- (meta . ,(grob-description porrectus-interface))
+ (meta . ((interfaces . (porrectus-interface))))
))
(RehearsalMark
(font-relative-size . 1)
(visibility-lambda . ,end-of-line-invisible)
(padding . 0.8)
- (meta . ,(grob-description mark-interface side-position-interface))
+ (meta . ((interfaces . (text-interface font-interface mark-interface side-position-interface))))
))
(MultiMeasureRest
(minimum-width . 12.5) ; staffspace
(font-family . number)
(font-relative-size . 1)
- (meta . ,(grob-description multi-measure-rest-interface rest-interface font-interface ))
+ (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface))))
))
(NoteCollision
. (
- (axes 0 1)
+ (axes . (0 1))
;; Ugh, should not be hard-coded.
(note-width . 1.321)
- (meta . ,(grob-description
- note-collision-interface axis-group-interface
- ))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (meta . ((interfaces . (note-collision-interface axis-group-interface))))
))
(NoteColumn
. (
(axes . (0 1))
- (meta . ,(grob-description axis-group-interface note-column-interface))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (meta . ((interfaces . (axis-group-interface note-column-interface))))
))
(NoteHead
(molecule-callback . ,Note_head::brew_molecule)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(stem-attachment-function . ,note-head-style->attachment-coordinates)
- (meta . ,(grob-description rhythmic-head-interface font-interface note-head-interface))
+ (meta . ((interfaces . (rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface))))
))
(Glissando
(X-extent-callback . #f)
(Y-extent-callback . #f)
(molecule-callback . ,Line_spanner::brew_molecule)
- (meta . ,(grob-description line-spanner-interface))
+ (meta . ((interfaces . (line-spanner-interface))))
))
(VoiceFollower
(X-extent-callback . #f)
(Y-extent-callback . #f)
(molecule-callback . ,Line_spanner::brew_molecule)
- (meta . ,(grob-description line-spanner-interface))
+ (meta . ((interfaces . (line-spanner-interface))))
))
(NoteName
. (
(molecule-callback . ,Text_item::brew_molecule)
(font-family . roman)
- (meta . ,(grob-description note-name-interface font-interface))
+ (meta . ((interfaces . (note-name-interface text-interface font-interface))))
))
(OctavateEight
(molecule-callback . ,Text_item::brew_molecule)
(font-shape . italic)
(font-family . roman)
- (meta . ,(grob-description text-interface font-interface ))
+ (meta . ((interfaces . (text-interface side-position-interface font-interface))))
))
(PaperColumn
. (
- (axes 0)
- ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8")
- (meta . ,(grob-description paper-column-interface axis-group-interface spaceable-element-interface))
+ (axes . (0))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+
+; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f)
+ (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface))))
))
(PhrasingSlur
(after-line-breaking-callback . ,Slur::after_line_breaking)
(extremity-rules . ,default-slur-extremity-rules)
(extremity-offset-alist . ,default-phrasing-slur-extremity-offset-alist)
- (de-uglify-parameters . ( 1.5 0.8 -2.0))
+ (de-uglify-parameters . (1.5 0.8 -2.0))
(Y-extent-callback . ,Slur::height)
(details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)
(bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006)
(attachment . (#f . #f))
(attachment-offset . ((0 . 0) . (0 . 0)))
(slope-limit . 0.8)
- (meta . ,(grob-description slur-interface))
+ (meta . ((interfaces . (slur-interface))))
))
(NonMusicalPaperColumn
. (
- (axes 0)
- ; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8")
- (meta . ,(grob-description paper-column-interface
- axis-group-interface spaceable-element-interface))
+ (axes . (0))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+
+ ;; debugging stuff: print column number.
+; (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f)
+
+
+ (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface))))
))
(PercentRepeat
(thickness . 0.48)
(minimum-width . 12.5) ; staffspace
(font-family . music)
- (meta . ,(grob-description multi-measure-rest-interface font-interface percent-repeat-interface))
+ (meta . ((interfaces . (multi-measure-rest-interface font-interface percent-repeat-interface))))
))
(PianoPedalBracket ;; an example of a text spanner
(edge-height . (1.0 . 1.0))
(shorten-pair . (0.0 . 0.0))
(thickness . 1.0)
- (meta . ,(grob-description piano-pedal-interface))
+ (meta . ((interfaces . (piano-pedal-interface))))
))
(RepeatSlash
(molecule-callback . , Percent_repeat_item_interface::beat_slash)
(thickness . 0.48)
(slope . 1.7)
- (meta . ,(grob-description percent-repeat-interface))
+ (meta . ((interfaces . (percent-repeat-interface))))
))
(Rest
. (
(molecule-callback . ,Rest::brew_molecule)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(minimum-beam-collision-distance . 1.5)
- (meta . ,(grob-description
- rhythmic-head-interface
- staff-symbol-referencer-interface
- rest-interface))
- ))
+ (meta . (
+ (interfaces . (font-interface
+ rhythmic-head-interface
+ staff-symbol-referencer-interface
+ rest-interface))
+ ))))
(RestCollision
. (
(minimum-distance . 0.75)
- (meta . ,(grob-description rest-collision-interface ))
+ (meta . ((interfaces . (rest-collision-interface))))
))
(Script
(X-offset-callbacks . (,Side_position_interface::centered_on_parent))
(before-line-breaking-callback . ,Script::before_line_breaking)
(font-family . music)
- (meta . ,(grob-description script-interface side-position-interface font-interface))
+ (meta . ((interfaces . (script-interface side-position-interface font-interface))))
))
(ScriptColumn
. (
(before-line-breaking-callback . ,Script_column::before_line_breaking)
- (meta . ,(grob-description script-column-interface))
+ (meta . ((interfaces . (script-column-interface))))
))
(Slur
(after-line-breaking-callback . ,Slur::after_line_breaking)
(extremity-rules . ,default-slur-extremity-rules)
(extremity-offset-alist . ,default-slur-extremity-offset-alist)
- (de-uglify-parameters . ( 1.5 0.8 -2.0))
+ (de-uglify-parameters . (1.5 0.8 -2.0))
(Y-extent-callback . ,Slur::height)
(details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)
(bezier-pct-c0 . -0.2) (bezier-pct-c3 . 0.000006)
(attachment . (#f . #f))
(attachment-offset . ((0 . 0) . (0 . 0)))
(slope-limit . 0.8)
- (meta . ,(grob-description slur-interface))
+ (meta . ((interfaces . (slur-interface))))
))
(SpacingSpanner
(shortest-duration-space . 2.0)
(spacing-increment . 1.2)
- (X-extent-callback . #f)
- (Y-extent-callback . #f)
-
- (meta . ,(grob-description spacing-spanner-interface))
+ (meta . ((interfaces . (spacing-spanner-interface))))
))
(SpanBar
(molecule-callback . ,Span_bar::brew_molecule)
(visibility-lambda . ,begin-of-line-invisible)
(X-extent-callback . ,Span_bar::width_callback)
+ (Y-extent-callback . ())
(breakable . #t)
(glyph . "|")
(before-line-breaking-callback . ,Span_bar::before_line_breaking)
(thin-kern . 3.0)
(hair-thickness . 1.6)
(thick-thickness . 6.0)
- (meta . ,(grob-description span-bar-interface bar-line-interface ))
+ (meta . ((interfaces . (span-bar-interface bar-line-interface))))
))
(StanzaNumber
(break-align-symbol . clef)
(visibility-lambda . ,begin-of-line-visible)
(font-family . roman)
- (meta . ,(grob-description break-aligned-interface text-interface font-interface))
+ (meta . ((interfaces . (break-aligned-interface text-interface font-interface))))
))
(StaffSpacing
. (
(breakable . #t)
- (X-extent-callback . #f)
(stem-spacing-correction . 0.4)
- (Y-extent-callback . #f)
- (meta . ,(grob-description staff-spacing-interface))
+ (meta . ((interfaces . (staff-spacing-interface))))
))
(NoteSpacing
. (
- (X-extent-callback . #f)
- (Y-extent-callback . #f)
(stem-spacing-correction . 0.5)
(space-factor . 1.0)
- (meta . ,(grob-description note-spacing-interface))
+ (meta . ((interfaces . (note-spacing-interface))))
))
(StaffSymbol
(staff-space . 1.0)
(line-count . 5)
(layer . 0)
- (meta . ,(grob-description staff-symbol-interface ))
+ (meta . ((interfaces . (staff-symbol-interface))))
))
(SostenutoPedal
(font-family . roman)
(font-shape . italic)
(self-alignment-X . 0)
- (meta . ,(grob-description text-interface font-interface))
+ (meta . ((interfaces . (text-interface font-interface))))
))
(SostenutoPedalLineSpanner
. (
- (axes . ( 1))
+ (axes . (1))
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+
(padding . 1.2)
(minimum-space . 1.0)
(direction . -1)
- (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface))
+ (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface))))
))
(Stem
(X-offset-callbacks . (,Stem::off_callback))
(X-extent-callback . ,Stem::dim_callback)
(Y-extent-callback . ,Stem::height)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(adjust-if-on-staffline . #t)
(font-family . music)
- (meta . ,(grob-description stem-interface font-interface))
+ (meta . ((interfaces . (stem-interface font-interface))))
))
(StemTremolo
(beam-width . 2.0) ; staff-space
(beam-thickness . 0.48) ; staff-space
- (meta . ,(grob-description stem-tremolo-interface ))
+ (meta . ((interfaces . (stem-tremolo-interface))))
))
(SeparationItem
. (
- (meta . ,(grob-description separation-item-interface ))
+ (meta . ((interfaces . (separation-item-interface))))
))
(SeparatingGroupSpanner
. (
(spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
- (meta . ,(grob-description separation-spanner-interface))
+ (meta . ((interfaces . (separation-spanner-interface))))
))
(SustainPedal
(padding . 0.0) ;; padding relative to SustainPedalLineSpanner
(pedal-type . text)
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
- (meta . ,(grob-description piano-pedal-interface side-position-interface font-interface))
+ (meta . ((interfaces . (piano-pedal-interface text-spanner-interface text-interface side-position-interface font-interface))))
))
(SustainPedalLineSpanner
. (
- (axes . ( 1))
+ (axes . (1))
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+
(padding . 1.2)
(minimum-space . 1.0)
(direction . -1)
- (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface))
+ (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface))))
))
(System
. (
(axes . (0 1))
- (meta . ,(grob-description line-of-score-interface axis-group-interface))
+ (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (meta . ((interfaces . (system-interface axis-group-interface))))
))
(SystemStartBrace
(collapse-height . 5.0)
(font-family . braces)
(Y-extent-callback . #f)
- (meta . ,(grob-description system-start-delimiter-interface font-interface))
+ (meta . ((interfaces . (system-start-delimiter-interface font-interface))))
))
(SystemStartBracket
(arch-width . 1.5)
(bracket-collapse-height . 1)
(thickness . 0.25)
- (meta . ,(grob-description system-start-delimiter-interface ))
+ (meta . ((interfaces . (system-start-delimiter-interface))))
))
(SystemStartBar
(glyph . "bar-line")
(thickness . 1.6)
(after-line-breaking-callback . ,System_start_delimiter::after_line_breaking)
- (meta . ,(grob-description system-start-delimiter-interface ))
+ (meta . ((interfaces . (system-start-delimiter-interface))))
))
(TextScript
;; todo: add X self alignment?
(baseline-skip . 2)
(font-family . roman)
- (meta . ,(grob-description text-script-interface text-interface side-position-interface font-interface ))
+ (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface))))
))
(TextSpanner
(width-correct . -1)
(direction . 1)
- (meta . ,(grob-description text-spanner-interface font-interface))
+ (meta . ((interfaces . (text-spanner-interface font-interface))))
))
(Tie
(x-gap . 0.2)
(y-offset . 0.6)
(minimum-length . 2.5)
- (meta . ,(grob-description tie-interface ))
+ (meta . ((interfaces . (tie-interface))))
))
(TieColumn
. (
(after-line-breaking-callback . ,Tie_column::after_line_breaking)
- (meta . ,(grob-description tie-column-interface ))
+ (X-extent-callback . ())
+ (Yoo-extent-callback . ())
+ (meta . ((interfaces . (tie-column-interface))))
))
(TimeSignature
(break-align-symbol . time-signature)
(visibility-lambda . ,all-visible)
(space-alist . (
- (begin-of-note . (extra-space . 2.0))
+ (first-note . (extra-space . 2.0))
(staff-bar . (minimum-space . 2.0))
))
(breakable . #t)
(style . C)
(font-family . number)
- (meta . ,(grob-description time-signature-interface font-interface))
+ (meta . ((interfaces . (time-signature-interface font-interface))))
))
(TupletBracket
(font-family . roman)
(font-shape . italic)
(font-relative-size . -1)
- (meta . ,(grob-description text-interface
- tuplet-bracket-interface font-interface))
+ (meta . ((interfaces . (text-interface tuplet-bracket-interface font-interface))))
))
(UnaCordaPedal
(pedal-type . text)
(padding . 0.0) ;; padding relative to UnaCordaPedalLineSpanner
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
- (meta . ,(grob-description text-interface font-interface))
+ (meta . ((interfaces . (text-interface font-interface))))
))
(UnaCordaPedalLineSpanner
. (
- (axes . ( 1))
+ (axes . (1))
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(padding . 1.2)
(minimum-space . 1.0)
(direction . -1)
- (meta . ,(grob-description piano-pedal-interface axis-group-interface side-position-interface))
+ (meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface))))
))
(VoltaBracket
. (
- (molecule-callback . ,Volta_spanner::brew_molecule)
+ (molecule-callback . ,Volta_bracket_interface::brew_molecule)
(direction . 1)
(padding . 1)
(font-style . volta)
(minimum-space . 5)
(font-family . number)
(font-relative-size . -2)
- (meta . ,(grob-description volta-bracket-interface side-position-interface font-interface))
+ (meta . ((interfaces . (volta-bracket-interface text-interface side-position-interface font-interface))))
))
(VerticalAlignment
. (
- (axes 1)
+ (axes . (1))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
- (X-extent-callback . #f)
(stacking-dir . -1)
- (meta . ,(grob-description align-interface axis-group-interface))
+ (meta . ((interfaces . (align-interface axis-group-interface))))
))
(VerticalAxisGroup
. (
- (axes 1)
- (meta . ,(grob-description axis-group-interface))
+ (axes . (1))
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+
+ (meta . ((interfaces . (axis-group-interface))))
))
- )
- )
+ )
+ )
(define (completize-grob-entry x)
"transplant assoc key into 'name entry of 'meta of X
"
- (let* ((name-sym (car x))
- (entry (cdr x))
- (metaentry (cdr (assoc 'meta entry)))
- (new-metaentry (assoc-set! metaentry 'name name-sym))
- )
- (cons name-sym (assoc-set! entry 'meta new-metaentry))
- ))
+ (let* ((name-sym (car x))
+ (grob-entry (cdr x))
+ (metaentry (cdr (assoc 'meta grob-entry)))
+ (ifaces-entry
+ (cdr (assoc 'interfaces metaentry)))
+
+ )
+ (set! metaentry (assoc-set! metaentry 'name name-sym))
+ (set! metaentry (assoc-set! metaentry 'interfaces
+ (cons 'grob-interface ifaces-entry)))
+ (set! grob-entry (assoc-set! grob-entry 'meta metaentry))
+ (cons name-sym grob-entry)))
(set! all-grob-descriptions (map completize-grob-entry all-grob-descriptions))
(grob-property-description 'beam ly-grob? "pointer to the beam, if applicable.")
(grob-property-description 'beam-thickness number? "thickness, measured in staffspace.")
(grob-property-description 'beam-width number? "width of the tremolo sign.")
-(grob-property-description 'beamAuto boolean? "enable autobeaming?.")
(grob-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity .")
(grob-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity.")
(grob-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction.")
(grob-property-description 'beaming number-pair? "number of beams extending to left and right.")
-(grob-property-description 'beams list? "list of beam ptrs.")
(grob-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
-(grob-property-description 'before-grace-spacing-factor number? " stretch space this much if there are grace notes before the column.")
(grob-property-description 'before-line-breaking-callback procedure? "Procedure taking grob as argument.
This procedure is called (using dependency resolution) before line breaking, but after generating discretionary items. Return value is ignored.")
-(grob-property-description 'before-musical-spacing-factor number? "space before musical columns (eg. taken by accidentals) get this much
-stretched when they follow a musical column, in absence of grace
-notes. 0.0 means no extra space (accidentals are ignored).")
+(grob-property-description 'between-cols pair? "Where to attach a loose column to")
(grob-property-description 'between-system-string string? "string
to dump between two systems. Useful for forcing pagebreaks.")
(grob-property-description 'bounded-by-me list? "list of spanners that have this
(grob-property-description 'bar-line-collapse-height number? "Minimum height of system start delimiter bar-line glyphs. If equal or smaller, the bar-line is removed.")
(grob-property-description 'brace-collapse-height number? "Minimum height of system start delimiter brace glyphs. If equal or smaller, the brace is removed.")
(grob-property-description 'bracket-collapse-height number? "Minimum height of system start delimiter bracket glyphs. If equal or smaller, the bracket is removed.")
-(grob-property-description 'column-space-strength number? "relative strength of space following breakable columns (eg. prefatory matter).")
(grob-property-description 'columns list? "list of grobs, typically containing paper-columns, list of note-columns.")
-(grob-property-description 'contains-grace boolean? "Used to widen entries for grace notes.")
(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.")
@end table
")
-(grob-property-description 'dir-list list? "list of stem directions, needed for optical spacing correction.")
(grob-property-description 'direction dir? "up or down, left or right?.")
(grob-property-description 'direction-source ly-grob? "in case side-relative-direction is set, which grob to get the direction from .")
(grob-property-description 'dot ly-grob? "reference to Dots object.")
(grob-property-description 'dot-count integer? "number of dots.")
(grob-property-description 'duration-log integer? "2-log of the notehead duration, i.e. 0=whole note, 1 = half note, etc.")
-(grob-property-description 'dy number? "set by beam: vertical travel height")
+
(grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical edges '(LEFT-height . RIGHT-height).")
(grob-property-description 'edge-width pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).")
(grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).")
.")
(grob-property-description 'height number? "in staffspace.")
(grob-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}.")
-(grob-property-description 'horizontal-space number? "amount of space to add after a note (in staff-space).")
(grob-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs.")
(grob-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.")
(grob-property-description 'inversion list? " musical-pitch, optional.")
(grob-property-description 'layer number? "The output layer [0..2]. The default is 1.")
(grob-property-description 'left-padding number? "space left of accs.")
+(grob-property-description 'right-head ly-grob? "")
+(grob-property-description 'left-head ly-grob? "")
+
(grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-width.")
(grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.")
work: @code{\override} is processed after the StaffSymbol is created,
and will have no effect.
")
-(grob-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line.")
(grob-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name.")
(grob-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts.")
-(grob-property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
(grob-property-description 'maximum-length number? "don't make Grob longer than this")
(grob-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.")
(grob-property-description 'measure-count integer? "number of measures for a multimeasure rest.")
(grob-property-description 'note-heads list? "List of note head grobs")
(grob-property-description 'number-gap number? "size of the gap for tohe number in a tuplet.")
(grob-property-description 'old-accidentals list? "list of (pitch, accidental) pairs.")
-(grob-property-description 'origin ly-input-location? "location in input file of the definition.")
-(grob-property-description 'outer-stem-length-limit number? "catch
-suspect beam slopes, set slope to zero if outer stem is lengthened
-more than this (in staffspace).")
-
(grob-property-description 'padding number? "add this much extra space between objects that are next to each other.")
-(grob-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket .")
(grob-property-description 'paren-cautionaries boolean? "Whether to add parenthesis around cautionary accidentals.")
(grob-property-description 'pedal-type symbol? "Style of piano pedal: text, bracket or mixed.")
(grob-property-description 'penalty number? "Penalty for breaking at
as a real penalty.")
(grob-property-description 'pitches list? "list of musical-pitch.")
-(grob-property-description 'porrectus-width number? "width of the porrectus ligature measured in staff space.")
(grob-property-description 'positions pair? "cons of staff positions (LEFT . RIGHT")
(grob-property-description 'raise number? "height for text to be raised (a negative value lowers the text.")
(grob-property-description 'right-padding number? "space right of accs.")
spacing tuples: format = (SYMBOL . (TYPE . DISTANCE)), where TYPE can be
minimum-space or extra-space.")
-(grob-property-description 'space-factor number? "Scale horizontal spacing up by this amount.")
(grob-property-description 'spacing-procedure procedure? "procedure
taking grob as argument. This is called after
before-line-breaking-callback, but before the actual line breaking
does the stem attach to the notehead? Function takes a symbol argument
being the style. It returns a (X . Y) pair, specifying location in
terms of note head bounding box.")
-(grob-property-description 'stem-direction dir? "up or down?.
-
-[docme: why not direction]
-")
(grob-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head.")
-(grob-property-description 'stem-length number? "length of stem.")
+
(grob-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity.")
(grob-property-description 'stem-spacing-correction number? "optical correction amount. [TODO: doco] ")
(grob-property-description 'stems list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.")
-(grob-property-description 'stretch-distance number-pair? "pair of distances.")
(grob-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. .")
(grob-property-description 'support-head ly-grob? "the note head at
one end of the stem.")
(grob-property-description 'ignore-length-mismatch boolean? "if #t, stanzas with shorter lyrics can be moved away from their respective note-head by the lyric alignment code.")
(grob-property-description 'begin-alignment number? "proportion of lyric length from beginning to align with note-head for left-aligned lyrics.")
(grob-property-description 'end-alignment number? "proportion of lyric length from end to align with note-head for right-aligned lyrics.")
+(grob-property-description 'width number? "width of a grob measured in staff space.")
(grob-property-description 'x-gap number? "horizontal gap between notehead and tie.")
(grob-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems.")
(grob-property-description 'y-offset number? "extra vertical offset for ties away from the center line.")
-(grob-property-description 'y number? "set by beam: position of left edge.")
-
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;; INTERNAL
(grob-property-description 'accidentals-grob ly-grob? "accidentals for this note.")
(grob-property-description 'causes list? "list of cause objects.")
-(grob-property-description 'tremolo-flags number? "")
+(grob-property-description 'flag-count number? "")
(grob-property-description 'chord-tremolo boolean? "if set, this beam is a tremolo. TODO: use interface for this!")
(grob-property-description 'chord pair? "?")
(grob-property-description 'begin-of-line-visible boolean? "?")
; should include default value?
-
-;;; FIXME: naming.
-;;; Score elements are called `objects' now and then, which gets
-;;; rather confusing, we now have `elements', `items', `spanners'
-;;; and `objects'.
-
-
-;;; TODO: this should be done through C++ macros, in order to have
-;;; tighter coupling between the C++ and its doco.
-
-(define all-interfaces '())
-
-(define (lily-interface symbol description props)
- (set! all-interfaces (acons symbol (list symbol
- description
- props) all-interfaces)
- )
- )
-
-(define (grob-description . interfaces)
- (let* ((ifs (cons grob-interface interfaces))
- (props (map caddr ifs))
- ; (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
- ; (apply append props)))
- (syms (map car ifs))
- )
- (list (cons 'separator "\n\n\n") ;easy printing.
- (cons 'interfaces syms)
- (cons 'interface-descriptions ifs)
- ; (cons 'interface-descriptions (cadr merged))
- ;; description of the grob itself?
- ; (cons 'properties prop-typep-pairs)
- )))
-
-
-(lily-interface
- 'grob-interface
- "All grobs support this"
- '(
- X-offset-callbacks
- Y-offset-callbacks
- X-extent-callback
- Y-extent-callback
- molecule-callback
- font-relative-size
- extra-offset
- interfaces
- dependencies
- no-spacing-rods
- extra-extent-X
- extra-extent-Y
- minimum-extent-X
- minimum-extent-Y
- origin
- transparent
- ))
-
-
-(lily-interface
- 'beam-interface
- "A beam.
-
-#'thickness= weight of beams, in staffspace
- "
- '(auto-knee-gap
- beamed-stem-shorten
- damping
- flag-width-function
- neutral-direction
- outer-stem-length-limit
- positions
- slope-limit
- thickness
- )
- )
-
-(lily-interface
- 'staff-spacing-interface
- ""
- '(
- ))
-
-(lily-interface
- 'note-spacing-interface
- ""
- '(
- ))
-
-(lily-interface
- 'clef-interface
- "A clef sign"
- '(
- non-default
- full-size-change
- glyph
- ))
-
-
-
-(lily-interface
- 'axis-group-interface
- "a group of coupled grobs"
- '(
- axes
- ))
-
-
-(lily-interface
- 'note-column-interface
- "Stem and noteheads combined"
- '(
- note-heads
- horizontal-shift
- force-hshift
- ))
-
-
-(lily-interface
- 'stem-interface
- "A stem"
- '(
- thickness
- beamed-lengths
- beamed-minimum-lengths
- lengths
- beam
- stem-shorten
- duration-log
- beaming
- neutral-direction
- stem-end-position
- support-head
- heads
- direction
- length
- style
- flag-style
- dir-forced
- ))
-
-
-
-(lily-interface
- 'slur-interface
- "A slur"
- '(
- de-uglify-parameters
- details
- attachment
- direction
- attachment-offset
- beautiful
- y-free
- control-points
- extremity-rules
- extremity-offset-alist
- thickness
- dashed
-
- )
- )
-
-
-
-(lily-interface
- 'side-position-interface
- "Position a victim object (this one) next to other objects (the support).
-#'direction = where to put the victim object (left or right?)
-"
- '(
- side-support-elements
- direction-source
- direction
- side-relative-direction
- minimum-space
- padding
- self-alignment-X
- self-alignment-Y
-
- )
- )
-
-
-(lily-interface
- 'accidentals-interface
- "Accidentals"
- '(accidentals
- left-padding
- right-padding
- paren-cautionaries
- cautionary-size
- ))
-
-
-
-(lily-interface
- 'line-of-score-interface
- "Super grob, parent of all:
-
-The columns of a score that form one line. The toplevel grob. Any
-grob has a Line_of_score as both X and Y reference point. The
-Paper_score contains one grob of this type. Control enters the
-Grob dependency calculation from this single Line_of_score
-object."
- '(
- between-system-string
- spacing-procedure
- before-line-breaking-callback
- after-line-breaking-callback
- all-elements
- columns
- ))
-
-
-(lily-interface
- 'note-head-interface
- "Note head"
- '( style stem-attachment-function ))
-
-
-(lily-interface
- 'note-name-interface
+(ly-add-interface
+'note-name-interface
"Note name"
- '( style ))
-
-
-
-(lily-interface
- 'rhythmic-head-interface
- "Note head or rest"
- '(
- dot
- stem
- duration-log
- ))
-
-
-(lily-interface
- 'rest-interface
- "a rest"
- '(style ))
-
-
-(lily-interface
- 'tuplet-bracket-interface
- "A bracket with a number in the middle, used for tuplets."
- '(
- columns
- number-gap
- delta-y
- tuplet-bracket-visibility
- tuplet-number-visibility
- thick
- direction
- ))
-
-
-(lily-interface
- 'align-interface
- " Order grobs top to bottom/left to right/right to left etc."
- '(
- stacking-dir
- align-dir
- threshold
- alignment-done
- center-element
- elements
- axes
- ))
-
-
-(lily-interface
- 'aligned-interface
- "read by align-interface"
- '(
- minimum-space
- extra-space
- ))
-
-
-(lily-interface
- 'break-aligned-interface
- "Items that are aligned in prefatory matter"
- '(
- break-align-symbol
- space-alist
- visibility-lambda
- breakable
- ))
-
-
-(lily-interface
- 'chord-name-interface
- "generate a chord name"
- '( pitches inversion bass))
-
-
-(lily-interface
- 'time-signature-interface
- "A time signature, in different styles.
- The following values for 'style are are recognized:
-
- @table @samp
- @item @code{C}
- 4/4 and 2/2 are typeset as C and struck C, respectively. All
- other time signatures are written with two digits.
-
- @item @code{old}
- 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
- typeset with old-style mensuration marks. All other time
- signatures are written with two digits.
-
- @item @code{1xxx}
- All time signatures are typeset with a single
- digit, e.g. 3/2 is written as 3. (Any symbol starting
- with the digit @code{1} will do.)
-
- @item @code{C}@var{M}@code{/}@var{N},
-@code{old}@var{M}@code{/}@var{N} or
- @code{old6/8alt}
- Tells LilyPond to use a specific symbol as time signature,
- regardless of the actual time signature.
- @end table
-
-See also the test-file @file{input/test/time.ly}.
-"
- '(fraction style ))
-
-
-(lily-interface
- 'bar-line-interface
- "Bar line.
-
-This is a request to print a special bar symbol. It replaces the
-regular bar symbol with a special
-symbol. The argument @var{bartype} is a string which specifies the
-kind of bar to print. Options are @code{\":|\"}
-@cindex \"|A@@@code{:|}
-,
-@code{\"|:\"}
-@cindex \"|B@@@code{|:}
-, @code{\":|:\"}
-@cindex \"|C@@@code{:|:}
-,
-@code{\"||\"}
-@cindex \"|D@@@code{||}
-, @code{\"|.\"}
-@cindex \"|E@@@code{|.}
-,
-@code{\".|\"}
-@cindex \"|F@@@code{.|}
-, and @code{\".|.\"}
-@cindex \"|G@@@code{.|.}
-.
-
-These produce, respectively, a right repeat, a left repeat, a double
-repeat, a double bar, a start bar, an end bar, and a thick double bar.
-If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
-but a line break is allowed at that spot.
-
-"
- '(bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function ))
-
-
-(lily-interface
- 'hairpin-interface
- "hairpin crescendo.
-
-padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
-
-"
- '( grow-direction thickness height padding
- ))
-
-
-(lily-interface
- 'arpeggio-interface
- "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
- '(stems arpeggio-direction))
-
-
-
-(lily-interface
- 'note-collision-interface
- "An object that handles collisions between notes with different
-stem directions and horizontal shifts. Most of the interesting
-properties are to be set in @ref{note-column-interface}"
- '(merge-differently-dotted note-width))
-
-
-
-(lily-interface
- 'custos-interface
- "A custos is a staff context symbol that appears at the end of a
- staff line with monophonic musical contents (i.e. with a single
- voice). It anticipates the pitch of the first note of the following
- line and thus helps the player or singer to manage line breaks
- during performance, thus enhancing readability of a score.
-
- Custodes were frequently used in music notation until the 16th
- century. There were different appearences for different notation
- styles. Nowadays, they have survived only in special forms of
- musical notation such as via the editio vaticana dating back to the
- beginning of the 20th century.
-
-[TODO: add to glossary]"
-
- '(style))
-
-
-
+ '(style))
-
-
- (lily-interface
- 'dots-interface
- "The dots to go with a notehead/rest. A separate interface, since they
-are a party in collision resolution.
-#'direction is the Direction to handle staff-line collisions in."
- '(direction dot-count))
-
-
- (lily-interface
- 'font-interface
- "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
- '(font-style font-series font-shape font-family font-name
-font-design-size font-relative-size)
- )
-
-
-
- (lily-interface
- 'text-interface
- "A scheme markup text"
- '(text align baseline-skip lookup raise kern magnify))
-
-
- (lily-interface
- 'dot-column-interface
- "Interface that groups dots so they form a column"
- '( )
- )
-
-
- (lily-interface
- 'dynamic-interface
+(ly-add-interface
+ 'dynamic-interface
"Any kind of loudness sign"
'()
)
+(ly-add-interface
+ 'finger-interface
+ "A fingering instruction"
+ '()
+ )
-
- (lily-interface
- 'finger-interface
- "A fingering instruction"
- '()
- )
-
-
- (lily-interface
- 'separation-spanner-interface
- "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
- '()
- )
-
- (lily-interface
- 'text-script-interface
- "Any text script"
- '()
- )
-
-
- (lily-interface
- 'grace-alignment-interface
- "put grace notes in line"
- '(
- horizontal-space
- )
- )
-
-
- (lily-interface
- 'hara-kiri-group-interface
- " As Vertical_group_spanner, but keep track of interesting items. If
-we don't contain any interesting items after linebreaking, then
-gracefully commit suicide. Objective: don't disgrace Lily by
-typesetting empty lines in orchestral scores."
- '( items-worth-living )
-)
-
-
- (lily-interface
- 'line-spanner-interface
- "Generic line drawn between two objects, eg. for use with glissandi.
-gap is measured in staff-spaces. "
-
- '(gap dash-period dash-length line-thickness type
- ))
-
-
- (lily-interface
- 'lyric-hyphen-interface
- "A centred hyphen is a simple line between lyrics used to divide
-syllables. The length of the hyphen line should stretch based on the
-size of the gap between syllables."
-
- '( thickness height minimum-length word-space
- ))
-
-
- (lily-interface
- 'key-signature-interface
- "A group of accidentals."
- '(
- c0-position
- old-accidentals
- new-accidentals
- ))
-
-
- (lily-interface
- 'lyric-extender-interface
- "The extender is a simple line at the baseline of the lyric
-that helps show the length of a melissima (tied/slurred note)."
- '(
- word-space
- height
- right-trim-amount
- ))
-
-
-
- (lily-interface
- 'lyric-syllable-interface
- "a single piece of lyrics"
- '(
- word-space
- alignment
- ignore-length-mismatch
- begin-alignment
- end-alignment
- ))
-
-
-
- (lily-interface
- 'mark-interface
- "a rehearsal mark"
- '(
- ))
-
-
- (lily-interface
- 'multi-measure-rest-interface
- "A rest that spans a whole number of measures. For typesetting the
-numbers, fields from font-interface may be used.
-
-padding is the space between number and rest. Measured in staffspace.
-
-"
- '( columns expand-limit minimum-width padding))
-
-
- (lily-interface
- 'paper-column-interface
- ""
-
- '(column-space-strength before-musical-spacing-factor
-stem-spacing-correction before-grace-spacing-factor when bounded-by-me
-dir-list shortest-playing-duration shortest-starter-duration
-contains-grace extra-space stretch-distance ))
-
-
- (lily-interface
- 'piano-pedal-interface
- ""
- '(pedal-type
- edge-width
- edge-height
- shorten-pair
- left-widen
- right-widen
- ))
-
-
- (lily-interface
- 'porrectus-interface
- "A porrectus ligature, joining two note heads into a single grob."
- '(
- ))
-
-
- (lily-interface
- 'spaceable-element-interface
- "An grob (generally a Paper_column) that takes part in the
-spacing problem. "
- '(penalty
- minimum-distances
- ideal-distances
- dir-list
- ))
-
-
- (lily-interface
- 'rest-collision-interface
- "Move around ordinary rests (not multi-measure-rests) to avoid
-conflicts."
- '(
- maximum-rest-count
- minimum-distance
- elements
- ))
-
-
- (lily-interface
- 'script-interface
- ""
- '(
- script-priority
- ))
-
-
- (lily-interface
- 'script-column-interface
- "An interface that sorts scripts according to their @code{script-priority}"
- '( ))
-
-
-
- (lily-interface
- 'spacing-spanner-interface
- " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
-The space taken by a note is determined by the formula
-
-
-
-where TIME is the amount of time a note occupies. The value of C is
-chosen such that the smallest space within a measure is
-arithmetic_basicspace:
-
-C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8))
-
-The smallest space is the one following the shortest note in the
-measure, or the space following a hypothetical 1/8 note. Typically
-arithmetic_basicspace is set to a value so that the shortest note
-takes about two noteheads of space (ie, is followed by a notehead of
-space):
-
-@example
-2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
-
-@{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
-@{ assuming: SHORTEST <= 1/8 @}
-
-= arithmetic_multiplier *
-( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
-
-= arithmetic_multiplier * arithmetic_basicspace
-
-@{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
-
-= quartwidth * arithmetic_basicspace
-
-=>
-
-arithmetic_basicspace = 2/1 = 2
-
-
-If you want to space your music wider, use something like:
-
-arithmetic_basicspace = 4.;
-
-@end example"
- '(
-spacing-increment
-shortest-duration-space
-
- ))
-
-
- (lily-interface
- 'staff-symbol-referencer-interface
-
- "Object whose Y position is meaning with reference to a staff
-symbol. Objects that have this interface should include
-Staff_symbol_referencer::callback in their Y-offset-callback.
-"
- '(
- staff-symbol
- staff-position
- ))
-
-
- (lily-interface
- 'staff-symbol-interface
- "This spanner draws the lines of a staff. The middle line is
-position 0."
- '(
- staff-space
- line-count
- invisible-staff
- ))
-
-
- (lily-interface
- 'stem-tremolo-interface
- ""
- '( stem beam-width beam-thickness
- ))
-
-
- (lily-interface
- 'separation-item-interface
- "Item that computes widths to generate spacing rods.
-
-Calc dimensions for the Separating_group_spanner; this has to be
-an item to get dependencies correct. It can't be an grob_group
-since these usually are in a different X_group
-"
- '(
- elements
- ))
-
-
- (lily-interface
- 'system-start-delimiter-interface
- "#'style can be bar-line, bracket or brace"
- '(bar-line-collapse-height brace-collapse-height bracket-collapse-height
- thickness arch-height arch-angle arch-thick
- arch-width bracket-thick glyph ))
-
-
- (lily-interface
- 'text-spanner-interface
- "generic text spanner"
- '(
- dash-period
- dash-length
- line-thickness
- edge-height
- edge-width
- edge-text
- shorten-pair
- type
-))
-
-
- (lily-interface
- 'tie-interface
- "A tie connecting two noteheads.
-direction = Forced direction for all ties"
-
- '(
- staffline-clearance
- control-points
- heads
- details
- thickness
- x-gap
- direction
- minimum-length
- ))
-
-
-
-
- (lily-interface
- 'tie-column-interface
- "that sets tie directions in a tied chord"
- '(direction
- ))
-
-(lily-interface
- 'percent-repeat-interface
- "Repeats that look like percent signs"
- '(slope thickness))
-
-(lily-interface
- 'volta-bracket-interface
- "Volta bracket with number"
- '(
- bars
- thickness
- height
- ))
-
-
-(lily-interface
- 'span-bar-interface
- "A bar line that spans other barlines (typically used to get cross-staff barlines."
+(ly-add-interface
+ 'mark-interface
+ "a rehearsal mark"
'(
))
-
-
-(primitive-eval (cons
- 'begin
- (map (lambda (x) (list 'define (car x) (list 'quote (cdr x))))
- all-interfaces)))
-
-
-(define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
-
-