2 ; should include default value?
4 ;;; ::::::: should generate documentation for score elements from here.
6 (define (property-description symbol type? description)
7 (list symbol type? description))
9 (define (lily-interface symbol description props)
17 (define (merge-interfaces ifs)
19 (apply append (map car ifs))
20 (apply append (map cadr ifs))
21 (apply append (map caddr ifs))
24 (define (uniqued-alist alist acc)
26 (if (assoc (caar alist) acc)
27 (uniqued-alist (cdr alist) acc)
28 (uniqued-alist (cdr alist) (cons (car alist) acc)
31 (define (element-description name . interfaces)
32 (let* ((ifs (cons general-element-interface interfaces))
33 (props (map caddr ifs))
36 (list (cons 'separator "\n\n\n") ;easy printing.
38 (cons 'interfaces syms)
39 (cons 'interface-descriptions ifs)
40 ; (cons 'interface-descriptions (cadr merged))
41 ;; description of the element itself?
42 (cons 'properties (apply append props))
46 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50 (define general-element-interface
52 'general-element-interface
53 "All elements support this"
54 (list (property-description 'X-offset-callbacks list? "")
55 (property-description 'Y-offset-callbacks list? "")
56 (property-description 'X-extent-callback procedure? "")
57 (property-description 'Y-extent-callback procedure? "")
58 (property-description 'font-size integer? "")
62 (define beam-interface
67 (property-description 'y-position number? "position of left edge")
68 (property-description 'height number? "dy")
69 (property-description 'flag-width-function procedure? "")
70 (property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams ")
71 (property-description 'default-neutral-direction dir? "which
72 direction to choose if we're in the middle of the staff ")
73 (property-description 'thickness number? "weight of beams, in staffspace")
74 (property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)")
75 (property-description 'beamed-stem-shorten number? "")
76 (property-description 'height-quants number? "")
77 (property-description 'vertical-position-quant-function procedure? "")
78 (property-description 'dir-function procedure? "")
79 (property-description 'damping number? "damping factor.")
80 (property-description 'outer-stem-length-limit number? "catch
81 suspect beam slopes, set slope to zero if outer stem is lengthened
82 more than this (in staffspace)")
83 (property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
91 (define clef-interface
96 (property-description 'non-default boolean? "not set because of existence of a bar?")
97 (property-description 'change boolean? "is this a change clef (smaller size)?")
98 (property-description 'glyph string? "a string determining what glyph is typeset")
102 (define axis-group-interface
104 'axis-group-interface
105 "a group of coupled elements"
107 (property-description 'axes list? "list of axis (number) in which this group works")
110 (define note-column-interface
112 'note-column-interface
113 "Stem and noteheads combined"
115 (property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting.")
116 (property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings.")
117 (property-description 'merge-differently-dotted boolean? "merge black noteheads with differing dot count.")
121 (define stem-interface
126 (property-description 'thickness number? "")
127 (property-description 'beamed-lengths list? "")
128 (property-description 'beamed-minimum-lengths list? "")
129 (property-description 'lengths list? "")
130 (property-description 'stem-shorten list? "")
131 (property-description 'default-neutral-direction dir? "")
132 (property-description 'direction dir? "")
133 (property-description 'stem-length number? "")
134 (property-description 'style string? "") ; symbol!?
135 (property-description 'flag-style string? "") ; symbol!?
136 (property-description 'X-offset-callbacks list? "")
140 (define slur-interface
145 (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.")
146 (property-description 'details list? "alist containing contaning a few magic constants.")
147 (property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
148 (property-description 'attachment-offset pair? "cons of offsets, '(LEFT-offset . RIGHT-offset). This offset is added to the attachments to prevent ugly slurs.")
149 (property-description 'direction dir? "up or down?")
150 (property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
151 (property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems")
152 (property-description 'control-points list? "[internal] control points of bezier curve")
153 (property-description 'extremity-rules list? "an alist (procedure slur dir) -> attachment to determine the attachment (see above). If procedure returns #t, attachment is used. Otherwise, the next procedure is tried.")
154 (property-description 'extremity-offset-alist list? "an alist (attachment stem-dir*dir slur-dir*dir) -> offset. The offset adds to the centre of the notehead, or stem.")
155 (property-description 'thickness list? "The thickness[stafflinethickness] of slur in the centre.")
156 (property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.")
161 (define side-position-interface
163 'side-position-interface
164 "put an element next to another one."
166 (property-description 'direction dir? "where to put the victim object (left or right?)")
167 (property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.")
168 (property-description 'minimum-space number? "minimum distance that the victim should move (after padding)")
169 (property-description 'padding number? "add this much extra space between victim and support")
170 (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. ")
171 (property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis")
176 (define accidentals-interface
178 'accidentals-interface
181 (property-description 'left-padding number? "space left of accs")
182 (property-description 'right-padding number? "space right of accs")
186 (define note-head-interface
191 (property-description 'style symbol? "symbol that sets note head style")
195 (define note-name-interface
200 (property-description 'style symbol? "symbol that sets note name style")
205 (define rhythmic-head-interface
207 'rhythmic-head-interface
210 (property-description 'dot ly-element? "reference to Dots object.")
211 (property-description 'stem ly-element? "pointer to Stem object")
212 (property-description 'duration-log integer? "2-log of the notehead duration")
215 (define rest-interface
220 (property-description 'style string? "string specifying glyph style"))))
222 (define tuplet-bracket-interface
224 'tuplet-bracket-interface
225 "A bracket with a number in the middle"
227 (property-description 'beams list? "list of beam ptrs.")
228 (property-description 'columns list? " list of note-columns.")
229 (property-description 'number-gap number? "")
230 (property-description 'delta-y number? "")
231 (property-description 'thick number? "")
236 (define align-interface
239 " Order elements top to bottom/left to right/right to left etc."
241 (property-description 'stacking-dir dir? "stack contents of elements in which direction ?")
242 (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")
243 (property-description 'threshold pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
244 (property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
245 (property-description 'center-element ly-element? "element which will be at the
246 center of the group after aligning (when using
247 Align_interface::center_on_element). The center element should have
248 this object as a reference point.")
249 (property-description 'elements list? "to be aligned elements ")
250 (property-description 'axes list? "list of axis numbers. Should contain only one number.")
253 (define aligned-interface
256 "read by align-interface"
258 (property-description 'minimum-space pair? "(cons LEFT RIGHT)")
259 (property-description 'extra-space pair? "(cons LEFT RIGHT)")
262 (define break-aligned-interface
264 'break-aligned-interface
265 "Items that are aligned in prefatory matter"
267 (property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
268 (property-description 'visibility-lambda procedure? "")
269 (property-description 'breakable boolean? "")
272 (define chord-name-interface
274 'chord-name-interface
278 (define time-signature-interface
280 'time-signature-interface
281 "A time signature, in different styles"
283 (property-description 'fraction pair? "")
284 (property-description 'style string? "")
287 (define bar-line-interface
292 (property-description 'barsize-procedure procedure? "")
293 (property-description 'kern number? "")
294 (property-description 'thin-kern number? "")
295 (property-description 'hair-thickness number? "")
296 (property-description 'thick-thickness number? "")
297 (property-description 'glyph string? "")
298 (property-description 'bar-size number? "")
299 (property-description 'break-glyph-function procedure? "")
304 (define hairpin-interface
309 (property-description 'grow-direction dir? "")
310 (property-description 'thickness number? "")
311 (property-description 'height number? "")
315 (define arpeggio-interface
320 (property-description 'stems list? "list of stem objects, corresponding to the notes that the arp has to be before.")
325 (define note-collision-interface
327 'note-collision-interface
330 (property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
332 (define dot-interface
335 "The dots to go with a notehead/rest. A separate interface, since they
336 are a party in collision resolution."
338 (property-description 'dot-count integer? "number of dots")
341 (define text-interface
344 "A scheme markup text"
346 (property-description 'text (lambda (x) (or (string? x) (list? x))) "the scheme markup text. Either a string, or a list of which the CAR is a markup '(MARKUP text text ...). MARKUP is either a CONS: an element property '(key . value) or a symbol: an abbreviation for a list of element properties. These abbreviations are currently defined: rows lines roman music bold italic named super sub text, as well as all font-style's.")
347 (property-description 'font-style string? "font definition for a special purpose, one of: finger volta timesig mark script large Large dynamic")
348 (property-description 'font-series string? "partial font definition: medium, bold")
349 (property-description 'font-shape string? "partial font definition: upright or italic")
350 (property-description 'font-family string? "partial font definition: music roman braces dynamic math ...")
351 (property-description 'font-name string? "partial font definition: base name of font file FIXME: should override other partials")
352 (property-description 'font-point string? "partial font definition: exact font size in points FIXME: should override font-size")
353 (property-description 'font-size string? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger")
354 (property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical")
355 (property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name")
356 (property-description 'raise number? "height for text to be raised (a negative value lowers the text")
357 (property-description 'kern number? "amount of extra white space to add before text. This is `relative'(?) to the current alignment.")
358 (property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts")
362 (define dot-column-interface
364 'dot-column-interface
369 (define dynamic-interface
372 "Any kind of loudness sign"
377 (define finger-interface
380 "Any kind of loudness sign"
384 (define separation-spanner-interface
386 'separation-spanner-interface
390 (define text-script-interface
392 'text-script-interface
397 (define grace-alignment-interface
399 'grace-alignment-interface
400 "put grace notes in line"
402 (property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
406 (define hara-kiri-group-interface
408 'hara-kiri-group-interface
412 (define lyric-hyphen-interface
414 'lyric-hyphen-interface
415 "A centred hyphen is a simple line between lyrics used to divide
416 syllables. The length of the hyphen line should stretch based on the
417 size of the gap between syllables."
420 (property-description 'thickness number? "thickness of line (in stafflinethickness)")
421 (property-description 'height number? "vertical offset (in staffspace)")
423 (property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
424 (property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
427 (define key-signature-interface
429 'key-signature-interface
430 "A group of accidentals."
432 (property-description 'c0-position integer? "integer indicating the position of central C?")
433 (property-description 'old-accidentals list? "list of (pitch, accidental) pairs")
434 (property-description 'new-accidentals list? "list of (pitch, accidental) pairs")
437 (define lyric-extender-interface
439 'lyric-extender-interface
440 "The extender is a simple line at the baseline of the lyric
441 that helps show the length of a melissima (tied/slurred note)."
443 (property-description 'word-space number? "")
444 (property-description 'height number? "in stafflinethickness")
445 (property-description 'right-trim-amount number? "")
449 (define lyric-syllable-interface
451 'lyric-syllable-interface
454 (property-description 'word-space number? "")
458 (define mark-interface
465 (define multi-measure-rest-interface
467 'multi-measure-rest-interface
471 (property-description 'columns list? "list of paper-columns")
472 (property-description 'expand-limit integer? "int : max number of measures expanded in church rests")
473 (property-description 'minimum-width number? "Real in staffspace")
474 (property-description 'padding number? "staffspace")
477 (define paper-column-interface
479 'paper-column-interface
482 (property-description 'dir-list list? "list of stem directions")
483 (property-description 'shortest-playing-duration moment? "duration of the shortest playing in that column.")
484 (property-description 'shortest-starter-duration moment? "duration of the shortest notes that starts exactly in this column.")
485 (property-description 'contains-grace boolean? "Used to widen entries for grace notes.")
486 (property-description 'extra-space pair? "pair of distances")
487 (property-description 'stretch-distance pair? "pair of distances")
490 (define spaceable-element-interface
492 'spaceable-element-interface
495 (property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
496 (property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs")
497 (property-description 'dir-list list? "list of stem directions.")
500 (define rest-collision-interface
502 'rest-collision-interface
505 (property-description 'maximum-rest-count integer? "")
506 (property-description 'minimum-distance number? "")
509 (define script-interface
514 (property-description 'script-priority number? "")
517 (define script-column-interface
519 'script-column-interface
524 (define spacing-spanner-interface
526 'spacing-spanner-interface
529 (property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
532 (define staff-symbol-interface
534 'staff-symbol-interface
535 "This spanner draws the lines of a staff. The middle line is
538 (property-description 'staff-space number? "")
539 (property-description 'line-count integer? "")
542 (define stem-tremolo-interface
544 'stem-tremolo-interface
547 (property-description 'stem ly-element? "pointer to the stem object.")
548 (property-description 'beam-width number? "")
549 (property-description 'beam-thickness number? "")
550 (property-description 'beam-space-function procedure? "")
553 (define separation-item-interface
555 'separation-item-interface
560 (define sustain-pedal-interface
562 'sustain-pedal-interface
566 (define system-start-delimiter
568 'system-start-delimiter
571 (property-description 'collapse-height number? "")
572 (property-description 'thickness number? "")
573 (property-description 'arch-height number? "")
574 (property-description 'arch-angle number? "")
575 (property-description 'arch-thick number? "")
576 (property-description 'arch-width number? "")
577 (property-description 'bracket-thick number? "")
578 (property-description 'bracket-width number? "")
581 (define text-script-interface
583 'text-script-interface
589 (define text-spanner-interface
591 'text-spanner-interface
592 "generic text spanner"
594 (property-description 'dash-period number? "the length of one dash + white space")
595 (property-description 'dash-length number? "the length of a dash")
596 (property-description 'line-thickness number? "the thickness[stafflinethickness] of the line")
597 (property-description 'edge-height pair? "a cons that specifies the heights of the vertical egdes '(LEFT-height . RIGHT-height)")
598 (property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text)")
599 (property-description 'type string? "one of: line, dashed-line or dotted-line") ; SYMBOL!!?
603 (define tie-interface
608 (property-description 'staffline-clearance number? "")
609 (property-description 'heads pair? "pair of element pointers, pointing to the two heads of the tie. ")
610 (property-description 'details list? "")
611 (property-description 'thickness number? "")
612 (property-description 'x-gap number? "")
613 (property-description 'minimum-length number? "")
618 (define tie-column-interface
620 'tie-column-interface
625 (define volta-bracket-interface
627 'volta-bracket-interface
628 "Volta bracket with number"
630 (property-description 'bars list? "list of barline ptrs.")
631 (property-description 'thickness number? "in stafflinethickness")
632 (property-description 'height number? "in staffspace ")
635 (define span-bar-interface