1 ;;;; interface-description.scm -- part of generated backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
9 ; should include default value?
13 ;;; Score elements are called `objects' now and then, which gets
14 ;;; rather confusing, we now have `elements', `items', `spanners'
18 (define (lily-interface symbol description props)
26 (define (grob-description name . interfaces)
27 (let* ((ifs (cons general-grob-interface interfaces))
28 (props (map caddr ifs))
29 ; (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
30 ; (apply append props)))
33 (list (cons 'separator "\n\n\n") ;easy printing.
35 (cons 'interfaces syms)
36 (cons 'interface-descriptions ifs)
37 ; (cons 'interface-descriptions (cadr merged))
38 ;; description of the grob itself?
39 ; (cons 'properties prop-typep-pairs)
42 (define general-grob-interface
44 'general-grob-interface
45 "All grobs support this"
65 (define beam-interface
70 #'thickness= weight of beams, in staffspace
77 default-neutral-direction
82 vertical-position-quant-function
84 outer-stem-length-limit
89 (define clef-interface
100 (define axis-group-interface
102 'axis-group-interface
103 "a group of coupled grobs"
108 (define note-column-interface
110 'note-column-interface
111 "Stem and noteheads combined"
118 (define stem-interface
125 beamed-minimum-lengths
132 default-neutral-direction
144 (define slur-interface
158 extremity-offset-alist
166 (define side-position-interface
168 'side-position-interface
169 "Position a victim object (this one) next to other objects (the support).
170 #'direction = where to put the victim object (left or right?)
176 side-relative-direction
185 (define accidentals-interface
187 'accidentals-interface
195 (define line-of-score-interface
197 'line-of-score-interface
198 "Super grob, parent of all:
200 The columns of a score that form one line. The toplevel grob. Any
201 grob has a Line_of_score as both X and Y reference point. The
202 Paper_score contains one grob of this type. Control enters the
203 Grob dependency calculation from this single Line_of_score
206 between-system-string
208 before-line-breaking-callback
209 after-line-breaking-callback
214 (define note-head-interface
223 (define note-name-interface
233 (define rhythmic-head-interface
235 'rhythmic-head-interface
243 (define rest-interface
249 (define tuplet-bracket-interface
251 'tuplet-bracket-interface
252 "A bracket with a number in the middle, used for tuplets."
258 tuplet-bracket-visibility
259 tuplet-number-visibility
266 (define align-interface
269 " Order grobs top to bottom/left to right/right to left etc."
280 (define aligned-interface
283 "read by align-interface"
289 (define break-aligned-interface
291 'break-aligned-interface
292 "Items that are aligned in prefatory matter"
299 (define chord-name-interface
301 'chord-name-interface
302 "generate a chord name"
303 '( pitches inversion bass)))
305 (define time-signature-interface
307 'time-signature-interface
308 "A time signature, in different styles"
309 '( fraction style )))
311 (define bar-line-interface
316 This is a request to print a special bar symbol. It replaces the
317 regular bar symbol with a special
318 symbol. The argument @var{bartype} is a string which specifies the
319 kind of bar to print. Options are @code{\":|\"}
320 @cindex \"|A@@@code{:|}
323 @cindex \"|B@@@code{|:}
325 @cindex \"|C@@@code{:|:}
328 @cindex \"|D@@@code{||}
330 @cindex \"|E@@@code{|.}
333 @cindex \"|F@@@code{.|}
335 @cindex \"|G@@@code{.|.}
338 These produce, respectively, a right repeat, a left repeat, a double
339 repeat, a double bar, a start bar, an end bar, and a thick double bar.
340 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
341 but a line break is allowed at that spot.
344 '( barsize-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )))
346 (define hairpin-interface
351 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
354 '( grow-direction thickness height padding )
357 (define arpeggio-interface
360 "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
365 (define note-collision-interface
367 'note-collision-interface
368 "An object that handles collisions between notes with different
369 stem directions and horizontal shifts. Most of the interesting
370 properties are to be set in @ref{note-column-interface}"
371 '(merge-differently-dotted note-width)
375 (define custos-interface
378 "A custos is a staff context symbol that appears at the end of a
379 staff line with monophonic musical contents (i.e. with a single
380 voice). It anticipates the pitch of the first note of the following
381 line and thus helps the player or singer to manage line breaks
382 during performance, thus enhancing readability of a score.
384 Custodes were frequently used in music notation until the 16th
385 century. There were different appearences for different notation
386 styles. Nowadays, they have survived only in special forms of
387 musical notation such as via the editio vaticana dating back to the
388 beginning of the 20th century.
390 [TODO: add to glossary]"
399 (define dot-interface
402 "The dots to go with a notehead/rest. A separate interface, since they
403 are a party in collision resolution.
404 #'direction is the Direction to handle staff-line collisions in."
405 '(direction dot-count)
409 (define font-interface
412 "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
413 '(font-style font-series font-shape font-family font-name
414 font-point-size font-relative-size)
418 (define text-interface
421 "A scheme markup text"
422 '(text align lookup raise kern magnify)))
424 (define dot-column-interface
426 'dot-column-interface
427 "Interface that groups dots so they form a column"
431 (define dynamic-interface
434 "Any kind of loudness sign"
439 (define finger-interface
442 "A fingering instruction"
446 (define separation-spanner-interface
448 'separation-spanner-interface
449 "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
452 (define text-script-interface
454 'text-script-interface
459 (define grace-alignment-interface
461 'grace-alignment-interface
462 "put grace notes in line"
468 (define hara-kiri-group-interface
470 'hara-kiri-group-interface
471 " As Vertical_group_spanner, but keep track of interesting items. If
472 we don't contain any interesting items after linebreaking, then
473 gracefully commit suicide. Objective: don't disgrace Lily by
474 typesetting empty lines in orchestral scores."
475 '( items-worth-living )
478 (define line-spanner-interface
480 'line-spanner-interface
481 "Generic line drawn between two objects, eg. for use with glissandi.
482 gap is measured in staff-spaces. "
484 '(gap dash-period dash-length line-thickness type )
487 (define lyric-hyphen-interface
489 'lyric-hyphen-interface
490 "A centred hyphen is a simple line between lyrics used to divide
491 syllables. The length of the hyphen line should stretch based on the
492 size of the gap between syllables."
494 '( thickness height minimum-length word-space )
497 (define key-signature-interface
499 'key-signature-interface
500 "A group of accidentals."
507 (define lyric-extender-interface
509 'lyric-extender-interface
510 "The extender is a simple line at the baseline of the lyric
511 that helps show the length of a melissima (tied/slurred note)."
519 (define lyric-syllable-interface
521 'lyric-syllable-interface
522 "a single piece of lyrics"
528 (define mark-interface
535 (define multi-measure-rest-interface
537 'multi-measure-rest-interface
538 "A rest that spans a whole number of measures. For typesetting the
539 numbers, fields from font-interface may be used.
541 padding is the space between number and rest. Measured in staffspace.
544 '( columns expand-limit minimum-width padding )
548 (define paper-column-interface
550 'paper-column-interface
553 '(column-space-strength before-musical-spacing-factor
554 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
555 dir-list shortest-playing-duration shortest-starter-duration
556 contains-grace extra-space stretch-distance ))
560 (define spaceable-element-interface
562 'spaceable-element-interface
563 "An grob (generally a Paper_column) that takes part in the
571 (define rest-collision-interface
573 'rest-collision-interface
574 "Move around ordinary rests (not multi-measure-rests) to avoid
582 (define script-interface
590 (define script-column-interface
592 'script-column-interface
593 "An interface that sorts scripts according to their @code{script-priority}"
597 (define spacing-spanner-interface
599 'spacing-spanner-interface
600 " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
601 The space taken by a note is determined by the formula
605 where TIME is the amount of time a note occupies. The value of C is
606 chosen such that the smallest space within a measure is
607 arithmetic_basicspace:
609 C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8))
611 The smallest space is the one following the shortest note in the
612 measure, or the space following a hypothetical 1/8 note. Typically
613 arithmetic_basicspace is set to a value so that the shortest note
614 takes about two noteheads of space (ie, is followed by a notehead of
618 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
620 @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
621 @{ assuming: SHORTEST <= 1/8 @}
623 = arithmetic_multiplier *
624 ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
626 = arithmetic_multiplier * arithmetic_basicspace
628 @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
630 = quartwidth * arithmetic_basicspace
634 arithmetic_basicspace = 2/1 = 2
637 If you want to space your music wider, use something like:
639 arithmetic_basicspace = 4.;
643 maximum-duration-for-spacing
644 arithmetic-basicspace
645 arithmetic-multiplier
649 (define staff-symbol-interface
651 'staff-symbol-interface
652 "This spanner draws the lines of a staff. The middle line is
659 (define stem-tremolo-interface
661 'stem-tremolo-interface
670 (define separation-item-interface
672 'separation-item-interface
673 "Item that computes widths to generate spacing rods.
675 Calc dimensions for the Separating_group_spanner; this has to be
676 an item to get dependencies correct. It can't be an grob_group
677 since these usually are in a different X_group
683 (define sustain-pedal-interface
685 'sustain-pedal-interface
689 (define system-start-delimiter-interface
691 'system-start-delimiter-interface
692 "#'style can be bar-line, bracket or brace"
693 '(collapse-height thickness arch-height arch-angle arch-thick
694 arch-width bracket-thick bracket-width glyph )))
696 (define text-spanner-interface
698 'text-spanner-interface
699 "generic text spanner"
710 (define tie-interface
713 "A tie connecting two noteheads.
714 direction = Forced direction for all ties"
729 (define tie-column-interface
731 'tie-column-interface
732 "that sets tie directions in a tied chord"
736 (define volta-bracket-interface
738 'volta-bracket-interface
739 "Volta bracket with number"
746 (define span-bar-interface