-1.3.96.jcn7
+1.3.96.jcn9
===========
-* Junked all old style text lookups, except for feta definitions.
+* Moved Text_script_req's text_ member into mus-property.
-1.3.96.jcn6
-===========
+* Renamed ChordName to ChordNames, for consistancy.
-* Added support for name-based character lookups.
+* Resurrected most of chord names, superscripting and kerning
+ is currently broken, though.
-1.3.96.jcn5
+1.3.96.jcn7
===========
-* Added support for font styles and papersize style sheets.
+* Junked all old style text lookups, except for feta definitions.
-1.3.96.jcn4
-===========
+* Added support for name-based character lookups.
+
+* Added support for font styles and papersize style sheets.
* Added new code for font selection and scm text markup. Only used
for testing in \textscript SCM. See input/test/markup.ly.
-1.3.96.jcn3
-===========
-
* Fixed (added actually, it got lost?) word-space for chords.
-1.3.96.jcn1
-===========
-
* Added slope-limit and attachment-offset properties to slur.
* Slur's broken trend now weighs in the number of note-columns.
* Spacing tweaks:
+1.3.96.hwn1
+===========
+
+* Mudela-book fixes (Tom Cato Amundsen)
+
+* Put marks above chords.
+
+* Solaris fix.
+
+* Type checking for \push and \pop; elt property description (docs
+inclusive) is now in Scheme. Preliminary auto-documentation in
+ly/generate-documentation.ly
+
+
1.3.95.jcn5
===========
careful, don't give the source file that ext, or the file will be
overwritten.
+If you use @code{--outdir}, you should also @code{cd} to that directory
+before running LaTeX or makeinfo.
+
@strong{[UGH: IS THIS THE BEST WAY TO DO IT. MAYBE ADD A COMMENT LINE TO THE
GENERATED FILE, SO MUDELA-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
IS GENERATED.]}
Ignores almost all La@TeX{} commands that changes margins and linewidths.
-La@TeX{} comments can confuse @command{mudela-book}:
-@example
-% this music will be displayed: \mudela@{c d e@}
-@end example
-
@section Authors
@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
- Improved robustness: Lily almost never crashes.
-* Piano pedal support
+* Piano pedal support, Arpeggios
* MIDI: dynamics, tempo changes
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=96
-MY_PATCH_LEVEL=jcn8
+MY_PATCH_LEVEL=jcn9
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
+\version "1.3.96"
%{
See scm/chord-names.scm: chord::names-alist-american
James Hammons <jlhamm@pacificnet.net>
chord::names-alist-american))
chord = \notes\transpose c''\chords{
- \property ChordNames.ChordName \push #'style = #"american"
+ \property ChordNames.ChordNames \push #'style = #"american"
c
cs:m
df:m5-
\paper
{
\translator {
- \ChordNameContext
- ChordName \push #'word-space = #1
+ \ChordNamesContext
+ ChordNames \push #'word-space = #1
}
}
}
+\version "1.3.96"
chord = \notes\transpose c''\chords{
c1
c:m
\paper{
linewidth = -1.0;
\translator {
- \ChordNameContext
- ChordName \push #'word-space = #1
+ \ChordNamesContext
+ ChordNames \push #'word-space = #1
}
}
}
-\version "1.3.96";
+\version "1.3.97";
%{
Would this be acceptable/good enough/convenient for entry?
+\version "1.3.96"
%% This should only be necessary if your kpathsea setup is broken
%%
%% Make sure the correct msamxx.tfm is where lily can find it
;; any changes here, see scm/chord-names.scm
- ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (("o7" (type . "super"))))
+ ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super "o7"))
;jazz: the delta, see jazz-chords.ly
- (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (("N" (type . "super") (style . "msam") (size . -3))))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((family . "math") "N")))
- ;(((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (("x7" (type . "super"))))
+ ;(((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (super "x7"))
; slashed o
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (("o" (type . "super")) ("/" (size . -2) (offset . (-0.58 . 0.5))) ("7" (type . "super"))))
-
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows (super "o") ((kern . -0.5) ((size . "-3") "/")) "7"))
)
chord::names-alist-american))
chord = \notes\transpose c''\chords{
- \property ChordNames.ChordName \push #'style = #"american"
+ \property ChordNames.ChordNames \push #'style = #"american"
c:m5-.7-
c:m5-.7
}
\paper
{
\translator {
- \ChordNameContext
- ChordName \push #'word-space = #1
+ \ChordNamesContext
+ ChordNames \push #'word-space = #1
}
}
}
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
- Score_element * sun = unsmob_element (element_smob);
+ Score_element * me = unsmob_element (element_smob);
Axis ax = (Axis )gh_scm2int (axis);
- Score_element * par = sun->parent_l (ax);
+ Score_element * par = me->parent_l (ax);
if (par && !to_boolean (par->get_elt_property ("alignment-done")))
{
Align_interface::do_side_processing (par, ax);
void
Bar::set_interface (Score_element*me)
{
- me->set_interface (ly_symbol2scm ("bar-interface"));
+ me->set_interface (ly_symbol2scm ("bar-line-interface"));
}
bool
Bar::has_interface (Score_element*m)
{
- return m && m->has_interface (ly_symbol2scm ("bar-interface"));
+ return m && m->has_interface (ly_symbol2scm ("bar-line-interface"));
}
if (script_req_l_)
{
script_p_ = new Item (get_property ("DynamicText"));
- script_p_->set_elt_property ("text", script_req_l_->text_);
+ script_p_->set_elt_property ("text",
+ script_req_l_->get_mus_property ("text"));
if (Direction d = script_req_l_->get_direction ())
Directional_element_interface::set (line_spanner_, d);
if (gh_procedure_p (proc))
{
// urg
- svolume = gh_call1 (proc, script_req_l_->text_);
+ svolume = gh_call1 (proc, script_req_l_->get_mus_property ("text"));
}
Real volume = 0.5;
#include "lily-proto.hh"
#include "lily-guile.hh"
-
-/*
- Order elements top to bottom/left to right/right to left etc.
-
-
- *******
-
- element properties
-
- stacking-dir -- stack contents of elements in which direction ?
-
- align-dir -- Which side to align? -1: left side, 0: centered (around
- center_l_ if not nil, or around center of width), 1: right side
-
- threshold -- (cons MIN MAX), where MIN and MAX are dimensions in
- staffspace
-
- alignment-done -- boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)
-
- center-element -- element which will be at the center of the group
- after aligning (when using
- Align_interface::center_on_element). The center element should
- have this object as a reference point.
-
- elements -- to be aligned elements
-
- axes -- list of axis numbers. Should contain only one number.
-
- *******
-
- Reads the following from its elements
-
-
- minimum-space -- (cons LEFT RIGHT)
-
- extra-space -- (cons LEFT RIGHT)
-
-*/
struct Align_interface {
DECLARE_SCHEME_CALLBACK(alignment_callback, (SCM element, SCM axis));
static void do_side_processing (Score_element*,Axis a);
#include "lily-guile.hh"
#include "lily-proto.hh"
-/*
- properties:
- stems -- list of stem objects, corresponding to the notes that the
- arp has to be before. */
class Arpeggio
{
public:
added to ELT_L_ to ELT_L_.
Properties:
-
- axes -- list of axis (number) in which this group works
-
- transparent -- an Axis_group is transparent by default
-
- elements -- contains list of pointers to other elements
-
- interfaces -- Axis_group is added to this list.
*/
struct Axis_group_interface
{
-/** a beam connects multiple stems.
-
- Beam adjusts the stems its owns to make sure that they reach the
- beam and that point in the correct direction (urg?)
-
- elt_properties:
-
- y-position -- real (position of left edge)
-
- height -- real (dy)
-
-
- Read-only
- =========
-
- flag-width-function --
-
- damping -- amount of beam slope damping. (int)
- should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
-
- default-neutral-direction -- which direction to choose if we're in
- the middle of the staff
-
- thickness -- weight of beams, in staffspace
-
- space-function -- function of type multiplicity -> real (in staffspace)
-
- beamed-stem-shorten --
-
- height-quants --
-
- vertical-position-quant-function --
-
- dir-function --
-
- damping -- damping factor (real).
-
- outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if
- outer stem is lengthened more than this (in staffspace)
-
- slope-limit -- set slope to zero if slope is running away steeper than this.
-*/
class Beam
{
public:
#include "item.hh"
-/**
- align breakable items (clef, bar, etc.)
-
- Properties:
-
- break-align-symbol -- the index in the spacing table (symbol) of
- the to be aligned item.
-
-*/
class Break_align_interface
{
public:
#include "lily-guile.hh"
#include "lily-proto.hh"
-/**
- Set a clef in a staff.
-
- properties:
-
- non-default -- not set because of existence of a bar?
-
- change -- is this a change clef (smaller size)?
-
- glyph -- a string determining what glyph is typeset
-
- */
struct Clef
{
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM ));
* Make interface of this, similar to align-interface.
- Properties:
-
- elements -- (see Axis_group_interface)
-
- merge-differently-dotted -- merge black noteheads with differing dot count.
-
- horizontal-shift -- integer that identifies ranking of note-column for horizontal shifting.
-
- force-hshift -- amount of collision_note_width that overides automatic collision settings.
- Read and removed from elements.
-
- note-width -- unit for horizontal translation, measured in staff-space.
-
*/
class Collision // interface
{
#include "lily-guile.hh"
/**
- The hairpin symbol. (cresc)
-
- (normal spanner?)
+ The hairpin symbol.
*/
struct Crescendo
{
-/**
- The dots to go with a notehead/rest. A separate class, since they
- are a party in collision resolution.
-
- properties:
-
- dot-count -- number of dots.
-
-
- */
-class Dots // interface
+class Dots
{
public:
DECLARE_SCHEME_CALLBACK(quantised_position_callback, (SCM element, SCM axis));
#include "lily-guile.hh"
#include "lily-proto.hh"
-/*
- horizontal-space -- amount of space to add after a note (in staff-space)
- */
-
class Grace_align_item
{
public:
#include "spanner.hh"
-/**
- centred hyphen
-
- 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.
-
-properties:
-
- thickness -- thickness of line (in stafflinethickness)
-
- height -- vertical offset (in staffspace)
-
- minimum-length -- try to make the hyphens at least this long. Also works
- as a scaling parameter for the length
-
- word-space -- elongate left by this much (FIXME: cumbersome semantics)
-
- */
struct Hyphen_spanner
{
public:
#include "lily-proto.hh"
/**
- A group of accidentals.
- Properties:
- c0-position -- integer indicating the position of central C?
+ Properties:
- old-accidentals -- list of (pitch, accidental) pairs
- new-accidentals -- list of (pitch, accidental) pairs
*/
struct Key_item
{
return CL::unsmob (s); \
}
+#define IMPLEMENT_TYPE_P(CL, FUNCNAME)\
+void init_type_p_ ## CL ()\
+{\
+ scm_make_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\
+}\
+ADD_SCM_INIT_FUNC(init_type_p_ ## CL, init_type_p_ ## CL)
#ifndef SCM_CELL_TYPE
#define SCM_CELL_TYPE(X) SCM_CAR(X)
#define IMPLEMENT_SIMPLE_SMOBS(CL) \
long CL::smob_tag_; \
+SCM \
+CL::smob_p (SCM s) \
+{ \
+ if (SCM_NIMP(s) && SCM_CELL_TYPE(s) == smob_tag_) \
+ return SCM_BOOL_T; \
+ else \
+ return SCM_BOOL_F; \
+ \
+} \
void \
CL::init_smobs () \
{ \
#include "spanner.hh"
-/**
- simple extender line
-
- The extender is a simple line at the baseline of the lyric
- that helps show the length of a melissima (tied/slurred note).
+/*
Extenders must be entered manually for now.
extend beond, lasting the whole duration of the melissima
(as in MUP, urg).
- Properties:
-
- word-space --
- height -- in stafflinethickness
+ */
- right-trim-amount --
-
- */
-class Lyric_extender // interface
+class Lyric_extender
{
public:
Spanner*elt_l_;
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "rod.hh"
-/*
- properties:
- columns -- list of paper-columns
-
- expand-limit -- int : max number of measures expanded in church rests
-
- minimum-width -- Real in staffspace
-
- padding -- staffspace
-*/
class Multi_measure_rest
{
public:
#include "duration.hh"
#include "musical-pitch.hh"
#include "array.hh"
-#include "protected-scm.hh"
-
/** a request with a duration.
This request is used only used as a base class.
*/
class Lyric_req : public Rhythmic_req
{
-public:
- Protected_scm text_;
-
protected:
VIRTUAL_COPY_CONS (Music);
};
class Text_script_req : public Script_req
{
-public:
- Protected_scm text_;
-
protected:
VIRTUAL_COPY_CONS (Music);
virtual bool do_equal_b (Request const*) const;
class Dynamic_script_req : public Script_req
{
-public:
- Protected_scm text_;
-
protected:
VIRTUAL_COPY_CONS (Music);
};
NoteHead is a kind of RhythmicHead, see there.
Read-only:
-
- style -- symbol that sets note head style
*/
class Note_head
#include "rod.hh"
#include "spring.hh"
-/**
- bounded-by-me -- list of elts.
-
- shortest-starter-duration -- rational signifying shortest moment that starts here
-
-
- Interfaces:
-
- axis-group, spaceable-element.
- */
-
class Paper_column : public Item
{
public:
#include "lily-guile.hh"
-/**
- A pause.
-
- See also Rhythmic_head, Staff_symbol_referencer.
-
- Read-only properties:
-
- style -- string specifying glyph style
- */
class Rest
{
public:
#include "lily-guile.hh"
#include "lily-proto.hh"
-/*
- Properties
-
- dot -- reference to Dots object.
-
- stem -- pointer to Stem object
-
- Read-only
-
- duration-log -- 2-log of the notehead duration
-
-*/
class Rhythmic_head
{
public:
#include "spanner.hh"
#include "item.hh"
-
-
-
-
/**
Position victim object (ELT_L_) next to other objects (the support).
side-support -- list of score elements
- direction -- where to put the victim object (left or right?)
-
- side-relative-direction -- if set: get the direction from a different object, and multiply by this.
-
direction-source -- in case side-relative-direction is set, where
- to get the direction
+ to get the direction
- minimum-space -- minimum distance that the victim should move
- (after padding)
-
- padding -- add this much extra space between victim and support
-
- self-alignment-X -- real number: -1 = left aligned, 0 = center, 1
- right-aligned in X direction.
-
- Set to an element pointer, if you want that element to be the center.
-
- self-alignment-Y -- like self-alignment-X but for Y axis
-
TODO: move out unrelated callbacks.
TODO: reduce number of methods.
-
*/
struct Side_position
{
#include "rod.hh"
/**
-
- de-uglify-parameters -- list of 3 real constants. They define the
- valid areas for the middle control points. Used in de_uglyfy.
- They are a bit empirical.
-
- details -- alist containing contaning a few magic constants.
-
- note-columns -- list of elt pointers to note columns.
-
- attachment -- cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where
- both types may be alongside-stem, stem, head or loose-end
-
- direction -- up or down?
-
- y-free -- ?
-
- control-points --
-
-
-
- Read-only
- =========
-
- extremity-rules --
-
- extremity-offset-alist --
-
- thickness --
-
- dash -- number representing the length of the dashes.
*/
class Slur
{
public: \
static SCM equal_p (SCM a, SCM b);\
static CL * unsmob (SCM);\
+ static SCM smob_p (SCM);\
static void init_smobs(); \
private:
#include "lily-guile.hh"
#include "lily-proto.hh"
-/*
- properties :
-
- minimum-distances -- list of rods (ie. (OBJ . DIST) pairs)
-
- ideal-distances -- (OBJ . (DIST . STRENGTH)) pairs
-
- dir-list -- list of stem directions.
- */
struct Spaceable_element
{
/// set a minimum distance
#include "spanner.hh"
-/**
- Read-only properties
-
- maximum-duration-for-spacing -- rational: space as if a duration of
- this type is available in this measure.
-
-
-
- Read properties from paper-column
-
- dir-list -- list of stem directions
-
- shortest-playing-duration -- duration of the shortest playing in that column.
-
- shortest-starter-duration -- duration of the shortest notes that starts
- exactly in that column.
-
- contains-grace -- boolean. Used to widen entries for grace notes.
-
- extra-space -- pair of distances
-
- stretch-distance -- pair of distances
- */
class Spacing_spanner
{
public:
This is a barline that is spanned across other bar lines. This is
the implementation of the long barlines that occur in orchestral
score and other multi-staff music.
-
- TODO: Is this usable for other stuff besides barlines? We only have
- to span a Score_element. Perhaps this can be used for large time
- sigs?
*/
class Span_bar
{
#include "lily-guile.hh"
/**
- This spanner draws the lines of a pstaff.
- The bottom line is position 0.
-
TODO: add stafflinethickness as parameter.
*/
class Staff_symbol
#include "lily-proto.hh"
#include "lily-guile.hh"
-/*
- stem -- pointer to the stem object.
- */
class Stem_tremolo
{
public:
#include "lily-proto.hh"
-/*
- heads -- pair of element pointers, pointing to the two heads of the
- tie. */
class Tie
{
public:
#include "spanner.hh"
-/** Volta bracket with number
-
-properties:
-
-bars -- list of barline ptrs.
-
-thickness -- in stafflinethickness
-
-height -- in staffspace
-
+/**
*/
class Volta_spanner
{
text_p_= new Item (get_property ("LyricText"));
- text_p_->set_elt_property ("text", req_l_->text_);
+ text_p_->set_elt_property ("text", req_l_->get_mus_property ("text"));
/*
We can't reach the notehead where we're centered from here. So
Lyric_performer::do_process_music ()
{
// FIXME: won't work with fancy lyrics
- if (lreq_arr_.size () && gh_string_p (lreq_arr_[0]->text_)
- && ly_scm2string (lreq_arr_[0]->text_).length_i ())
+ if (lreq_arr_.size ()
+ && gh_string_p (lreq_arr_[0]->get_mus_property ("text"))
+ && ly_scm2string (lreq_arr_[0]->get_mus_property ("text")).length_i ())
{
audio_p_ = new Audio_text (Audio_text::LYRIC,
- ly_scm2string (lreq_arr_[0]->text_));
+ ly_scm2string (lreq_arr_[0]->get_mus_property ("text")));
Audio_element_info info (audio_p_, lreq_arr_[0]);
announce_element (info);
}
Mark_engraver::acknowledge_element (Score_element_info inf)
{
Score_element * s = inf.elem_l_;
- if (Staff_symbol::has_interface (s))
+ if (Staff_symbol::has_interface (s)
+ || to_boolean (s->get_elt_property ("invisible-staff")))
{
SCM sts = get_property ("staffsFound");
SCM thisstaff = inf.elem_l_->self_scm ();
IMPLEMENT_UNSMOB(Moment,moment);
IMPLEMENT_SIMPLE_SMOBS(Moment);
-
+IMPLEMENT_TYPE_P (Moment, "moment?");
SCM
Moment::mark_smob (SCM)
init_moments ()
{
scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational);
+ scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational);
}
ADD_SCM_INIT_FUNC(moms,init_moments);
Text_script_req::do_equal_b (Request const* r) const
{
Text_script_req const* t = dynamic_cast<Text_script_req const*> (r);
- return t && gh_equal_p (text_, t->text_);
+ return t && gh_equal_p (get_mus_property ("text"),
+ t->get_mus_property ("text"));
}
{"denies", DENIES},
{"duration", DURATION},
{"dynamicscript", DYNAMICSCRIPT},
+ {"elementdescriptions", ELEMENTDESCRIPTIONS},
{"font", FONT},
{"grace", GRACE},
{"header", HEADER},
%token CM_T
%token CONSISTS
%token SEQUENTIAL
+%token ELEMENTDESCRIPTIONS
%token SIMULTANEOUS
%token CONSISTSEND
%token DENIES
| translator_spec_body CONSISTS STRING semicolon {
unsmob_translator_def ($$)->add_element ($3);
}
+ | translator_spec_body ELEMENTDESCRIPTIONS embedded_scm {
+ for (SCM p = $3; gh_pair_p (p); p = gh_cdr (p))
+ unsmob_translator_def ($$)
+ ->add_property_assign (scm_symbol_to_string (gh_caar (p)), gh_cdar (p));
+
+ }
| translator_spec_body CONSISTSEND STRING semicolon {
unsmob_translator_def ($$)->add_last_element ( $3);
}
}
| DYNAMICSCRIPT embedded_scm {
Dynamic_script_req *d = new Dynamic_script_req;
- d->text_ = $2;
+ d->set_mus_property ("text", $2);
d->set_spot (THIS->here_input ());
$$ = d;
}
| TEXTSCRIPT embedded_scm {
Text_script_req *t = new Text_script_req;
- t->text_ = $2;
+ t->set_mus_property ("text", $2);
t->set_spot (THIS->here_input ());
$$ = t;
}
gen_text_def:
embedded_scm {
Text_script_req *t = new Text_script_req;
- t->text_ = $1;
+ t->set_mus_property ("text", $1);
t->set_spot (THIS->here_input ());
$$ = t;
}
| string {
Text_script_req *t = new Text_script_req;
- t->text_ = $1;
+ t->set_mus_property ("text", $1);
t->set_spot (THIS->here_input ());
$$ = t;
}
Maybe use Finger_script_request?
*/
Text_script_req* t = new Text_script_req;
- t->text_ = gh_cons (ly_symbol2scm ("finger"),
- ly_str02scm (to_str ($1).ch_C ()));
+ t->set_mus_property ("text",
+ gh_cons (ly_symbol2scm ("finger"),
+ ly_str02scm (to_str ($1).ch_C ())));
t->set_spot (THIS->here_input ());
$$ = t;
}
else
THIS->pop_spot ();
Lyric_req* lreq_p = new Lyric_req;
- lreq_p ->text_ = $1;
+ lreq_p->set_mus_property ("text", $1);
lreq_p->duration_ = *$3;
lreq_p->set_spot (THIS->here_input());
Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm (), SCM_UNDEFINED));
SCM errport = scm_current_error_port ();
scm_display (prop_sym, errport);
- scm_puts (" is deprecated. Use\n \\property ", errport);
+ scm_puts (_(" is deprecated. Use\n \\property ").ch_C(), errport);
- SCM name = e->get_elt_property ("name");
scm_puts (origin->type_str_.ch_C(), errport);
scm_puts (".", errport);
+ SCM name = e->get_elt_property ("meta");
+ name = scm_assoc (ly_symbol2scm ("name"), name);
scm_display (name, errport);
scm_puts(" \\push #'",errport);
scm_display (elt_prop_sym,errport);
dim_cache_[a].dimension_ = cb;
}
+
+ SCM meta = get_elt_property ("meta");
+ SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
+
+ set_elt_property ("interfaces",gh_cdr (ifs));
}
else
return ext;
+ if (!gh_pair_p (d->dimension_))
+ return ext;
+
ext = ly_scm2interval (d->dimension_);
SCM extra = get_elt_property (a == X_AXIS
String
Score_element::name () const
{
- SCM nm = get_elt_property ("name");
-
- return nm == SCM_EOL ? classname (this) :ly_scm2string (nm) ;
+ SCM meta = get_elt_property ("meta");
+ SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
+ nm = (gh_pair_p (nm)) ? gh_cdr (nm) : SCM_EOL;
+ return gh_string_p (nm) ?ly_scm2string (nm) : classname (this);
}
void
init_functions ()
{
interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces"));
-
+
scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (Scheme_function_unknown)ly_get_elt_property);
scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (Scheme_function_unknown)ly_set_elt_property);
scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound);
ADD_SCM_INIT_FUNC(scoreelt, init_functions);
-
+IMPLEMENT_TYPE_P(Score_element, "ly-element?");
void
Spaceable_element::set_interface (Score_element*me)
{
+ me->set_interface (ly_symbol2scm ("spaceable-element-interface"));
}
#include "lily-guile.hh"
#include "item.hh"
#include "arpeggio.hh"
-#include "span-arpeggio.hh"
#include "group-interface.hh"
#include "side-position-interface.hh"
#include "staff-symbol-referencer.hh"
if (r->get_direction ())
Side_position::set_direction (text, r->get_direction ());
- text->set_elt_property ("text", r->text_);
+ text->set_elt_property ("text", r->get_mus_property ("text"));
SCM nonempty = get_property ("textNonEmpty");
if (to_boolean (nonempty))
#include "staff-symbol-referencer.hh"
/*
- Generic Text spanner:
-
- type: "line", "dashed-line", "dotted-line"
- edge-text: ("le" . "re")
- text-style: "italic"
- egde-height: (lh . rh)
-
- "le"--------------"re"
- |^
- |v rh
-
- fine tuning:
-
- dash-period
- dash-length
- line-thickness
-
TODO:
- vertical start / vertical end (fixme-name) |
- contination types (vert. star, vert. end) |-> eat volta-spanner
if (gh_pair_p (s))
{
Direction d = LEFT;
- int dir = me->get_elt_property ("direction");
+ int dir = to_dir (me->get_elt_property ("direction"));
do
{
Real dy = gh_scm2double (index_cell (s, d)) * - dir;
void
Tie_column::set_interface (Score_element*me)
{
- me->set_interface (ly_symbol2scm ("tie-column"));
+ 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 (Score_element*me)
{
- return me->has_interface (ly_symbol2scm ("tie-column"));
+ return me->has_interface (ly_symbol2scm ("tie-column-interface"));
}
void
*/
if (gh_pair_p (prev) || prev == SCM_EOL)
{
+ bool ok = true;
+
+ SCM errport = scm_current_error_port ();
+
+ SCM meta = scm_assoc (ly_symbol2scm ("meta"), prev);
+ SCM props = scm_assoc (ly_symbol2scm ("properties"), gh_cdr (meta));
+ SCM propdesc = scm_assoc (eltprop, gh_cdr (props));
+ if (!gh_pair_p (propdesc))
+ {
+ scm_puts (_("Couldn't find property description for #'").ch_C(),errport);
+ scm_display (eltprop, errport);
+
+ scm_puts (_(" in element description ").ch_C(),errport);
+ scm_display (prop, errport);
+
+ scm_puts (_(". Perhaps you made a typing error?\n").ch_C(),errport);
+ }
+ else
+ {
+
+ SCM predicate = gh_cadr (propdesc);
+ if (gh_call1 (predicate, val) == SCM_BOOL_F)
+ {
+ ok = false;
+ scm_puts (_("Failed typecheck for #'").ch_C (),errport);
+ scm_display (eltprop,errport);
+ scm_puts ( _(", value ").ch_C (), errport);
+ scm_display (val, errport);
+ scm_puts (_(" must satisfy ").ch_C (), errport);
+ scm_display (predicate, errport);
+ scm_puts ("\n", errport);
+ }
+ }
+
+ if (ok)
+ {
prev = gh_cons (gh_cons (eltprop, val), prev);
set_property (prop, prev);
+ }
}
+ else
+ {
+ // warning here.
+ }
+
}
else
{
-%{
- chord modifiers
-%}
-
-% UGR
-#(eval-string (ly-gulp-file "chord-names.scm"))
-
% urg!
%
longa = \duration #'( -2 0 )
maxima = \duration #'( -3 0 )
-
-#(begin
- (eval-string (ly-gulp-file "slur.scm"))
- (eval-string (ly-gulp-file "font.scm"))
- (eval-string (ly-gulp-file "generic-property.scm"))
- (eval-string (ly-gulp-file "basic-properties.scm"))
- )
-
\include "nederlands.ly" % dutch
\include "chord-modifiers.ly"
\include "script.ly"
-
-
% declarations for standard directions
left = -1
right = 1
stop = 1
smaller = -1
bigger = 1
-
center=0
break = \penalty -1000000;
melisma = \property Staff.melismaBusy = ##t
melismaEnd = \property Staff.melismaBusy = ##f
-
-
-
papersize = "a4"
+
\include "engraver.ly"
\include "generic-paper.ly"
\include "paper20.ly"
TextScript \push #'font-size = #-1
Slur \push #'font-size = #-1
Accidentals \push #'font-size = #-1
- Beam \push #'beam-thickness = #0.3
- Beam \push #'beam-space-function = #(lambda (x) 0.5)
+ Beam \push #'thickness = #0.3
+ Beam \push #'space-function = #(lambda (x) 0.5)
Stem \push #'lengths = #(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))
Stem \push #'beamed-lengths =
#'(0.0 2.5 2.0 1.5)
- Stem \push #'minimum-beamed-lengths
+ Stem \push #'beamed-minimum-lengths
= #(map (lambda (x) (* 0.8 x)) '(0.0 2.5 2.0 1.5))
weAreGraceContext = ##t
\name ChordNames;
Generic_property_list = #generic-chord-staff-properties
+
\consists "Property_engraver";
\consists "Output_property_engraver";
\accepts "ChordNamesVoice";
+
+ VerticalAxisGroup \push #'invisible-staff = ##t
\consistsend "Axis_group_engraver";
}
Time_signature
Stanza_number
)
-
+
+
+ \elementdescriptions #all-element-descriptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO: uniform naming.;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- %
- % distances are given in stafflinethickness (thicknesses) and
- % staffspace (distances)
- %
- Arpeggio = #`(
- (interfaces . (arpeggio-interface side-position-interface))
- (X-extent-callback . ,Arpeggio::width_callback)
- (molecule-callback . ,Arpeggio::brew_molecule)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (X-offset-callbacks . (,Side_position::aligned_side))
- (right-padding . 0.4) ; Hmm, not generic?
- (direction . -1)
- (staff-position . 0.0)
- (name . "Arpeggio")
- )
- BarLine = #`(
- (interfaces . (bar-interface staff-bar-interface))
- (break-align-symbol . Staff_bar)
- (glyph . "|")
- (break-glyph-function . ,default-break-barline)
- (barsize-procedure . ,Bar::get_staff_bar_size)
- (molecule-callback . ,Bar::brew_molecule)
- (visibility-lambda . ,all-visible)
- (breakable . #t)
- (before-line-breaking-callback . ,Bar::before_line_breaking)
- ;;
- ;; Ross. page 151 lists other values, we opt for a leaner look
- ;;
- (kern . 3.0)
- (thin-kern . 3.0)
- (hair-thickness . 1.6)
- (thick-thickness . 6.0)
- (name . "BarLine")
- )
-
- BarNumber = #`(
- (molecule-callback . ,Text_item::brew_molecule)
- (breakable . #t)
- (visibility-lambda . ,begin-of-line-visible)
- (padding . 1.0)
- (direction . 1)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-family . roman)
- (name . "BarNumber")
- )
-
- Beam = #basic-beam-properties
-
- BreakAlignment = #`(
- (breakable . #t)
- (interfaces . (break-align-interface))
- (stacking-dir . 1)
- (axes 0)
- (X-offset-callbacks . (,Break_align_interface::self_align_callback))
- (space-alist . ,default-break-align-space-alist)
- (name . "BreakAlignment")
- )
-
- BreakAlignGroup = #`(
- (interfaces . (axis-group-interface))
- (axes . (0))
- (X-offset-callbacks . (,Break_align_interface::alignment_callback))
-
- (name . "BreakAlignGroup")
- )
-
- BreathingSign = #`(
- (interfaces . (breathing-sign-interface))
- (break-align-symbol . Breathing_sign)
- (breakable . #t )
- (molecule-callback . ,Breathing_sign::brew_molecule)
- (Y-offset-callbacks . (,Breathing_sign::offset_callback))
- (visibility-lambda . ,begin-of-line-invisible)
- (name . "BreathingSign")
- )
-
- Clef = #`(
- (interfaces . (clef-interface))
- (molecule-callback . ,Score_element::brew_molecule)
- (before-line-breaking-callback . ,Clef::before_line_breaking)
- (breakable . #t)
- (break-align-symbol . Clef_item)
- (visibility-lambda . ,begin-of-line-visible)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (name . "Clef")
- )
-
- ChordNames = #`(
- (molecule-callback . ,Chord_name::brew_molecule)
- (interfaces . (chord-name-interface))
- (after-line-breaking-callback . ,Chord_name::after_line_breaking)
- (chord-name-function . ,default-chord-name-function)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-family . roman)
- (name . "ChordNames")
- )
-
- NoteCollision = #`(
- (axes 0 1)
- (interfaces . (collision-interface))
- (note-width . 1.65)
- (name . "NoteCollision")
- )
-
- Crescendo = #`(
- (molecule-callback . ,Crescendo::brew_molecule)
- (interfaces . (crescendo-interface dynamic-interface))
- (thickness . 1.0)
- (shorten-for-letter . 4.0)
- (height . 0.6666)
- (dash-thickness . 1.2)
- (dash-length . 4.0)
- (name . "Crescendo")
- (self-alignment-Y . 0)
- (Y-offset-callbacks . (,Side_position::aligned_on_self))
- )
-
- DotColumn = #`(
- (interfaces . (dot-column-interface axis-group-interface ))
- (axes 0 )
- (name . "DotColumn")
- )
-
- Dots = #`(
- (interfaces . (dot-interface))
- (molecule-callback . ,Dots::brew_molecule)
- (dot-count . 1)
- (staff-position . 0.0)
- (Y-offset-callbacks . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback))
-
- (name . "Dots")
- )
-
- DynamicText = #`(
- (interfaces . (dynamic-interface))
- (Y-offset-callbacks . (,Side_position::aligned_on_self))
- (molecule-callback . ,Text_item::brew_molecule)
- (font-style . dynamic)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (script-priority . 100)
- (self-alignment-Y . 0)
- (name . "DynamicText")
- )
-
- DynamicLineSpanner = #`(
- (interfaces . (dynamic-interface axis-group-interface side-position-interface))
- (axes . ( 1))
- (padding . 3)
- (minimum-space . 6)
- (name . "dynamic alignment")
- )
-
- LeftEdge = #`(
- (break-align-symbol . Left_edge_item)
- (breakable . #t)
- (name . "LeftEdge")
- )
-
- Fingering = #`(
- (interfaces . (finger-interface text-script-interface text-item-interface side-position-interface))
- (molecule-callback . ,Text_item::brew_molecule)
- (padding . 3.0)
- (self-alignment-X . 0)
- (name . "Fingering")
- )
-
- GraceAlignment = #`(
- (interfaces . (axis-group-interface align-interface))
- (axes . (0))
- (horizontal-space . 1.2)
- (padding . 1.0)
- (before-line-breaking-callback . ,Grace_align_item::before_line_breaking)
- (name . "GraceAlignment")
- )
-
- HaraKiriVerticalGroup = #`(
- (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback))
- (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent)
- (interfaces . (hara-kiri-group-interface))
- (axes 1)
- (name . "HaraKiriVerticalGroup")
- )
-
- LyricHyphen = #`(
- (interfaces . (lyric-hyphen-interface))
- (thickness . 1.0)
- (height . 0.4)
- (minimum-length . 0.5)
- (molecule-callback . ,Hyphen_spanner::brew_molecule)
- (Y-extent-callback . ,Score_element::point_dimension_callback)
- (name . "LyricHyphen")
- )
-
- InstrumentName = #`(
- (interfaces . (instrument-name-interface))
- (breakable . #t)
- (Y-offset-callbacks . (,Side_position::centered_on_parent))
- (molecule-callback . ,Text_item::brew_molecule)
- (break-align-symbol . Instrument_name)
- (visibility-lambda . ,begin-of-line-visible)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-family . roman)
- (name . "InstrumentName")
- )
-
- KeySignature = #`(
- (interfaces . (key-item-interface))
- (molecule-callback . ,Key_item::brew_molecule)
- (break-align-symbol . Key_item)
- (visibility-lambda . ,begin-of-line-visible)
- (breakable . #t)
- (name . "KeySignature")
- )
-
- Accidentals = #`(
- (molecule-callback . ,Local_key_item::brew_molecule)
- (X-offset-callbacks . (,Side_position::aligned_side))
- (direction . -1)
- (left-padding . 0.2)
- (right-padding . 0.4)
- (interfaces . (accidentals-interface))
- (name . "Accidentals")
- )
-
- LineOfScore = #`(
- (axes . (0 1))
- (interfaces . (axis-group-interface))
- (name . "LineOfScore")
- )
-
- LyricExtender = #`(
- (interfaces . (lyric-extender-interface))
- (molecule-callback . ,Lyric_extender::brew_molecule)
- (height . 0.8) ; stafflinethickness;
- (right-trim-amount . 0.5)
- (Y-extent-callback . ,Score_element::point_dimension_callback)
- (name . "LyricExtender")
- )
-
- LyricText = #`(
- (interfaces . (lyric-syllable-interface text-item-interface))
- (molecule-callback . ,Text_item::brew_molecule)
- (X-offset-callbacks . (,Side_position::aligned_on_self))
- (self-alignment-X . 0)
- (non-rhythmic . #t)
- (word-space . 0.6)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-family . roman)
- (name . "LyricText")
- )
-
- RehearsalMark = #`(
- (interfaces . (mark-interface side-position-interface))
- (molecule-callback . ,Text_item::brew_molecule)
- (breakable . #t)
- (visibility-lambda . ,end-of-line-invisible)
- (padding . 4.0)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-style . mark)
- (name . "RehearsalMark")
- )
-
- MultiMeasureRest = #`(
- (interfaces . (multi-measure-rest-interface))
- (spacing-procedure . ,Multi_measure_rest::set_spacing_rods)
- (molecule-callback . ,Multi_measure_rest::brew_molecule)
- (staff-position . 0)
- (expand-limit . 10)
- (padding . 2.0) ; staffspace
- (minimum-width . 12.5) ; staffspace
- (name . "MultiMeasureRest")
- )
-
- NoteColumn = #`(
- (interfaces . (axis-group-interface note-column-interface))
- (axes 0 1)
- (name . "NoteColumn")
- )
-
- NoteHead = #`(
- (interfaces . (note-head-interface rhythmic-head-interface))
- (style . default)
- (molecule-callback . ,Note_head::brew_molecule)
- (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (name . "NoteHead")
- )
-
- NoteName = #`(
- (molecule-callback . ,Text_item::brew_molecule)
- (name . "NoteName")
- )
-
- OctavateEight = #`(
- (self-alignment-X . 0)
- (text . "8")
- (visibility-lambda . ,begin-of-line-visible)
- (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self))
- (Y-offset-callbacks . (,Side_position::aligned_side))
- (molecule-callback . ,Text_item::brew_molecule)
- (font-shape . "italic")
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (name . "OctavateEight")
- )
-
- PaperColumn = #`(
- (interfaces . (paper-column-interface axis-group-interface))
- (axes 0)
- (before-musical-spacing-factor . 0.4)
- (name . "PaperColumn")
- )
- NonMusicalPaperColumn = #`(
- (interfaces . (paper-column-interface axis-group-interface))
- (axes 0)
- (before-musical-spacing-factor . 1.0)
- (name . "PaperColumn")
- )
-
- Rest = #`(
- (interfaces . (rest-interface rhythmic-head-interface))
- (after-line-breaking-callback . ,Rest::after_line_breaking)
- (molecule-callback . ,Rest::brew_molecule)
- (minimum-beam-collision-distance . 1.5)
- (name . "Rest")
- )
-
- RestCollision = #`(
- (interfaces . (rest-collision-interface))
- (minimum-distance . 0.75)
- (name . "RestCollision")
- )
-
- Script = #`(
- (molecule-callback . ,Script::brew_molecule)
- (interfaces . (script-interface side-position-interface))
- (X-offset-callbacks . (,Side_position::centered_on_parent))
- (name . "Script")
- )
-
- ScriptColumn = #`(
- (before-line-breaking-callback . ,Script_column::before_line_breaking)
- (name . "ScriptColumn")
- )
- Slur = #`(
- (interfaces . (slur-interface))
- (molecule-callback . ,Slur::brew_molecule)
- (thickness . 1.2)
- (spacing-procedure . ,Slur::set_spacing_rods)
- (minimum-length . 1.5)
- (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))
- (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)))
- (beautiful . 0.5)
- (y-free . 0.75)
- (slope-limit . 0.8)
- (attachment-offset . ((0 . 0) . (0 . 0)))
- (name . "Slur")
- )
-
- SpacingSpanner =#`(
- (spacing-procedure . ,Spacing_spanner::set_springs)
-
- ;; assume that notes at least this long are present.
- (maximum-duration-for-spacing . ,(make-moment 1 8))
- (name . "SpacingSpanner")
- )
- SpanBar = #`(
- (interfaces . (bar-interface span-bar-interface))
- (break-align-symbol . Staff_bar)
- (barsize-procedure . ,Span_bar::get_bar_size)
- (molecule-callback . ,Bar::brew_molecule)
- (visibility-lambda . ,begin-of-line-invisible)
- (X-extent-callback . ,Span_bar::width_callback)
- (Y-offset-callbacks . (,Span_bar::center_on_spanned_callback))
-
- (breakable . #t)
- (glyph . "|")
- (before-line-breaking-callback . ,Span_bar::before_line_breaking)
- ;; ugh duplication!
-
- ;;
- ;; Ross. page 151 lists other values, we opt for a leaner look
- ;;
- (kern . 3.0)
- (thin-kern . 3.0)
- (hair-thickness . 1.6)
- (thick-thickness . 6.0)
- (name . "SpanBar")
- )
-
- StanzaNumber = #`(
- (breakable . #t)
- (molecule-callback . ,Text_item::brew_molecule)
- (break-align-symbol . Clef_item)
- (visibility-lambda . ,begin-of-line-visible)
- (name . "StanzaNumber")
- )
-
- StaffSymbol = #`(
- (interfaces . (staff-symbol-interface ))
- (molecule-callback . ,Staff_symbol::brew_molecule)
- (staff-space . 1.0)
- (line-count . 5 )
- (name . "StaffSymbol")
- )
-
- SystemStartDelimiter = #`(
- (molecule-callback . ,System_start_delimiter::brew_molecule)
- (after-line-breaking-callback . ,System_start_delimiter::after_line_breaking)
- (collapse-height . 1.0)
- (thickness . 1.6)
- (arch-height . 1.5)
- (arch-angle . 50.0)
- (arch-thick . 0.25)
- (arch-width . 1.5)
- (bracket-thick . 0.25)
- (bracket-width . 2.0)
- (name . "SystemStartDelimiter")
- )
-
- TextScript = #`(
- (molecule-callback . ,Text_item::brew_molecule)
- (no-spacing-rods . #t)
- (interfaces . (text-script-interface text-item-interface side-position-interface))
- (padding . 0.5)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (name . "TextScript")
- )
- TextSpanner = #`(
- (interfaces . (text-spanner-interface))
- (molecule-callback . ,Text_spanner::brew_molecule)
- (type . "line")
- (direction . 1)
- (font-shape . "italic")
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (name . "TextSpanner")
- )
- Tie = #`(
- (interfaces . (tie-interface))
- (molecule-callback . ,Tie::brew_molecule)
- (spacing-procedure . ,Tie::set_spacing_rods)
- (staffline-clearance . 0.24)
- (details . ((ratio . 0.333) (height-limit . 1.0)))
- (thickness . 1.2)
- (x-gap . 0.2)
- (minimum-length . 2.5)
- (name . "Tie")
- )
-
- TieColumn = #`(
- (after-line-breaking-callback . ,Tie_column::after_line_breaking)
- (interfaces . (tie-column-interface))
- (name . "TieColumn")
- )
-
- TimeSignature = #`(
- (interfaces . (time-signature-interface))
- (molecule-callback . ,Time_signature::brew_molecule)
- (break-align-symbol . Time_signature)
- (visibility-lambda . ,all-visible)
- (breakable . #t)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-style . timesig)
- (name . "TimeSignature")
- )
-
- TupletBracket = #`(
- (interfaces . (tuplet-spanner-interface))
- (number-gap . 2.0)
- (delta-y . 0)
- (thick . 1.0)
- (after-line-breaking-callback . ,Tuplet_spanner::after_line_breaking)
- (molecule-callback . ,Tuplet_spanner::brew_molecule)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-shape . "italic")
- (name . "TupletBracket")
- )
-
- SostenutoPedal = #`(
- (molecule-callback . ,Text_item::brew_molecule)
- (X-offset-callbacks . (,Side_position::aligned_on_self))
- (Y-offset-callbacks .
- (,Side_position::aligned_side
- ,Side_position::centered_on_parent))
-
- (font-shape . "italic")
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (no-spacing-rods . #t)
- (self-alignment-X . 0)
- (name . "SostenutoPedal")
-
- )
-
- Stem = #`(
- (interfaces . (stem-interface))
- (before-line-breaking-callback . ,Stem::before_line_breaking)
- (molecule-callback . ,Stem::brew_molecule)
- (thickness . 0.8)
- (beamed-lengths . (0.0 2.5 2.0 1.5))
- (beamed-minimum-lengths . (0.0 1.5 1.25 1.0))
-
-;; Stems in unnatural (forced) direction should be shortened,
-;; according to [Roush & Gourlay]. Their suggestion to knock off
-;; a whole staffspace seems a bit drastical: we'll do half.
-
- (lengths . (3.5 3.5 3.5 4.5 5.0))
- (stem-shorten . (0.5))
- ; if stem is on middle line, choose this direction.
- (default-neutral-direction . 1)
- (X-offset-callbacks . (,Stem::off_callback))
- (name . "Stem")
- )
-
- StemTremolo = #`(
- (molecule-callback . ,Stem_tremolo::brew_molecule)
- (beam-width . 2.0) ; staff-space
- (beam-thickness . 0.42) ; staff-space
- (beam-space-function . ,default-beam-space-function)
- (name . "StemTremolo")
- )
-
- SeparationItem = #`(
- (interfaces . (separation-item-interface))
- (name . "SeparationItem")
- )
-
- SeparatingGroupSpanner = #`(
- (interfaces . (separation-spanner-interface))
- (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
- (name . "SeparatingGroupSpanner")
- )
-
- SustainPedal = #`(
- (interfaces . (sustain-pedal-interface side-position-interface))
- (no-spacing-rods . #t)
- (molecule-callback . ,Sustain_pedal::brew_molecule)
- (self-alignment-X . 0)
- (X-offset-callbacks . (,Side_position::aligned_on_self))
- (Y-offset-callbacks .
- (,Side_position::aligned_side
- ,Side_position::centered_on_parent))
-
- (name . "SustainPedal")
- )
- UnaChordaPdeal = #`(
- (molecule-callback . ,Text_item::brew_molecule)
- (font-shape . "italic")
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (no-spacing-rods . #t)
- (self-alignment-X . 0)
- (X-offset-callbacks . (,Side_position::aligned_on_self))
- (Y-offset-callbacks .
- (,Side_position::aligned_side
- ,Side_position::centered_on_parent))
-
- (name . "UnaChordaPedal")
- )
-
- VoltaBracket = #`(
- (molecule-callback . ,Volta_spanner::brew_molecule)
- (interfaces . (volta-spanner-interface side-position-interface))
- (direction . 1)
- (padding . 5)
- (thickness . 1.6) ; stafflinethickness
- (height . 2.0) ; staffspace;
- (minimum-space . 25)
- (properties-to-font-name . ,properties-to-font-name)
- (style-to-font-name . ,style-to-font-name)
- (markup-to-properties . ,markup-to-properties)
- (font-style . volta)
- (name . "VoltaBracket")
- )
-
- VerticalAlignment = #`(
- (axes 1)
- (interfaces . (align-interface axis-group-interface))
- (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
- (X-extent-callback . #f)
- (stacking-dir . -1)
- (name . "VerticalAlignment")
- )
-
- VerticalAxisGroup = #`(
- (axes 1)
- (interfaces . (axis-group-interface))
- (name . "VerticalAxisGroup")
- )
\include "auto-beam-settings.ly";
--- /dev/null
+
+#(eval-string (ly-gulp-file "generate-documentation.scm"))
;
(define basic-beam-properties
`(
- (interfaces . (beam-interface))
(molecule-callback . ,Beam::brew_molecule)
(thickness . 0.42) ; in staff-space, should use stafflinethick?
(before-line-breaking-callback . ,Beam::before_line_breaking)
(flag-width-function . ,default-beam-flag-width-function)
(space-function . ,default-beam-space-function)
(damping . 1)
- (name . "beam")
+ (meta . ,(element-description "Beam" general-element-interface beam-interface))
)
)
(ice-9 regex)
)
-;; The regex module may not be available, or may be broken.
-(define chord-use-regex
- (let ((os (string-downcase (vector-ref (uname) 0))))
- (not (equal? "cygwin" (substring os 0 (min 6 (string-length os)))))))
-
-;; If you have trouble with regex, define #f
-(define chord-use-regex #t)
-;;(define chord-use-regex #f)
-
;;
;; (octave notename accidental)
;;
;;
-;; text: list of word
-;; word: string + optional list of property
-;; property: size, style, font, super, offset
+;; text: scm markup text -- see font.scm and input/test/markup.ly
;;
;; TODO
; C iso C.no5
(((0 . 0) (2 . 0)) . #f)
; Cm iso Cm.no5
- (((0 . 0) (2 . -1)) . (("m")))
+ (((0 . 0) (2 . -1)) . ("m"))
; C2 iso C2.no3
(((0 . 0) (1 . 0) (4 . 0)) . (super "2"))
; C4 iso C4.no3
(((0 . 0) (2 . -1)) . ("m"))
(((0 . 0) (3 . 0) (4 . 0)) . ("sus"))
(((0 . 0) (2 . -1) (4 . -1)) . ("dim"))
-;Alternate: (((0 . 0) (2 . -1) (4 . -1)) . (("o" (type . "super"))))
+;Alternate: (((0 . 0) (2 . -1) (4 . -1)) . ((super "o")))
(((0 . 0) (2 . 0) (4 . 1)) . ("aug"))
;Alternate: (((0 . 0) (2 . 0) (4 . 1)) . ("+"))
(((0 . 0) (1 . 0) (4 . 0)) . ("2"))
;; Common seventh chords
- (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (("o" (type . "super")) "7"))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (rows (super "o") "7"))
(((0 . 0) (2 . 0) (4 . 0) (6 . 0)) . ("maj7"))
(((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . ("m7"))
(((0 . 0) (2 . 0) (4 . 0) (6 . -1)) . ("7"))
(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)"))
;jazz: the delta, see jazz-chords.ly
- ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (("N" (type . "super") (style . "msam") (size . -3))))
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (("o" (type . "super")) ("/" (size . -2) (offset . (-0.58 . 0.5))) "7")) ; slashed o
+ ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((family . "math") "N"))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows (super "o") ((kern . -0.5) ((size . "-3") "/")) "7")) ; slashed o
(((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7"))
- (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (("maj7") ("accidentals--1" (font . "feta") (type . "super")) ("5")))
+ (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" (music (named ("accidentals--1"))) "5"))
(((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4"))
;; Common ninth chords
(((0 . 0) (2 . 0) (4 . 0) (5 . 0) (1 . 0)) . ("6/9")) ;; we don't want the '/no7'
(make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65)))
(if (= (caddr pitch) 0)
'()
- (list (list (string-append "accidentals-"
- (number->string (caddr pitch)))
- ;; Keep accidentals from being too large
- '(font . "feta") '(type . "super") )))))
+ (list
+ (append '(music)
+ (list
+ (append '(named)
+ (list
+ (string-append "accidentals-"
+ (number->string (caddr pitch)))))))))))
+
(define (step->text pitch)
(string-append
;; additions, subtractions and base or inversion to chord name
;;
(define (chord::inner-name-banter tonic user-name additions subtractions base-and-inversion)
- (apply append (pitch->text-banter tonic)
- (if user-name user-name '())
- ;; why does list->string not work, format seems only hope...
- (if (and chord-use-regex
- (string-match "super" (format "~s" user-name))
- (or (pair? additions)
- (pair? subtractions)))
- '(("/" (type . "super")))
- '())
- (let loop ((from additions) (to '()))
- (if (pair? from)
+ (apply append
+ '(rows)
+ (pitch->text-banter tonic)
+ (if user-name user-name '())
+ ;; why does list->string not work, format seems only hope...
+ (if (and (string-match "super" (format "~s" user-name))
+ (or (pair? additions)
+ (pair? subtractions)))
+ '((super "/"))
+ '())
+ (let loop ((from additions) (to '()))
+ (if (pair? from)
+ (let ((p (car from)))
+ (loop (cdr from)
+ (append to
+ (cons
+ (list 'super (step->text-banter p))
+ (if (or (pair? (cdr from))
+ (pair? subtractions))
+ '((super "/"))
+ '())))))
+ to))
+ (let loop ((from subtractions) (to '()))
+ (if (pair? from)
(let ((p (car from)))
(loop (cdr from)
(append to
- (cons
- (cons (step->text-banter p) '((type . "super")))
- (if (or (pair? (cdr from))
- (pair? subtractions))
- '(("/" (type . "super")))
- '())))))
+ (cons '(super "no")
+ (cons
+ (list 'super (step->text-banter p))
+ (if (pair? (cdr from))
+ '((super "/"))
+ '()))))))
to))
- (let loop ((from subtractions) (to '()))
- (if (pair? from)
- (let ((p (car from)))
- (loop (cdr from)
- (append to
- (cons '("no" (type . "super"))
- (cons
- (cons (step->text-banter p) '((type . "super")))
- (if (pair? (cdr from))
- '(("/" (type . "super")))
- '()))))))
- to))
- (if (and (pair? base-and-inversion)
- (or (car base-and-inversion)
- (cdr base-and-inversion)))
- (cons "/" (append
- (if (car base-and-inversion)
- (pitch->text
- (car base-and-inversion))
- (pitch->text
- (cdr base-and-inversion)))
- '()))
- '())
- '()))
+ (if (and (pair? base-and-inversion)
+ (or (car base-and-inversion)
+ (cdr base-and-inversion)))
+ (cons "/" (append
+ (if (car base-and-inversion)
+ (pitch->text
+ (car base-and-inversion))
+ (pitch->text
+ (cdr base-and-inversion)))
+ '()))
+ '())
+ '()))
(define (chord::name-banter tonic user-name pitches base-and-inversion)
(let ((additions (chord::additions pitches))
transposed)))
(name-func (car pitches) user-name completed base-and-inversion))))))
+
--- /dev/null
+
+; distances are given in stafflinethickness (thicknesses) and
+; staffspace (distances)
+
+(define all-element-descriptions
+ `((Arpeggio . (
+ (X-extent-callback . ,Arpeggio::width_callback)
+ (molecule-callback . ,Arpeggio::brew_molecule)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
+ (staff-position . 0.0)
+ (meta . ,(element-description "Arpeggio" arpeggio-interface side-position-interface))
+ ))
+
+ (BarLine . (
+ (break-align-symbol . Staff_bar)
+ (glyph . "|")
+ (break-glyph-function . ,default-break-barline)
+ (barsize-procedure . ,Bar::get_staff_bar_size)
+ (molecule-callback . ,Bar::brew_molecule)
+ (visibility-lambda . ,all-visible)
+ (breakable . #t)
+ (before-line-breaking-callback . ,Bar::before_line_breaking)
+ ;;
+ ;; Ross. page 151 lists other values, we opt for a leaner look
+ ;;
+ (kern . 3.0)
+ (thin-kern . 3.0)
+ (hair-thickness . 1.6)
+ (thick-thickness . 6.0)
+ (meta . ,(element-description "BarLine" bar-line-interface general-element-interface))
+ ))
+
+ (BarNumber . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (breakable . #t)
+ (visibility-lambda . ,begin-of-line-visible)
+ (padding . 1.0)
+ (direction . 1)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
+ (meta . ,(element-description "BarNumber"
+ text-interface general-element-interface break-aligned-interface))
+ ))
+
+ (Beam . ,basic-beam-properties)
+
+ (BreakAlignment . (
+ (breakable . #t)
+ (stacking-dir . 1)
+ (axes 0)
+ (X-offset-callbacks . (,Break_align_interface::self_align_callback))
+ (space-alist . ,default-break-align-space-alist)
+ (meta . ,(element-description "BreakAlignment"
+ axis-group-interface align-interface
+ )
+ )
+ ))
+
+ (BreakAlignGroup . (
+ (axes . (0))
+ (X-offset-callbacks . (,Break_align_interface::alignment_callback))
+
+ (meta . ,(element-description "BreakAlignGroup" axis-group-interface))
+ ))
+
+ (BreathingSign . (
+ (break-align-symbol . Breathing_sign)
+ (breakable . #t )
+ (molecule-callback . ,Breathing_sign::brew_molecule)
+ (Y-offset-callbacks . (,Breathing_sign::offset_callback))
+ (visibility-lambda . ,begin-of-line-invisible)
+ (meta . ,(element-description "BreathingSign" general-element-interface break-aligned-interface))
+ ))
+
+ (Clef . (
+ (molecule-callback . ,Score_element::brew_molecule)
+ (before-line-breaking-callback . ,Clef::before_line_breaking)
+ (breakable . #t)
+ (break-align-symbol . Clef_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (meta . ,(element-description "Clef" clef-interface break-aligned-interface general-element-interface))
+ ))
+
+ (ChordNames . (
+ (molecule-callback . ,Chord_name::brew_molecule)
+ (after-line-breaking-callback . ,Chord_name::after_line_breaking)
+ (chord-name-function . ,default-chord-name-function)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-size . "0") ;; Hmm, 0 should be the default, maybe??
+ (font-family . "roman")
+ (meta . ,(element-description "ChordNames" chord-name-interface))
+ ))
+
+ (NoteCollision . (
+ (axes 0 1)
+ (note-width . 1.65)
+ (meta . ,(element-description "NoteCollision"
+ general-element-interface note-collision-interface axis-group-interface
+ ))
+ ))
+
+ (Crescendo . (
+ (molecule-callback . ,Crescendo::brew_molecule)
+ (thickness . 1.0)
+ (shorten-for-letter . 4.0)
+ (height . 0.6666)
+ (dash-thickness . 1.2)
+ (dash-length . 4.0)
+ (self-alignment-Y . 0)
+ (Y-offset-callbacks . (,Side_position::aligned_on_self))
+ (meta . ,(element-description "Crescendo" hairpin-interface))
+ ))
+
+ (DotColumn . (
+ (axes 0 )
+ (meta . ,(element-description "DotColumn" dot-column-interface general-element-interface axis-group-interface))
+ ))
+
+ (Dots . (
+ (molecule-callback . ,Dots::brew_molecule)
+ (dot-count . 1)
+ (staff-position . 0.0)
+ (Y-offset-callbacks . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback))
+ (meta . ,(element-description "Dots" dot-interface general-element-interface))
+ ))
+
+ (DynamicText . (
+ (Y-offset-callbacks . (,Side_position::aligned_on_self))
+ (molecule-callback . ,Text_item::brew_molecule)
+ (script-priority . 100)
+ (font-style . dynamic)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (self-alignment-Y . 0)
+
+ (meta . ,(element-description "DynamicText" text-interface general-element-interface))
+ ))
+
+ (DynamicLineSpanner . (
+ (axes . ( 1))
+ (padding . 3)
+ (minimum-space . 6)
+ (meta . ,(element-description "DynamicLineSpanner" dynamic-interface axis-group-interface side-position-interface))
+ ))
+
+ (LeftEdge . (
+ (break-align-symbol . Left_edge_item)
+ (breakable . #t)
+ (meta . ,(element-description "LeftEdge" break-aligned-interface))
+ ))
+
+ (Fingering . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (padding . 3.0)
+ (self-alignment-X . 0)
+ (font-style . dynamic)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+
+ (meta . ,(element-description "Fingering" finger-interface text-script-interface text-interface side-position-interface))
+ ))
+
+ (GraceAlignment . (
+ (axes . (0))
+ (horizontal-space . 1.2)
+ (padding . 1.0)
+ (before-line-breaking-callback . ,Grace_align_item::before_line_breaking)
+ (meta . ,(element-description "GraceAlignment" axis-group-interface align-interface grace-alignment-interface))
+ ))
+
+ (HaraKiriVerticalGroup . (
+ (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback))
+ (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent)
+ (axes 1)
+ (meta . ,(element-description "HaraKiriVerticalGroup" axis-group-interface hara-kiri-group-interface))
+ ))
+
+ (LyricHyphen . (
+ (thickness . 1.0)
+ (height . 0.4)
+ (minimum-length . 0.5)
+ (molecule-callback . ,Hyphen_spanner::brew_molecule)
+ (Y-extent-callback . ,Score_element::point_dimension_callback)
+ (meta . ,(element-description "LyricHyphen" lyric-hyphen-interface general-element-interface))
+ ))
+
+ (InstrumentName . (
+ (breakable . #t)
+ (Y-offset-callbacks . (,Side_position::centered_on_parent))
+ (molecule-callback . ,Text_item::brew_molecule)
+ (break-align-symbol . Instrument_name)
+ (visibility-lambda . ,begin-of-line-visible)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
+ (meta . ,(element-description "InstrumentName" general-element-interface text-interface break-aligned-interface))
+ ))
+
+ (KeySignature . (
+ (molecule-callback . ,Key_item::brew_molecule)
+ (break-align-symbol . Key_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ (breakable . #t)
+ (meta . ,(element-description "KeySignature" key-signature-interface general-element-interface break-aligned-interface))
+ ))
+
+ (Accidentals . (
+ (molecule-callback . ,Local_key_item::brew_molecule)
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
+ (left-padding . 0.2)
+ (right-padding . 0.4)
+ (meta . ,(element-description "Accidentals" general-element-interface accidentals-interface))
+ ))
+
+ (LineOfScore . (
+ (axes . (0 1))
+ (meta . ,(element-description "LineOfScore" general-element-interface axis-group-interface))
+ ))
+
+ (LyricExtender . (
+ (molecule-callback . ,Lyric_extender::brew_molecule)
+ (height . 0.8) ; stafflinethickness;
+ (right-trim-amount . 0.5)
+ (Y-extent-callback . ,Score_element::point_dimension_callback)
+ (meta . ,(element-description "LyricExtender" general-element-interface lyric-extender-interface))
+ ))
+
+ (LyricText . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (X-offset-callbacks . (,Side_position::aligned_on_self))
+ (self-alignment-X . 0)
+ (non-rhythmic . #t)
+ (word-space . 0.6)
+
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
+
+ (meta . ,(element-description "LyricText" lyric-syllable-interface text-interface))
+ ))
+
+ (RehearsalMark . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (breakable . #t)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . mark)
+ (visibility-lambda . ,end-of-line-invisible)
+ (padding . 4.0)
+ (meta . ,(element-description "RehearsalMark" general-element-interface mark-interface side-position-interface))
+ ))
+
+ (MultiMeasureRest . (
+ (spacing-procedure . ,Multi_measure_rest::set_spacing_rods)
+ (molecule-callback . ,Multi_measure_rest::brew_molecule)
+ (staff-position . 0)
+ (expand-limit . 10)
+ (padding . 2.0) ; staffspace
+ (minimum-width . 12.5) ; staffspace
+ (meta . ,(element-description "MultiMeasureRest" multi-measure-rest-interface general-element-interface))
+ ))
+
+ (NoteColumn . (
+ (axes . (0 1))
+ (meta . ,(element-description "NoteColumn" general-element-interface axis-group-interface note-column-interface))
+ ))
+
+ (NoteHead . (
+ (style . default)
+ (molecule-callback . ,Note_head::brew_molecule)
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (meta . ,(element-description "NoteHead"
+ rhythmic-head-interface
+ note-head-interface general-element-interface))
+ ))
+
+ (OctavateEight . (
+ (self-alignment-X . 0)
+ (text . "8")
+ (visibility-lambda . ,begin-of-line-visible)
+ (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self))
+ (Y-offset-callbacks . (,Side_position::aligned_side))
+ (molecule-callback . ,Text_item::brew_molecule)
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+
+ (meta . ,(element-description "OctavateEight" text-interface general-element-interface))
+ ))
+
+ (PaperColumn . (
+ (axes 0)
+ (before-musical-spacing-factor . 0.4)
+ (meta . ,(element-description "PaperColumn" paper-column-interface axis-group-interface spaceable-element-interface))
+ ))
+ (NonMusicalPaperColumn . (
+ (axes 0)
+ (before-musical-spacing-factor . 1.0)
+ (meta . ,(element-description "NonMusicalPaperColumn" paper-column-interface axis-group-interface spaceable-element-interface))
+ ))
+
+ (Rest . (
+ (after-line-breaking-callback . ,Rest::after_line_breaking)
+ (molecule-callback . ,Rest::brew_molecule)
+ (minimum-beam-collision-distance . 1.5)
+ (meta . ,(element-description "Rest"
+ rhythmic-head-interface
+ rest-interface general-element-interface))
+ ))
+ (RestCollision . (
+ (minimum-distance . 0.75)
+ (meta . ,(element-description "RestCollision" rest-collision-interface general-element-interface))
+ ))
+
+ (Script . (
+ (molecule-callback . ,Script::brew_molecule)
+ (X-offset-callbacks . (,Side_position::centered_on_parent))
+ (meta . ,(element-description "Script" script-interface side-position-interface))
+ ))
+
+ (ScriptColumn . (
+ (before-line-breaking-callback . ,Script_column::before_line_breaking)
+ (meta . ,(element-description "ScriptColumn" script-column-interface))
+ ))
+
+ (Slur . ,default-basic-slur-properties)
+ (SpacingSpanner . (
+ (spacing-procedure . ,Spacing_spanner::set_springs)
+
+ ;; assume that notes at least this long are present.
+ (maximum-duration-for-spacing . ,(make-moment 1 8))
+ (meta . ,(element-description "SpacingSpanner" general-element-interface spacing-spanner-interface))
+ ))
+ (SpanBar . (
+
+ (break-align-symbol . Staff_bar)
+ (barsize-procedure . ,Span_bar::get_bar_size)
+ (molecule-callback . ,Bar::brew_molecule)
+ (visibility-lambda . ,begin-of-line-invisible)
+ (X-extent-callback . ,Span_bar::width_callback)
+ (Y-offset-callbacks . (,Span_bar::center_on_spanned_callback))
+
+ (breakable . #t)
+ (glyph . "|")
+ (before-line-breaking-callback . ,Span_bar::before_line_breaking)
+ ;; ugh duplication!
+
+ ;;
+ ;; Ross. page 151 lists other values, we opt for a leaner look
+ ;;
+ (kern . 3.0)
+ (thin-kern . 3.0)
+ (hair-thickness . 1.6)
+ (thick-thickness . 6.0)
+ (meta . ,(element-description "SpanBar" span-bar-interface bar-line-interface general-element-interface))
+ ))
+
+ (StanzaNumber . (
+ (breakable . #t)
+ (molecule-callback . ,Text_item::brew_molecule)
+ (break-align-symbol . Clef_item)
+ (visibility-lambda . ,begin-of-line-visible)
+ (meta . ,(element-description "StanzaNumber" break-aligned-interface text-interface))
+ ))
+
+ (StaffSymbol . (
+ (molecule-callback . ,Staff_symbol::brew_molecule)
+ (staff-space . 1.0)
+ (line-count . 5 )
+ (meta . ,(element-description "StaffSymbol" staff-symbol-interface general-element-interface))
+ ))
+ (SostenutoPedal . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (X-offset-callbacks . (,Side_position::aligned_on_self))
+ (Y-offset-callbacks .
+ (,Side_position::aligned_side
+ ,Side_position::centered_on_parent))
+ (no-spacing-rods . #t)
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+
+ (self-alignment-X . 0)
+ (meta . ,(element-description "SostenutoPedal" text-interface general-element-interface))
+ ))
+
+ (Stem . (
+ (before-line-breaking-callback . ,Stem::before_line_breaking)
+ (molecule-callback . ,Stem::brew_molecule)
+ (thickness . 0.8)
+ (beamed-lengths . (0.0 2.5 2.0 1.5))
+ (beamed-minimum-lengths . (0.0 1.5 1.25 1.0))
+
+;; Stems in unnatural (forced) direction should be shortened,
+;; according to [Roush & Gourlay]. Their suggestion to knock off
+;; a whole staffspace seems a bit drastical: we'll do half.
+
+ (lengths . (3.5 3.5 3.5 4.5 5.0))
+ (stem-shorten . (0.5))
+ ; if stem is on middle line, choose this direction.
+ (default-neutral-direction . 1)
+ (X-offset-callbacks . (,Stem::off_callback))
+ (meta . ,(element-description "Stem" stem-interface general-element-interface))
+ ))
+
+ (StemTremolo . (
+ (molecule-callback . ,Stem_tremolo::brew_molecule)
+ (beam-width . 2.0) ; staff-space
+ (beam-thickness . 0.42) ; staff-space
+ (beam-space-function . ,default-beam-space-function)
+ (meta . ,(element-description "StemTremolo" stem-tremolo-interface general-element-interface))
+ ))
+
+ (SeparationItem . (
+ (meta . ,(element-description "SeparationItem" separation-item-interface general-element-interface))
+ ))
+ (SeparatingGroupSpanner . (
+ (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
+ (meta . ,(element-description "SeparatingGroupSpanner" separation-spanner-interface))
+ ))
+
+ (SustainPedal . (
+ (no-spacing-rods . #t)
+ (molecule-callback . ,Sustain_pedal::brew_molecule)
+ (self-alignment-X . 0)
+ (X-offset-callbacks . (,Side_position::aligned_on_self))
+ (Y-offset-callbacks .
+ (,Side_position::aligned_side
+ ,Side_position::centered_on_parent))
+
+ (meta . ,(element-description "SustainPedal" sustain-pedal-interface side-position-interface))
+ ))
+
+ (SystemStartDelimiter . (
+ (molecule-callback . ,System_start_delimiter::brew_molecule)
+ (after-line-breaking-callback . ,System_start_delimiter::after_line_breaking)
+ (collapse-height . 1.0)
+ (thickness . 1.6)
+ (arch-height . 1.5)
+ (arch-angle . 50.0)
+ (arch-thick . 0.25)
+ (arch-width . 1.5)
+ (bracket-thick . 0.25)
+ (bracket-width . 2.0)
+ (meta . ,(element-description "SystemStartDelimiter" system-start-delimiter general-element-interface))
+ ))
+
+ (TextScript . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (no-spacing-rods . #t)
+ (padding . 0.5)
+ (meta . ,(element-description "TextScript" text-script-interface text-interface side-position-interface general-element-interface))
+ ))
+ (TextSpanner . (
+ (molecule-callback . ,Text_spanner::brew_molecule)
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (type . "line")
+ (direction . 1)
+ (meta . ,(element-description "TextSpanner" text-spanner-interface general-element-interface))
+ ))
+ (Tie . (
+ (molecule-callback . ,Tie::brew_molecule)
+ (spacing-procedure . ,Tie::set_spacing_rods)
+ (staffline-clearance . 0.24)
+ (details . ((ratio . 0.333) (height-limit . 1.0)))
+ (thickness . 1.2)
+ (x-gap . 0.2)
+ (minimum-length . 2.5)
+ (meta . ,(element-description "Tie" tie-interface general-element-interface))
+ ))
+
+ (TieColumn . (
+ (after-line-breaking-callback . ,Tie_column::after_line_breaking)
+ (meta . ,(element-description "TieColumn" tie-column-interface general-element-interface))
+ ))
+
+ (TimeSignature . (
+ (molecule-callback . ,Time_signature::brew_molecule)
+ (break-align-symbol . Time_signature)
+ (visibility-lambda . ,all-visible)
+ (breakable . #t)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . timesig)
+
+ (meta . ,(element-description "TimeSignature" time-signature-interface general-element-interface))
+ ))
+
+ (TupletBracket . (
+ (number-gap . 2.0)
+ (delta-y . 0)
+ (thick . 1.0)
+ (after-line-breaking-callback . ,Tuplet_spanner::after_line_breaking)
+ (molecule-callback . ,Tuplet_spanner::brew_molecule)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-shape . "italic")
+ (meta . ,(element-description "TupletBracket"
+ general-element-interface tuplet-bracket-interface))
+ ))
+
+ (UnaChordaPdeal . (
+ (molecule-callback . ,Text_item::brew_molecule)
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (no-spacing-rods . #t)
+ (self-alignment-X . 0)
+ (X-offset-callbacks . (,Side_position::aligned_on_self))
+ (Y-offset-callbacks .
+ (,Side_position::aligned_side
+ ,Side_position::centered_on_parent))
+ (meta . ,(element-description "UnaChordaPedal" text-interface general-element-interface))
+ ))
+
+ (VoltaBracket . (
+ (molecule-callback . ,Volta_spanner::brew_molecule)
+ (direction . 1)
+ (padding . 5)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . volta)
+
+ (thickness . 1.6) ; stafflinethickness
+ (height . 2.0) ; staffspace;
+ (minimum-space . 25)
+ (meta . ,(element-description "VoltaBracket" volta-bracket-interface side-position-interface))
+ ))
+
+ (VerticalAlignment . (
+ (axes 1)
+ (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (X-extent-callback . #f)
+ (stacking-dir . -1)
+ (meta . ,(element-description "VerticalAlignment" align-interface axis-group-interface))
+ ))
+
+ (VerticalAxisGroup . (
+ (axes 1)
+ (meta . ,(element-description "VerticalAxisGroup" axis-group-interface))
+ ))
+))
+
+
+
+; (display (map pair? all-element-descriptions))
+
(("bold upright roman cmbx 12" . 1) . "cmbx12")
(("medium italic roman cmbx 10" . 0) . "cmbx10")
(("medium italic roman cmbx 12" . 1) . "cmbx12")
+ (("medium upright math msam 10" . -2) . "msam10")
+ (("medium upright math msam 10" . -1) . "msam10")
+ (("medium upright math msam 10" . 0) . "msam10")
))
(define (style-sheet-template-entry-compile entry size)
(name . font-name)
(size . font-size)
(point . font-point)
+ (kern . kern)
))
(define markup-abbrev-to-properties-alist
(italic . (font-shape . "italic"))
(named . (lookup . name))
(text . (lookup . value))
- (super . (font-size . -1)))
+ ;; super needs some work
+ (super . (font-size . "-1")))
(map (lambda (x) (cons (car x) (cons 'font-style (car x))))
style-to-font-alist)))
--- /dev/null
+
+
+(define (uniqued-alist alist acc)
+ (if (null? alist) acc
+ (if (assoc (caar alist) acc)
+ (uniqued-alist (cdr alist) acc)
+ (uniqued-alist (cdr alist) (cons (car alist) acc)
+ ))))
+
+
+;;; TODO
+
+(define (wordwrap string)
+ ""
+ )
+
+
+(define (self-evaluating? x)
+ (or (number? x) (string? x))
+ )
+
+(define (type-name predicate)
+ (cond
+ ((eq? predicate dir?) "direction")
+ ((eq? predicate ly-element?) "graphic element")
+ ((eq? predicate pair?) "pair")
+ ((eq? predicate integer?) "integer")
+ ((eq? predicate list?) "list")
+ ((eq? predicate symbol?) "symbol")
+ ((eq? predicate string?) "string")
+ ((eq? predicate boolean?) "string")
+ ((eq? predicate number?) "number")
+ ((eq? predicate procedure?) "procedure")
+ (else "(unknown)")
+ ))
+
+(define (scm->string val)
+ (string-append
+ (if (self-evaluating? val) "" "'")
+ (call-with-output-string (lambda (port) (display val port)))
+ ))
+
+(define (document-property prop desc)
+ (let ((handle (assoc (car prop) desc)))
+ (string-append
+ "\n" (symbol->string (car prop)) " (" (type-name (cadr prop)) ") -- "
+ (caddr prop)
+ "\ndefault value: "
+ (if (pair? handle)
+ (scm->string (cdr handle))
+ "not set"
+ )
+ "\n"
+ )
+ ))
+
+;;
+;; todo: setup ifaces differently.
+;;
+(define (document-element description)
+ (let* ((metah (assoc 'meta description))
+ (meta (if (pair? metah)
+ (cdr metah)
+ '((properties . ()) (name . "huh?"))
+ ))
+
+ (name (cdr (assoc 'name meta)))
+; (iface-descs (cdr (assoc 'interface-descriptions meta)))
+ (propdesc (cdr (assoc 'properties meta)))
+ (docs (map (lambda (x) (document-property x description))
+ (uniqued-alist propdesc '())))
+ )
+
+ (string-append
+ "\n-------------------------\n"
+ name "\n"
+ "-------------------------\n"
+ "INTERFACES\n"
+ "(todo)\n"
+ ; (apply string-append iface-descs)
+ "-------------------------\n"
+ "PROPERTIES:\n"
+ (apply string-append docs)
+ )
+ ))
+
+
+(define (document-elements elts)
+ (string-append
+ (map (lambda (x) (display (car x)) (document-element (cdr x)))
+ elts
+ )
+ ))
+
+(define (test-module )
+ (display
+ (list
+ (scm->string '(1 2 abc))
+ (scm->string +)
+ (type-name number?)
+ (uniqued-alist '((a . 1 ) (a . 1)) '() )
+ )))
+
+
+; (define b (cdr (assoc 'Beam all-element-descriptions)))
+;(display b)
+
+; (display (document-element b))
+
+(display (document-elements all-element-descriptions))
+
--- /dev/null
+
+; should include default value?
+
+;;; ::::::: should generate documentation for score elements from here.
+
+(define (property-description symbol type? description)
+ (list symbol type? description))
+
+(define (lily-interface symbol description props)
+ (list (list symbol)
+ (list description)
+ props
+ )
+ )
+
+(define (merge-interfaces ifs)
+ (list
+ (apply append (map car ifs))
+ (apply append (map cadr ifs))
+ (apply append (map caddr ifs))
+ ))
+
+(define (element-description name . interfaces)
+ (let ((merged (merge-interfaces interfaces)))
+ (list (cons 'separator "\n\n\n") ;easy printing.
+ (cons 'name name)
+ (cons 'interfaces (car merged))
+ ; (cons 'interface-descriptions (cadr merged))
+ ;; description of the element itself?
+ (cons 'properties (caddr merged))
+ )))
+
+;;;;;;;;;;;;;;;;;
+
+(define general-element-interface
+ (lily-interface
+ 'general-element-interface
+ "All elements support this"
+ (list (property-description 'X-offset-callbacks list? "")
+ (property-description 'Y-offset-callbacks list? "")
+ (property-description 'X-extent-callback procedure? "")
+ (property-description 'Y-extent-callback procedure? "")
+ (property-description 'font-size integer? "")
+ ))
+)
+
+(define beam-interface
+ (lily-interface
+ 'beam-interface
+ "A beam. "
+ (list
+ (property-description 'y-position number? "position of left edge")
+ (property-description 'height number? "dy")
+ (property-description 'flag-width-function procedure? "")
+ (property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams ")
+ (property-description 'default-neutral-direction dir? "which
+direction to choose if we're in the middle of the staff ")
+ (property-description 'thickness number? "weight of beams, in staffspace")
+ (property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)")
+ (property-description 'beamed-stem-shorten number? "")
+ (property-description 'height-quants number? "")
+ (property-description 'vertical-position-quant-function procedure? "")
+ (property-description 'dir-function procedure? "")
+ (property-description 'damping number? "damping factor.")
+ (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)")
+ (property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
+ )
+))
+
+
+
+;;;;;;;;;;;;;;;;;;;;
+
+(define clef-interface
+ (lily-interface
+ 'clef-interface
+ "A clef sign"
+ (list
+ (property-description 'non-default boolean? "not set because of existence of a bar?")
+ (property-description 'change boolean? "is this a change clef (smaller size)?")
+ (property-description 'glyph string? "a string determining what glyph is typeset")
+ ))
+ )
+
+(define axis-group-interface
+ (lily-interface
+ 'axis-group-interface
+ "a group of coupled elements"
+ (list
+ (property-description 'axes list? "list of axis (number) in which this group works")
+ )))
+
+(define note-column-interface
+ (lily-interface
+ 'note-column-interface
+ "Stem and noteheads combined"
+ (list
+ (property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting.")
+ (property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings.")
+ (property-description 'merge-differently-dotted boolean? "merge black noteheads with differing dot count.")
+ ))
+ )
+
+(define stem-interface
+ (lily-interface
+ 'stem-interface
+ "A stem"
+ (list
+ (property-description 'thickness number? "")
+ (property-description 'beamed-lengths list? "")
+ (property-description 'beamed-minimum-lengths list? "")
+ (property-description 'lengths list? "")
+ (property-description 'stem-shorten list? "")
+ (property-description 'default-neutral-direction dir? "")
+ (property-description 'direction dir? "")
+ (property-description 'stem-length number? "")
+ (property-description 'style string? "") ; symbol!?
+ (property-description 'flag-style string? "") ; symbol!?
+ (property-description 'X-offset-callbacks list? "")
+ )))
+
+
+(define slur-interface
+ (lily-interface
+ 'slur-interface
+ "A slur"
+ (list
+ (property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
+ (property-description 'details list? "alist containing contaning a few magic constants.")
+ (property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
+ (property-description 'direction dir? "up or down?")
+ (property-description 'y-free number? "? ")
+ (property-description 'control-points list? "")
+ (property-description 'extremity-rules list? "")
+ (property-description 'extremity-offset-alist list? "")
+ (property-description 'thickness list? "")
+ (property-description 'dash number? "number representing the length of the dashes.")
+ )
+ )
+ )
+
+(define side-position-interface
+ (lily-interface
+ 'side-position-interface
+ "put an element next to another one."
+ (list
+ (property-description 'direction dir? "where to put the victim object (left or right?)")
+ (property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.")
+ (property-description 'minimum-space number? "minimum distance that the victim should move (after padding)")
+ (property-description 'padding number? "add this much extra space between victim and support")
+ (property-description 'self-alignment-X number? "real number: -1 = left aligned, 0 = center, 1 right-aligned in X direction. Set to an element pointer, if you want that element to be the center. ")
+ (property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis")
+
+ )
+ ))
+
+(define accidentals-interface
+ (lily-interface
+ 'accidentals-interface
+ "Accidentals"
+ (list
+ (property-description 'left-padding number? "space left of accs")
+ (property-description 'right-padding number? "space right of accs")
+ )
+ ))
+
+(define note-head-interface
+ (lily-interface
+ 'note-head-interface
+ "Note head"
+ (list
+ (property-description 'style symbol? "symbol that sets note head style")
+ )
+ ))
+
+
+(define rhythmic-head-interface
+ (lily-interface
+ 'rhythmic-head-interface
+ "Note head or rest"
+ (list
+ (property-description 'dot ly-element? "reference to Dots object.")
+ (property-description 'stem ly-element? "pointer to Stem object")
+ (property-description 'duration-log integer? "2-log of the notehead duration")
+ )))
+
+(define rest-interface
+ (lily-interface
+ 'rest-interface
+ "a rest"
+ (list
+ (property-description 'style string? "string specifying glyph style"))))
+
+(define tuplet-bracket-interface
+ (lily-interface
+ 'tuplet-bracket-interface
+ "A bracket with a number in the middle"
+ (list
+ (property-description 'beams list? "list of beam ptrs.")
+ (property-description 'columns list? " list of note-columns.")
+ (property-description 'number-gap number? "")
+ (property-description 'delta-y number? "")
+ (property-description 'thick number? "")
+ )
+))
+
+
+(define align-interface
+ (lily-interface
+ 'align-interface
+ " Order elements top to bottom/left to right/right to left etc."
+ (list
+ (property-description 'stacking-dir dir? "stack contents of elements in which direction ?")
+ (property-description 'align-dir dir? "Which side to align? -1: left side, 0: centered around center-element if not nil, or around center of width), 1: right side")
+ (property-description 'threshold pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
+ (property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
+ (property-description 'center-element ly-element? "element which will be at the
+center of the group after aligning (when using
+Align_interface::center_on_element). The center element should have
+this object as a reference point.")
+ (property-description 'elements list? "to be aligned elements ")
+ (property-description 'axes list? "list of axis numbers. Should contain only one number.")
+ )))
+
+(define aligned-interface
+ (lily-interface
+ 'aligned-interface
+ "read by align-interface"
+ (list
+ (property-description 'minimum-space pair? "(cons LEFT RIGHT)")
+ (property-description 'extra-space pair? "(cons LEFT RIGHT)")
+ )))
+
+(define break-aligned-interface
+ (lily-interface
+ 'break-aligned-interface
+ "Items that are aligned in prefatory matter"
+ (list
+ (property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
+ (property-description 'visibility-lambda procedure? "")
+ (property-description 'breakable boolean? "")
+ )))
+
+(define chord-name-interface
+ (lily-interface
+ 'chord-name-interface
+ ""
+ (list
+ )))
+(define time-signature-interface
+ (lily-interface
+ 'time-signature-interface
+ "A time signature, in different styles"
+ (list
+ (property-description 'fraction pair? "")
+ (property-description 'style string? "")
+ )))
+
+(define bar-line-interface
+ (lily-interface
+ 'bar-line-interface
+ "Bar line"
+ (list
+ (property-description 'barsize-procedure procedure? "")
+ (property-description 'kern number? "")
+ (property-description 'thin-kern number? "")
+ (property-description 'hair-thickness number? "")
+ (property-description 'thick-thickness number? "")
+ (property-description 'glyph string? "")
+ (property-description 'bar-size number? "")
+ (property-description 'break-glyph-function procedure? "")
+ )))
+
+
+
+
+(define text-spanner-interface
+ (lily-interface
+ 'text-spanner-interface
+ "generic text spanner"
+ (list
+ (property-description 'dash-period number? "")
+ (property-description 'dash-length number? "")
+ (property-description 'line-thickness number? "")
+ (property-description 'edge-height pair? "(leftheight . rightheight)")
+ (property-description 'edge-text pair? "(lefttext . righttext)")
+ (property-description 'text-style string? "") ; SYMBOL!!?
+ (property-description 'type string? "line, dashed-line or dotted-line") ; SYMBOL!!?
+ )
+))
+
+(define hairpin-interface
+ (lily-interface
+ 'hairpin-interface
+ "hairpin crescendo"
+ (list
+ (property-description 'grow-direction dir? "")
+ (property-description 'thickness number? "")
+ (property-description 'height number? "")
+ )))
+
+
+(define arpeggio-interface
+ (lily-interface
+ 'arpeggio-interface
+ "arpeggio "
+ (list
+ (property-description 'stems list? "list of stem objects, corresponding to the notes that the arp has to be before.")
+ )
+ )
+ )
+
+(define note-collision-interface
+ (lily-interface
+ 'note-collision-interface
+ "note collision"
+ (list
+ (property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
+ ) ) )
+(define dot-interface
+ (lily-interface
+ 'dots-interface
+ "The dots to go with a notehead/rest. A separate interface, since they
+ are a party in collision resolution."
+ (list
+ (property-description 'dot-count integer? "number of dots")
+ )))
+
+(define text-interface
+ (lily-interface
+ 'text-interface
+ "A text"
+ (list
+ (property-description 'text string? "")
+ (property-description 'style string? "")
+ )))
+
+
+(define dot-column-interface
+ (lily-interface
+ 'dot-column-interface
+ ""
+ (list
+ )))
+
+(define dynamic-interface
+ (lily-interface
+ 'dynamic-interface
+ "Any kind of loudness sign"
+ '()
+ ))
+
+
+(define finger-interface
+ (lily-interface
+ 'finger-interface
+ "Any kind of loudness sign"
+ '()
+ ))
+
+(define separation-spanner-interface
+ (lily-interface
+ 'separation-spanner-interface
+ ""
+ '()
+ ))
+(define text-script-interface
+ (lily-interface
+ 'text-script-interface
+ "Any text script"
+ '()
+ ))
+
+(define grace-alignment-interface
+ (lily-interface
+ 'grace-alignment-interface
+ "put grace notes in line"
+ (list
+ (property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
+ )
+ ))
+
+(define hara-kiri-group-interface
+ (lily-interface
+ 'hara-kiri-group-interface
+ "seppuku"
+ '()))
+
+(define lyric-hyphen-interface
+ (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."
+ (list
+
+ (property-description 'thickness number? "thickness of line (in stafflinethickness)")
+ (property-description 'height number? "vertical offset (in staffspace)")
+
+ (property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
+ (property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
+ )))
+
+(define key-signature-interface
+ (lily-interface
+ 'key-signature-interface
+ "A group of accidentals."
+ (list
+ (property-description 'c0-position integer? "integer indicating the position of central C?")
+ (property-description 'old-accidentals list? "list of (pitch, accidental) pairs")
+ (property-description 'new-accidentals list? "list of (pitch, accidental) pairs")
+ )))
+
+(define lyric-extender-interface
+ (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)."
+ (list
+ (property-description 'word-space number? "")
+ (property-description 'height number? "in stafflinethickness")
+ (property-description 'right-trim-amount number? "")
+ )))
+
+
+(define lyric-syllable-interface
+ (lily-interface
+ 'lyric-syllable-interface
+ ""
+ (list
+ (property-description 'word-space number? "")
+ )))
+
+
+(define mark-interface
+ (lily-interface
+ 'mark-interface
+ ""
+ (list
+ )))
+
+(define multi-measure-rest-interface
+ (lily-interface
+ 'multi-measure-rest-interface
+ ""
+ (list
+
+ (property-description 'columns list? "list of paper-columns")
+ (property-description 'expand-limit integer? "int : max number of measures expanded in church rests")
+ (property-description 'minimum-width number? "Real in staffspace")
+ (property-description 'padding number? "staffspace")
+ )))
+
+(define paper-column-interface
+ (lily-interface
+ 'paper-column-interface
+ ""
+ (list
+ (property-description 'dir-list list? "list of stem directions")
+ (property-description 'shortest-playing-duration moment? "duration of the shortest playing in that column.")
+ (property-description 'shortest-starter-duration moment? "duration of the shortest notes that starts exactly in this column.")
+ (property-description 'contains-grace boolean? "Used to widen entries for grace notes.")
+ (property-description 'extra-space pair? "pair of distances")
+ (property-description 'stretch-distance pair? "pair of distances")
+ )))
+
+(define spaceable-element-interface
+ (lily-interface
+ 'spaceable-element-interface
+ ""
+ (list
+ (property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
+ (property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs")
+ (property-description 'dir-list list? "list of stem directions.")
+ )))
+
+(define rest-collision-interface
+ (lily-interface
+ 'rest-collision-interface
+ ""
+ (list
+ (property-description 'maximum-rest-count integer? "")
+ (property-description 'minimum-distance number? "")
+ )))
+
+(define script-interface
+ (lily-interface
+ 'script-interface
+ ""
+ (list
+ (property-description 'script-priority number? "")
+ )))
+
+(define script-column-interface
+ (lily-interface
+ 'script-column-interface
+ ""
+ (list )))
+
+
+(define spacing-spanner-interface
+ (lily-interface
+ 'spacing-spanner-interface
+ ""
+ (list
+ (property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
+ )))
+
+(define staff-symbol-interface
+ (lily-interface
+ 'staff-symbol-interface
+ "This spanner draws the lines of a staff. The middle line is
+position 0."
+ (list
+ (property-description 'staff-space number? "")
+ (property-description 'line-count integer? "")
+ )))
+
+(define stem-tremolo-interface
+ (lily-interface
+ 'stem-tremolo-interface
+ ""
+ (list
+ (property-description 'stem ly-element? "pointer to the stem object.")
+ (property-description 'beam-width number? "")
+ (property-description 'beam-thickness number? "")
+ (property-description 'beam-space-function procedure? "")
+ )))
+
+(define separation-item-interface
+ (lily-interface
+ 'separation-item-interface
+ ""
+ (list
+ )))
+
+(define sustain-pedal-interface
+ (lily-interface
+ 'sustain-pedal-interface
+ ""
+ (list
+ )))
+(define system-start-delimiter
+ (lily-interface
+ 'system-start-delimiter
+ ""
+ (list
+ (property-description 'collapse-height number? "")
+ (property-description 'thickness number? "")
+ (property-description 'arch-height number? "")
+ (property-description 'arch-angle number? "")
+ (property-description 'arch-thick number? "")
+ (property-description 'arch-width number? "")
+ (property-description 'bracket-thick number? "")
+ (property-description 'bracket-width number? "")
+ )))
+
+(define text-script-interface
+ (lily-interface
+ 'text-script-interface
+ ""
+ (list
+
+ )))
+
+(define tie-interface
+ (lily-interface
+ 'tie-interface
+ ""
+ (list
+ (property-description 'staffline-clearance number? "")
+ (property-description 'heads pair? "pair of element pointers, pointing to the two heads of the tie. ")
+ (property-description 'details list? "")
+ (property-description 'thickness number? "")
+ (property-description 'x-gap number? "")
+ (property-description 'minimum-length number? "")
+ )))
+
+
+
+(define tie-column-interface
+ (lily-interface
+ 'tie-column-interface
+ ""
+ (list
+ )))
+
+(define volta-bracket-interface
+ (lily-interface
+ 'volta-bracket-interface
+ "Volta bracket with number"
+ (list
+ (property-description 'bars list? "list of barline ptrs.")
+ (property-description 'thickness number? "in stafflinethickness")
+ (property-description 'height number? "in staffspace ")
+ )))
+
+(define span-bar-interface
+ (lily-interface
+ 'span-bar-interface
+ ""
+ (list
+ )))
+
;
+; We should repartition the entire scm side of lily in a
+; more sane way, using namesspaces/modules?
+
;(debug-enable 'backtrace)
;;; library funtions
(string-append (number->string (car c)) " "
(number->string (cdr c)) " "))
-
(define (font i)
(string-append
"font"
(make-string 1 (integer->char (+ (char->integer #\A) i)))
))
-
-
(define (scm-scm action-name)
1)
(string-append "\\special{src:" (number->string line) ":"
(number->string col) " " file "}"
;; arg, the clueless take over the mailing list...
- "\\special{-****-These-warnings-are-harmless-***}"
- "\\special{-****-PLEASE-read-http://appel.lilypond.org/wiki/index.php3?PostProcessing-****}"
+; "\\special{-****-These-warnings-are-harmless-***}"
+; "\\special{-****-PLEASE-read-http://appel.lilypond.org/wiki/index.php3?PostProcessing-****}"
)
; line numbers only:
(6 . 0)
)
)
+
+(begin
+ (eval-string (ly-gulp-file "interface.scm"))
+ (eval-string (ly-gulp-file "slur.scm"))
+ (eval-string (ly-gulp-file "font.scm"))
+ (eval-string (ly-gulp-file "generic-property.scm"))
+ (eval-string (ly-gulp-file "basic-properties.scm"))
+ (eval-string (ly-gulp-file "chord-names.scm"))
+ (eval-string (ly-gulp-file "element-descriptions.scm"))
+ )
))
-
+(define default-basic-slur-properties
+ `(
+ (molecule-callback . ,Slur::brew_molecule)
+ (thickness . 1.2)
+ (spacing-procedure . ,Slur::set_spacing_rods)
+ (minimum-length . 1.5)
+ (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))
+ (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5)))
+ (beautiful . 0.5)
+ (y-free . 0.75)
+ (attachment-offset . ((0 . 0) . (0 . 0)))
+ (slope-limit . 0.8)
+ (meta . ,(element-description "Slur" general-element-interface slur-interface))
+ )
+ )
gap = (0,1)
for m in self.measures[1:]:
if not m or not m.valid:
+ sys.stderr.write ("Skipping non-existant measure")
continue
fr = None
try:
fr = m.frames[x]
except IndexError:
- pass
-
+
+ sys.stderr.write ("Skipping nonexistent frame")
+ laystr = laystr + "% FOOBAR ! \n"
+ print laystr
if fr:
first_frame = fr
if gap <> (0,1):
identify()
+e = None
for f in files:
if f == '-':
f = ''
#!@PYTHON@
# vim: set noexpandtab:
# TODO:
-# * Figure out clean set of options.
+# * Figure out clean set of options. Hmm, isn't it pretty ok now?
# * add support for .lilyrc
-# * %\def\preMudelaExample should be ignored by mudela-book because
-# it is commented out
-# * if you run mudela-book once with --no-pictures, and then again
-# without the option, then the pngs will not be created. You have
-# to delete the generated .ly files and rerun mudela-book.
-# * kontroller hvordan det skannes etter preMudelaExample i preamble
-# det ser ut til at \usepackage{graphics} legges til bare hvis
-# preMudelaExample ikke finnes.
-# * add suppoert for @c comments. Check that preamble scanning works after this.
-
-# * in LaTeX, commenting out blocks like this
-# %\begin{mudela}
-# %c d e
-# %\end{mudela} works as expected.
-# * \usepackage{landscape} is gone. Convince me it is really neede to get it back.
-# * We are calculating more of the linewidths, for example 2 col from 1 col.
-
# This is was the idea for handling of comments:
}
}
-def output_verbatim (body):#ugh .format
+def output_verbatim (body):
if __main__.format == 'texi':
body = re.sub ('([@{}])', '@\\1', body)
return get_output ('output-verbatim') % body
-def output_mbverbatim (body):#ugh .format
- if __main__.format == 'texi':
- body = re.sub ('([@{}])', '@\\1', body)
- return get_output ('output-verbatim') % body
re_dict = {
'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
'landscape': no_match,
'verbatim': r"""(?s)(?P<code>@example\s.*?@end example\s)""",
'verb': r"""(?P<code>@code{.*?})""",
- 'mudela-file': '(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
+ 'mudela-file': '(?m)^(?!@c)(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
'mudela' : '(?m)^(?!@c)(?P<match>@mudela(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
- #ugh add check for @c
'mudela-block': r"""(?m)^(?!@c)(?P<match>(?s)(?P<match>@mudela(\[(?P<options>.*?)\])?\s(?P<code>.*?)@end mudela\s))""",
'option-sep' : ', *',
'intertext': r',?\s*intertext=\".*?\"',
- #ugh fix
'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
'numcols': no_match,
paperguru.set_geo_option(k, o[k])
idx = idx + 1
+def scan_texi_preamble (chunks):
+ # this is not bulletproof..., it checks the first 10 chunks
+ idx = 0
+ while 1:
+ if chunks[idx][0] == 'input':
+ if string.find(chunks[idx][1], "@afourpaper") != -1:
+ paperguru.m_papersize = 'a4'
+ elif string.find(chunks[idx][1], "@afourwide") != -1:
+ paperguru.m_papersize = 'a4wide'
+ elif string.find(chunks[idx][1], "@smallbook") != -1:
+ paperguru.m_papersize = 'smallbook'
+ idx = idx + 1
+ if idx == 10 or idx == len(chunks):
+ break
+
def scan_preamble (chunks):
if __main__.format == 'texi':
- #ugh has to be fixed when @c comments are implemented
- # also the searching here is far from bullet proof.
- if string.find(chunks[0][1], "@afourpaper") != -1:
- paperguru.m_papersize = 'a4'
- elif string.find(chunks[0][1], "@afourwide") != -1:
- paperguru.m_papersize = 'a4wide'
- elif string.find(chunks[0][1], "@smallbook") != -1:
- paperguru.m_papersize = 'smallbook'
+ scan_texi_preamble(chunks)
else:
assert __main__.format == 'latex'
scan_latex_preamble(chunks)
else:
options = []
options = filter(lambda s: s != '', options)
- if 'mbverbatim' in options:#ugh this is ugly and only for texi format
- s = m.group()
- im = get_re('intertext').search(s)
- if im:
- s = s[:im.start()] + s[im.end():]
- im = re.search('mbverbatim', s)
- if im:
- s = s[:im.start()] + s[im.end():]
- if s[:9] == "@mudela[]":
- s = "@mudela" + s[9:]
- return [('mudela', m.group('code'), options, s)]
return [('mudela', m.group('code'), options)]
def do_columns(m):
TODO has format [basename, extension, extension, ... ]
"""
- if len(chunk) == 3:
- (type, body, opts) = chunk
- complete_body = None
- else:# mbverbatim
- (type, body, opts, complete_body) = chunk
+ (type, body, opts) = chunk
assert type == 'mudela'
file_body = compose_full_body (body, opts)
basename = `abs(hash (file_body))`
else:
taken_file_names[basename] = taken_file_names[basename] + 1
basename = basename + "-%i" % taken_file_names[basename]
- # writes the file if necessary, returns true if it was written
if not g_read_lys:
update_file(file_body, os.path.join(g_outdir, basename) + '.ly')
needed_filetypes = ['tex']
if 'eps' in opts and not ('eps' in needed_filetypes):
needed_filetypes.append('eps')
outname = os.path.join(g_outdir, basename)
- if not os.path.isfile(outname + '.tex') \
- or os.stat(outname+'.ly')[stat.ST_MTIME] > \
- os.stat(outname+'.tex')[stat.ST_MTIME]:
- todo = needed_filetypes
- else:
- todo = []
-
+ def f(base, ext1, ext2):
+ a = os.path.isfile(base + ext2)
+ if (os.path.isfile(base + ext1) and
+ os.path.isfile(base + ext2) and
+ os.stat(base+ext1)[stat.ST_MTIME] >
+ os.stat(base+ext2)[stat.ST_MTIME]) or \
+ not os.path.isfile(base + ext2):
+ return 1
+ todo = []
+ if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
+ todo.append('tex')
+ if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
+ todo.append('eps')
+ if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
+ todo.append('png')
newbody = ''
if 'verbatim' in opts:
newbody = output_verbatim (body)
- elif 'mbverbatim' in opts:
- newbody = output_mbverbatim (complete_body)
for o in opts:
m = re.search ('intertext="(.*?)"', o)