1 ;;;; define-grobs.scm --
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;;; distances are given in linethickness (thicknesses) and
9 ;;;; staffspace (distances)
11 ;;;; WARNING: the meta field should be the last one.
12 ;;;; WARNING: don't use anonymous functions for initialization.
14 ;; TODO: junk the meta field in favor of something more compact?
16 ;;; todo:: reorder sensibly.
18 (define-public all-grob-descriptions
23 (cautionary-style . parentheses)
25 (stencil . ,Accidental_interface::print)
27 . ,Accidental_interface::after_line_breaking)
29 (meta . ((class . Item)
30 (interfaces . (accidental-interface
35 (stencil . ,Accidental_interface::print)
36 (X-offset . ,(ly:make-simple-closure
38 ,(ly:make-simple-closure (list Self_alignment_interface::centered_on_x_parent))
39 ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self)))))
40 (self-alignment-X . ,CENTER)
42 (cautionary-style . smaller)
43 (Y-offset . ,Side_position_interface::y_aligned_side)
44 (cautionary-style . parentheses)
46 (staff-padding . 0.25)
49 (meta . ((class . Item)
50 (interfaces . (side-position-interface
53 accidental-suggestion-interface
54 self-alignment-interface
60 (positioning-done . ,Accidental_placement::calc_positioning_done)
61 (X-extent . ,Axis_group_interface::width)
63 ;; this is quite small, but it is very ugly to have
64 ;; accs closer to the previous note than to the next one.
65 (right-padding . 0.15)
66 (meta . ((class . Item)
67 (interfaces . (accidental-placement-interface))))))
71 (X-extent . ,Axis_group_interface::width)
72 (X-extent . ,Axis_group_interface::height)
75 (clef . (extra-space . 0.5))
76 (key-signature . (extra-space . 0.0))
77 (staff-bar . (extra-space . 0.0))
78 (time-signature . (extra-space . 0.0))
79 (first-note . (fixed-space . 0.0))))
81 (break-align-symbol . ambitus)
82 (break-visibility . ,begin-of-line-visible)
83 (meta . ((class . Item)
84 (interfaces . (axis-group-interface
85 break-aligned-interface
86 ambitus-interface))))))
91 (stencil . ,Ambitus::print)
95 (X-offset . ,Self_alignment_interface::centered_on_x_parent)
97 (meta . ((class . Item)
98 (interfaces . (ambitus-interface
99 staff-symbol-referencer-interface
103 (font-family . music)
105 (X-offset . ,Side_position_interface::x_aligned_side)
107 (cautionary-style . parentheses)
109 (stencil . ,Accidental_interface::print)
110 (after-line-breaking . ,Accidental_interface::after_line_breaking)
113 (meta . ((class . Item)
114 (interfaces . (item-interface
116 break-aligned-interface
117 side-position-interface
124 (stencil . ,Note_head::print)
125 (glyph-name . ,note-head::calc-glyph-name)
127 (Y-offset . ,Staff_symbol_referencer::callback)
128 (meta . ((class . Item)
129 (interfaces . (font-interface
132 staff-symbol-referencer-interface
133 rhythmic-head-interface
134 ledgered-interface))))))
139 (X-extent . ,Arpeggio::width)
140 (stencil . ,Arpeggio::print)
142 (Y-offset . ,Staff_symbol_referencer::callback)
143 (X-offset . ,Side_position_interface::x_aligned_side)
147 (staff-position . 0.0)
148 (meta . ((class . Item)
149 (interfaces . (arpeggio-interface
150 staff-symbol-referencer-interface
151 side-position-interface
156 (break-align-symbol . staff-bar)
159 (break-visibility . ,all-visible)
162 (stencil . ,Bar_line::print)
163 (glyph-name . ,bar-line::calc-glyph-name)
164 (bar-size . ,Bar_line::calc_bar_size)
167 (time-signature . (extra-space . 0.75))
168 (custos . (minimum-space . 2.0))
169 (clef . (minimum-space . 1.0))
170 (key-signature . (extra-space . 1.0))
171 (key-cancellation . (extra-space . 1.0))
172 (first-note . (fixed-space . 1.3))
173 (next-note . (semi-fixed-space . 1.3))
174 (right-edge . (extra-space . 0.0))))
177 ;; Ross. page 151 lists other values, we opt for a leaner look
180 ;; kern should scale with linethickness too.
183 (hair-thickness . 1.9)
184 (thick-thickness . 6.0)
185 (meta . ((class . Item)
186 (interfaces . (bar-line-interface
187 break-aligned-interface
192 (stencil . ,Text_interface::print)
194 (break-visibility . ,begin-of-line-visible)
197 (font-family . roman)
199 (Y-offset . ,Side_position_interface::y_aligned_side)
201 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
202 (self-alignment-X . 1)
206 (interfaces . (side-position-interface
208 self-alignment-interface
210 break-aligned-interface))))
216 (stencil . ,Text_interface::print)
218 (meta . ((class . Item)
219 (interfaces . (text-interface
220 rhythmic-grob-interface
221 bass-figure-interface
226 (stencil . ,Enclosing_bracket::print)
228 (edge-height . (0.2 . 0.2))
229 (meta . ((class . Item)
230 (interfaces . (enclosing-bracket-interface)) ))
232 (BassFigureContinuation
235 (stencil . ,Figured_bass_continuation::print)
237 (Y-offset . ,Figured_bass_continuation::center_on_figures)
238 (meta . ((class . Spanner)
239 (interfaces . (figured-bass-continuation-interface))
245 (Y-extent . ,Axis_group_interface::height)
247 (meta . ((class . Spanner)
248 (interfaces . (axis-group-interface
254 (threshold . (2 . 1000))
256 (positioning-done . ,Align_interface::calc_positioning_done)
257 (Y-extent . ,Axis_group_interface::height)
260 (meta . ((class . Spanner)
261 (interfaces . (align-interface
262 axis-group-interface))))))
266 ;; todo: clean this up a bit: the list is getting
269 (positions . ,(ly:make-simple-closure
270 (ly:make-simple-closure
271 (list chain-grob-member-functions
273 Beam::calc_least_squares_positions
275 Beam::shift_region_to_valid
279 ;; this is a hack to set stem lengths, if positions is set.
280 (quantized-positions . ,Beam::set_stem_lengths)
281 (concaveness . ,Beam::calc_concaveness)
282 (direction . ,Beam::calc_direction)
283 (shorten . ,Beam::calc_stem_shorten)
284 (beaming . ,Beam::calc_beaming)
285 (stencil . ,Beam::print)
287 ;; TODO: should be in SLT.
288 (thickness . 0.48) ; in staff-space
289 (neutral-direction . -1)
291 ;; Whe have some unreferenced problems here.
293 ;; If we shorten beamed stems less than normal stems (1 staffspace),
294 ;; or high order less than 8th beams, patterns like
295 ;; c''4 [c''8 c''] c''4 [c''16 c]
296 ;; are ugly (different stem lengths).
298 ;; But if we shorten 16th beams as much as 8th beams, a single
299 ;; forced 16th beam looks *very* short.
301 ;; We choose to shorten 8th beams the same as single stems,
302 ;; and high order beams less than 8th beams, so that all
303 ;; isolated shortened beams look nice and a bit shortened,
304 ;; sadly possibly breaking patterns with high order beams.
305 (beamed-stem-shorten . (1.0 0.5 0.25))
307 (auto-knee-gap . 5.5)
309 ;; only for debugging.
310 (font-family . roman)
311 (meta . ((class . Spanner)
312 (interfaces . (staff-symbol-referencer-interface
320 (positioning-done . ,Break_align_interface::calc_positioning_done)
321 (X-extent . ,Axis_group_interface::width)
323 (break-align-orders . ;; end of line
345 time-signature custos)
359 (meta . ((class . Item)
360 (interfaces . (break-alignment-interface
361 axis-group-interface))))))
367 (X-extent . ,Axis_group_interface::width)
369 (meta . ((class . Item)
370 (interfaces . (break-aligned-interface
371 axis-group-interface))))))
375 (break-align-symbol . breathing-sign)
378 (ambitus . (extra-space . 2.0))
379 (custos . (minimum-space . 1.0))
380 (key-signature . (minimum-space . 1.5))
381 (time-signature . (minimum-space . 1.5))
382 (staff-bar . (minimum-space . 1.5))
383 (clef . (minimum-space . 2.0))
384 (first-note . (fixed-space . 1.0)) ;huh?
385 (right-edge . (extra-space . 0.1))))
387 (stencil . ,Text_interface::print)
389 (text . ,(make-musicglyph-markup "scripts.rcomma"))
390 (Y-offset . ,Breathing_sign::offset_callback)
391 (break-visibility . ,begin-of-line-invisible)
392 (meta . ((class . Item)
393 (interfaces . (break-aligned-interface
394 breathing-sign-interface
401 (stencil . ,Clef::print)
402 (glyph-name . ,Clef::calc_glyph_name)
405 (font-family . music)
406 (break-align-symbol . clef)
407 (break-visibility . ,begin-of-line-visible)
408 (space-alist . ((ambitus . (extra-space . 2.0))
409 (staff-bar . (extra-space . 0.7))
410 (key-cancellation . (minimum-space . 3.5))
411 (key-signature . (minimum-space . 3.5))
412 (time-signature . (minimum-space . 4.2))
413 (first-note . (minimum-fixed-space . 5.0))
414 (next-note . (extra-space . 0.5))
415 (right-edge . (extra-space . 0.5))))
416 (Y-offset . ,Staff_symbol_referencer::callback)
417 (meta . ((class . Item)
418 (interfaces . (clef-interface
419 staff-symbol-referencer-interface
421 break-aligned-interface))))))
423 (ClusterSpannerBeacon
426 (Y-extent . ,Cluster_beacon::height)
428 (meta . ((class . Item)
429 (interfaces . (cluster-beacon-interface))))))
434 (springs-and-rods . ,Spanner::set_spacing_rods)
435 (stencil . ,Cluster::print)
438 (minimum-length . 0.0)
441 (meta . ((class . Spanner)
442 (interfaces . (cluster-interface))))))
447 (stencil . ,Text_interface::print)
448 (after-line-breaking . ,Chord_name::after_line_breaking)
453 (meta . ((class . Item)
454 (interfaces . (font-interface
455 rhythmic-grob-interface
463 (stencil . ,Text_interface::print)
465 (no-spacing-rods . #t)
466 (Y-offset . ,Side_position_interface::y_aligned_side)
467 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
470 (staff-padding . 0.5)
471 (script-priority . 200)
472 ;; todo: add X self alignment?
476 (meta . ((class . Item)
477 (interfaces . (text-script-interface
479 side-position-interface
484 (break-align-symbol . custos)
487 (stencil . ,Custos::print)
489 (break-visibility . ,end-of-line-visible)
491 (neutral-direction . -1)
492 (Y-offset . ,Staff_symbol_referencer::callback)
494 (first-note . (minimum-fixed-space . 0.0))
495 (right-edge . (extra-space . 0.1))))
496 (meta . ((class . Item)
499 staff-symbol-referencer-interface
501 break-aligned-interface))))))
508 (positioning-done . ,Dot_column::calc_positioning_done)
509 (X-extent . ,Axis_group_interface::width)
511 (X-offset . ,Dot_column::side_position)
512 (meta . ((class . Item)
513 (interfaces . (dot-column-interface
514 axis-group-interface))))))
519 (stencil . ,Dots::print)
522 (meta . ((class . Item)
523 (interfaces . (font-interface
524 staff-symbol-referencer-interface
529 (stencil . ,Percent_repeat_item_interface::double_percent)
532 (font-encoding . fetaMusic)
535 (break-align-symbol . staff-bar)
536 (break-visibility . ,begin-of-line-invisible)
537 (meta . ((class . Item)
538 (interfaces . (font-interface
539 break-aligned-interface
540 percent-repeat-interface))))))
542 (DoublePercentRepeatCounter
545 (stencil . ,Text_interface::print)
546 (X-offset . ,(ly:make-simple-closure `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::centered_on_y_parent))
547 ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self)))))
548 (Y-offset . ,Side_position_interface::y_aligned_side)
549 (font-encoding . fetaNumber)
550 (self-alignment-X . 0)
554 (staff-padding . 0.25)
556 (meta . ((class . Item)
557 (interfaces . (side-position-interface
558 self-alignment-interface
559 percent-repeat-interface
565 (Y-offset . ,Side_position_interface::y_aligned_side)
566 (staff-padding . 0.1)
568 (avoid-slur . outside)
570 (minimum-space . 1.2)
574 (Y-extent . ,Axis_group_interface::height)
575 (X-extent . ,Axis_group_interface::width)
578 (meta . ((class . Spanner)
579 (interfaces . (axis-group-interface
581 dynamic-line-spanner-interface
582 side-position-interface))))))
589 (stencil . ,Text_interface::print)
590 (direction . ,Script_interface::calc_direction)
592 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
593 (self-alignment-X . 0)
594 (Y-offset . ,Self_alignment_interface::y_aligned_on_self)
595 (self-alignment-Y . 0)
597 (font-encoding . fetaDynamic)
598 (font-shape . italic)
599 (no-spacing-rods . #t)
600 (script-priority . 100)
601 (meta . ((class . Item)
602 (interfaces . (font-interface
604 self-alignment-interface
606 script-interface))))))
611 (stencil . ,Dynamic_text_spanner::print)
613 ;; rather ugh with NCSB
614 ;; (font-series . bold)
615 (font-shape . italic)
616 (style . dashed-line)
618 ;; need to blend with dynamic texts.
620 (bound-padding . 0.75)
621 (dash-fraction . 0.2)
623 (meta . ((class . Spanner)
624 (interfaces . (font-interface
627 dynamic-text-spanner-interface
628 spanner-interface))))))
633 ;; sync with TextScript (?)
636 (avoid-slur . around)
638 (staff-padding . 0.5)
639 (self-alignment-X . 0)
640 (self-alignment-Y . 0)
641 (script-priority . 100)
643 (stencil . ,Text_interface::print)
644 (direction . ,Script_interface::calc_direction)
646 (font-encoding . fetaNumber)
647 (font-size . -5) ; don't overlap when next to heads.
648 (meta . ((class . Item)
649 (interfaces . (finger-interface
651 text-script-interface
653 side-position-interface
654 self-alignment-interface
660 (zigzag-width . 0.75)
665 (stencil . ,Line_spanner::print)
666 (after-line-breaking . ,Line_spanner::after_line_breaking)
669 (meta . ((class . Spanner)
670 (interfaces . (line-interface
671 line-spanner-interface))))))
677 (meta . ((class . Item)
678 (interfaces . (grid-point-interface))))))
683 (X-extent . ,Grid_line_interface::width)
684 (stencil . ,Grid_line_interface::print)
686 (self-alignment-X . ,CENTER)
687 (X-offset . ,(ly:make-simple-closure
688 `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::centered_on_x_parent))
689 ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self)))))
691 (meta . ((class . Item)
692 (interfaces . (self-alignment-interface
693 grid-line-interface))))))
699 (stencil . ,Hairpin::print)
700 (springs-and-rods . ,Spanner::set_spacing_rods)
701 (after-line-breaking . ,Hairpin::after_line_breaking)
705 (minimum-length . 2.0)
706 (bound-padding . 1.0)
707 (self-alignment-Y . 0)
708 (Y-offset . ,Self_alignment_interface::y_aligned_on_self)
709 (meta . ((class . Spanner)
710 (interfaces . (hairpin-interface
712 self-alignment-interface
714 spanner-interface))))))
719 (stencil . ,Horizontal_bracket::print)
720 (Y-offset . ,Side_position_interface::y_aligned_side)
722 (staff-padding . 0.2)
725 (bracket-flare . (0.5 . 0.5))
726 (meta . ((class . Spanner)
727 (interfaces . (horizontal-bracket-interface
728 side-position-interface
730 spanner-interface))))))
734 (Y-offset . ,(ly:make-simple-closure `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::y_aligned_on_self))
735 ,(ly:make-simple-closure (list Side_position_interface::y_aligned_on_support_refpoints)))))
737 ;; This direction is for aligned_on_support_refpoints
741 (left-edge . (extra-space . 1.0))))
743 (self-alignment-Y . 0)
744 (stencil . ,Text_interface::print)
745 (break-align-symbol . instrument-name)
746 (break-visibility . ,begin-of-line-visible)
749 (meta . ((class . Item)
750 (interfaces . (font-interface
751 self-alignment-interface
752 side-position-interface
754 break-aligned-interface))))))
759 (stencil . ,Key_signature_interface::print)
762 (time-signature . (extra-space . 1.25))
763 (staff-bar . (extra-space . 0.6))
764 (key-signature . (extra-space . 0.5))
765 (right-edge . (extra-space . 0.5))
766 (first-note . (fixed-space . 2.5))))
767 (Y-offset . ,Staff_symbol_referencer::callback)
768 (break-align-symbol . key-cancellation)
769 (break-visibility . ,begin-of-line-invisible)
772 (meta . ((class . Item)
773 (interfaces . (key-signature-interface
775 break-aligned-interface))))))
779 (stencil . ,Key_signature_interface::print)
782 (time-signature . (extra-space . 1.15))
783 (staff-bar . (extra-space . 1.1))
784 (right-edge . (extra-space . 0.5))
785 (first-note . (fixed-space . 2.5))))
786 (Y-offset . ,Staff_symbol_referencer::callback)
787 (break-align-symbol . key-signature)
788 (break-visibility . ,begin-of-line-visible)
791 (meta . ((class . Item)
792 (interfaces . (key-signature-interface
794 break-aligned-interface))))))
798 (stencil . ,Tie::print)
799 (control-points . ,Laissez_vibrer_tie::calc_control_points)
800 (direction . ,Laissez_vibrer_tie::calc_direction)
802 (details . ((ratio . 0.333)
803 (height-limit . 1.0)))
805 (meta . ((class . Item)
806 (interfaces . (laissez-vibrer-tie-interface))
810 (LaissezVibrerTieColumn
815 (positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done)
817 (meta . ((class . Item)
818 (interfaces . (laissez-vibrer-tie-column-interface))
825 (springs-and-rods . ,Ledger_line_spanner::set_spacing_rods)
827 (stencil . ,Ledger_line_spanner::print)
831 (minimum-length-fraction . 0.25)
832 (length-fraction . 0.25)
834 (meta . ((class . Spanner)
835 (interfaces . (ledger-line-interface))))))
839 (break-align-symbol . left-edge)
842 (break-visibility . ,center-invisible)
844 (custos . (extra-space . 0.0))
845 (ambitus . (extra-space . 2.0))
846 (time-signature . (extra-space . 1.0))
847 (staff-bar . (extra-space . 0.0))
848 (breathing-sign . (minimum-space . 0.0))
849 (clef . (extra-space . 0.8))
850 (first-note . (fixed-space . 2.0))
851 (right-edge . (extra-space . 0.0))
852 (key-signature . (extra-space . 0.0))
853 (key-cancellation . (extra-space . 0.0))
855 (meta . ((class . Item)
856 (interfaces . (break-aligned-interface))))))
860 ;; ugh. A ligature bracket is totally different from
865 (edge-height . (0.7 . 0.7))
866 (shorten-pair . (-0.2 . -0.2))
868 (positions . ,Tuplet_bracket::calc_positions)
869 (stencil . ,Tuplet_bracket::print)
871 (meta . ((class . Spanner)
872 (interfaces . (tuplet-bracket-interface
881 (minimum-length . 0.3)
883 ; (springs-and-rods . ,Hyphen_spanner::set_spacing_rods)
885 (stencil . ,Hyphen_spanner::print)
888 (meta . ((class . Spanner)
889 (interfaces . (lyric-interface
890 lyric-hyphen-interface
891 spanner-interface))))))
896 (stencil . ,Lyric_extender::print)
898 (thickness . 0.8) ; linethickness
899 (minimum-length . 1.5)
901 (meta . ((class . Spanner)
902 (interfaces . (lyric-interface
903 lyric-extender-interface))))))
908 (stencil . ,Text_interface::print)
910 (X-offset . ,Self_alignment_interface::aligned_on_x_parent)
911 (self-alignment-X . 0)
913 (font-series . bold-narrow)
915 (meta . ((class . Item)
916 (interfaces . (rhythmic-grob-interface
917 lyric-syllable-interface
918 self-alignment-interface
926 (stencil . ,Mensural_ligature::print)
928 (meta . ((class . Spanner)
929 (interfaces . (mensural-ligature-interface
935 (stencil . ,Text_interface::print)
937 (Y-offset . ,Side_position_interface::y_aligned_side)
941 (meta . ((class . Item)
942 (interfaces . (text-interface
943 side-position-interface
945 metronome-mark-interface))))))
949 (Y-offset . ,Side_position_interface::y_aligned_side)
952 (stencil . ,Measure_grouping::print)
959 (meta . ((class . Spanner)
960 (interfaces . (side-position-interface
961 measure-grouping-interface))))))
966 (stencil . ,Multi_measure_rest::print)
968 (Y-offset . ,Staff_symbol_referencer::callback)
971 (thick-thickness . 6.6)
972 (hair-thickness . 2.0)
974 (meta . ((class . Spanner)
975 (interfaces . (multi-measure-rest-interface
976 multi-measure-interface
979 staff-symbol-referencer-interface))))))
982 (MultiMeasureRestNumber
984 (springs-and-rods . ,Multi_measure_rest::set_spacing_rods)
985 (stencil . ,Text_interface::print)
986 (X-offset . ,(ly:make-simple-closure
987 `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self))
988 ,(ly:make-simple-closure (list Self_alignment_interface::x_centered_on_y_parent)))))
989 (Y-offset . ,Side_position_interface::y_aligned_side)
992 (self-alignment-X . 0)
995 (staff-padding . 0.4)
996 (font-encoding . fetaNumber)
997 (meta . ((class . Spanner)
998 (interfaces . (side-position-interface
999 multi-measure-interface
1000 self-alignment-interface
1005 (MultiMeasureRestText
1007 (stencil . ,Text_interface::print)
1008 (X-offset . ,(ly:make-simple-closure
1009 `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::x_centered_on_y_parent))
1010 ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self)))))
1012 (Y-offset . ,Side_position_interface::y_aligned_side)
1013 (self-alignment-X . 0)
1016 (staff-padding . 0.25)
1017 (meta . ((class . Spanner)
1018 (interfaces . (side-position-interface
1019 multi-measure-interface
1020 self-alignment-interface
1022 text-interface))))))
1028 (X-extent . ,Axis_group_interface::width)
1029 (Y-extent . ,Axis_group_interface::height)
1030 (positioning-done . ,Note_collision_interface::calc_positioning_done)
1032 (meta . ((class . Item)
1033 (interfaces . (note-collision-interface
1034 axis-group-interface))))))
1039 (X-extent . ,Axis_group_interface::width)
1040 (Y-extent . ,Axis_group_interface::height)
1042 (meta . ((class . Item)
1043 (interfaces . (axis-group-interface
1044 note-column-interface))))))
1049 (stencil . ,Note_head::print)
1050 (stem-attachment . ,Note_head::calc_stem_attachment)
1051 (glyph-name . ,note-head::calc-glyph-name)
1052 (Y-offset . ,Staff_symbol_referencer::callback)
1053 (X-offset . ,Note_head::stem_x_shift)
1054 (meta . ((class . Item)
1055 (interfaces . (rhythmic-grob-interface
1056 rhythmic-head-interface
1060 staff-symbol-referencer-interface))))))
1064 (stem-spacing-correction . 0.5)
1065 (same-direction-correction . 0.25)
1066 ;; Changed this from 0.75.
1067 ;; If you ever change this back, please document! --hwn
1068 (knee-spacing-correction . 1.0)
1070 (meta . ((class . Item)
1071 (interfaces . (spacing-interface
1072 note-spacing-interface))))))
1077 (stencil . ,Text_interface::print)
1079 (meta . ((class . Item)
1080 (interfaces . (note-name-interface
1082 font-interface))))))
1086 (self-alignment-X . 0)
1087 (break-visibility . ,begin-of-line-visible)
1088 (X-offset . ,(ly:make-simple-closure
1089 `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self))
1090 ,(ly:make-simple-closure (list Self_alignment_interface::centered_on_x_parent)))))
1092 (Y-offset . ,Side_position_interface::y_aligned_side)
1094 (stencil . ,Text_interface::print)
1097 ;; no Y dimensions, because of lyrics under tenor clef.
1098 (Y-extent . (0 . 0))
1099 (font-shape . italic)
1101 (staff-padding . 0.2)
1103 (meta . ((class . Item)
1104 (interfaces . (text-interface
1105 self-alignment-interface
1106 side-position-interface
1107 font-interface))))))
1111 (Y-offset . ,Side_position_interface::y_aligned_side)
1113 (stencil . ,Ottava_bracket::print)
1115 (font-shape . italic)
1116 (shorten-pair . (0.0 . -0.6))
1117 (staff-padding . 1.0)
1119 (minimum-length . 1.0)
1120 (dash-fraction . 0.3)
1121 (edge-height . (0 . 1.2))
1123 (meta . ((class . Spanner)
1124 (interfaces . (ottava-bracket-interface
1125 horizontal-bracket-interface
1127 side-position-interface
1129 text-interface))))))
1135 (before-line-breaking . ,Paper_column::before_line_breaking)
1136 ;; (stencil . ,Paper_column::print)
1137 (X-extent . ,Axis_group_interface::width)
1141 ;; (font-size . -6) (font-name . "sans") (Y-extent . #f)
1142 (meta . ((class . Paper_column)
1143 (interfaces . (paper-column-interface
1144 axis-group-interface
1145 spaceable-grob-interface))))))
1148 . ((slur-details . ,default-slur-details)
1150 (control-points . ,Slur::calc_control_points)
1151 (direction . ,Slur::calc_direction)
1152 (springs-and-rods . ,Spanner::set_spacing_rods)
1153 (Y-extent . ,Slur::height)
1154 (stencil . ,Slur::print)
1158 (minimum-length . 1.5)
1159 (height-limit . 2.0)
1161 (meta . ((class . Spanner)
1162 (interfaces . (slur-interface))))))
1164 (NonMusicalPaperColumn
1168 (before-line-breaking . ,Paper_column::before_line_breaking)
1169 (X-extent . ,Axis_group_interface::width)
1170 ;; (stencil . ,Paper_column::print)
1174 ;; debugging stuff: print column number.
1175 ;; (font-size . -6) (font-name . "sans") (Y-extent . #f)
1177 (meta . ((class . Paper_column)
1178 (interfaces . (paper-column-interface
1179 axis-group-interface
1180 spaceable-grob-interface))))))
1185 (springs-and-rods . ,Multi_measure_rest::set_spacing_rods)
1186 (stencil . ,Multi_measure_rest::percent)
1190 (font-encoding . fetaMusic)
1191 (meta . ((class . Spanner)
1192 (interfaces . (multi-measure-rest-interface
1194 percent-repeat-interface))))))
1195 (PercentRepeatCounter
1197 (stencil . ,Text_interface::print)
1198 (X-offset . ,(ly:make-simple-closure
1199 `(,+ ,(ly:make-simple-closure (list Self_alignment_interface::x_centered_on_y_parent))
1200 ,(ly:make-simple-closure (list Self_alignment_interface::x_aligned_on_self)))))
1201 (Y-offset . ,Side_position_interface::y_aligned_side)
1202 (self-alignment-X . 0)
1205 (staff-padding . 0.25)
1207 (font-encoding . fetaNumber)
1208 (meta . ((class . Spanner)
1209 (interfaces . (side-position-interface
1210 self-alignment-interface
1211 percent-repeat-interface
1213 text-interface))))))
1215 ;; an example of a text spanner
1219 (stencil . ,Piano_pedal_bracket::print)
1222 (bound-padding . 1.0)
1224 (bracket-flare . (0.5 . 0.5))
1225 (edge-height . (1.0 . 1.0))
1226 (shorten-pair . (0.0 . 0.0))
1228 (meta . ((class . Spanner)
1229 (interfaces . (line-interface
1230 piano-pedal-interface
1231 piano-pedal-bracket-interface))))))
1236 (stencil . ,Text_interface::print)
1238 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
1239 (Y-offset . ,Side_position_interface::y_aligned_side)
1241 (after-line-breaking . ,shift-right-at-line-begin)
1243 (self-alignment-X . 0)
1248 (break-visibility . ,end-of-line-invisible)
1250 (meta . ((class . Item)
1251 (interfaces . (text-interface
1252 side-position-interface
1255 self-alignment-interface))))))
1261 (stencil . ,Percent_repeat_item_interface::beat_slash)
1265 (meta . ((class . Item)
1266 (interfaces . (percent-repeat-interface))))))
1270 (stencil . ,Rest::print)
1271 (X-extent . ,Rest::width)
1272 (Y-extent . ,Rest::height)
1273 (Y-offset . ,Rest::y_offset_callback)
1274 (minimum-distance . 0.25)
1275 (meta . ((class . Item)
1276 (interfaces . (font-interface
1277 rhythmic-head-interface
1278 rhythmic-grob-interface
1279 staff-symbol-referencer-interface
1280 rest-interface))))))
1284 (minimum-distance . 0.75)
1285 (positioning-done . ,Rest_collision::calc_positioning_done)
1287 (meta . ((class . Item)
1288 (interfaces . (rest-collision-interface))))))
1292 ;; don't set direction here: it breaks staccato.
1294 ;; This value is sensitive: if too large, staccato dots will move a
1297 (staff-padding . 0.25)
1298 ;; (script-priority . 0) priorities for scripts, see script.scm
1299 (X-offset . , Self_alignment_interface::centered_on_x_parent)
1302 (stencil . ,Script_interface::print)
1303 (direction . ,Script_interface::calc_direction)
1305 (font-encoding . fetaMusic)
1306 (meta . ((class . Item)
1307 (interfaces . (script-interface
1308 side-position-interface
1309 font-interface))))))
1314 (before-line-breaking . ,Script_column::before_line_breaking)
1316 (meta . ((class . Item)
1317 (interfaces . (script-column-interface))))))
1323 (meta . ((class . Item)
1324 (interfaces . (spacing-interface
1325 separation-item-interface))))))
1327 (SeparatingGroupSpanner
1330 (springs-and-rods . ,Separating_group_spanner::set_spacing_rods)
1332 (meta . ((class . Spanner)
1333 (interfaces . (only-prebreak-interface
1335 separation-spanner-interface))))))
1338 . ((slur-details . ,default-slur-details)
1340 (control-points . ,Slur::calc_control_points)
1341 (direction . ,Slur::calc_direction)
1342 (springs-and-rods . ,Spanner::set_spacing_rods)
1343 (Y-extent . ,Slur::height)
1344 (stencil . ,Slur::print)
1347 (minimum-length . 1.5)
1349 (height-limit . 2.0)
1351 (meta . ((class . Spanner)
1352 (interfaces . (slur-interface))))))
1357 (springs-and-rods . ,Spacing_spanner::set_springs)
1358 (average-spacing-wishes . #t)
1359 (grace-space-factor . 0.6)
1360 (shortest-duration-space . 2.0)
1361 (spacing-increment . 1.2)
1362 (base-shortest-duration . ,(ly:make-moment 3 16))
1363 (meta . ((class . Spanner)
1364 (interfaces . (spacing-interface
1365 spacing-spanner-interface))))))
1369 (break-align-symbol . staff-bar)
1374 (stencil . ,Span_bar::print)
1375 (bar-size . ,Span_bar::calc_bar_size)
1376 (X-extent . ,Span_bar::width)
1377 (glyph-name . ,Span_bar::calc_glyph_name)
1378 (before-line-breaking . ,Span_bar::before_line_breaking)
1383 ;; Ross. page 151 lists other values, we opt for a leaner look
1387 (hair-thickness . 1.6)
1388 (thick-thickness . 6.0)
1389 (meta . ((class . Item)
1390 (interfaces . (span-bar-interface
1392 bar-line-interface))))))
1396 (stencil . ,Text_interface::print)
1398 (font-series . bold)
1400 (X-offset . ,Side_position_interface::x_aligned_side)
1403 (meta . ((class . Item)
1404 (interfaces . (side-position-interface
1405 stanza-number-interface
1407 font-interface))))))
1412 (stencil . ,print-circled-text-callback)
1415 (staff-padding . 0.5)
1416 (self-alignment-X . 0)
1417 (self-alignment-Y . 0)
1418 (script-priority . 100)
1419 (font-encoding . fetaNumber)
1420 (font-size . -5) ; don't overlap when next to heads.
1421 (meta . ((class . Item)
1422 (interfaces . (string-number-interface
1424 text-script-interface
1426 side-position-interface
1427 self-alignment-interface
1428 item-interface))))))
1433 (stem-spacing-correction . 0.4)
1434 (meta . ((class . Item)
1435 (interfaces . (spacing-interface
1436 staff-spacing-interface))))))
1441 (stencil . ,Text_interface::print)
1444 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
1445 (no-spacing-rods . #t)
1446 (padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner
1447 (font-shape . italic)
1448 (self-alignment-X . 0)
1449 (meta . ((class . Item)
1450 (interfaces . (text-interface
1451 self-alignment-interface
1452 font-interface))))))
1454 (SostenutoPedalLineSpanner
1458 (X-extent . ,Axis_group_interface::height)
1460 (Y-offset . ,Side_position_interface::y_aligned_side)
1464 (minimum-space . 1.0)
1466 (meta . ((class . Spanner)
1467 (interfaces . (piano-pedal-interface
1468 axis-group-interface
1469 side-position-interface))))))
1474 (stencil . ,Staff_symbol::print)
1477 (ledger-line-thickness . (1.0 . 0.1))
1479 (meta . ((class . Spanner)
1480 (interfaces . (staff-symbol-interface))))))
1484 (direction . ,Stem::calc_direction)
1485 (stem-end-position . ,Stem::calc_stem_end_position)
1486 (stem-info . ,Stem::calc_stem_info)
1487 (positioning-done . ,Stem::calc_positioning_done)
1488 (stencil . ,Stem::print)
1489 (X-extent . ,Stem::width)
1490 (Y-extent . ,Stem::height)
1491 (length . ,Stem::calc_length)
1497 ;; 3.5 (or 3 measured from note head) is standard length
1498 ;; 32nd, 64th flagged stems should be longer
1499 (lengths . (3.5 3.5 3.5 4.5 5.0))
1501 ;; FIXME. 3.5 yields too long beams (according to Ross and
1502 ;; looking at Baerenreiter examples) for a number of common
1503 ;; boundary cases. Subtracting half a beam thickness fixes
1504 ;; this, but the bug may well be somewhere else.
1506 ;; FIXME this should come from 'lengths
1507 (beamed-lengths . (3.26 3.5 3.6))
1509 ;; The 'normal' minima
1510 (beamed-minimum-free-lengths . (1.83 1.5 1.25))
1511 ;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
1513 ;; The 'extreme case' minima
1514 (beamed-extreme-minimum-free-lengths . (2.0 1.25))
1516 ;; Stems in unnatural (forced) direction should be shortened by
1517 ;; one staff space, according to [Roush & Gourlay].
1518 ;; Flagged stems we shorten only half a staff space.
1519 (stem-shorten . (1.0 0.5))
1524 ;; default stem direction for note on middle line
1525 (neutral-direction . -1)
1527 ;; We use the normal minima as minimum for the ideal lengths,
1528 ;; and the extreme minima as abolute minimum length.
1530 (X-offset . ,Stem::offset_callback)
1531 (Y-offset . ,Staff_symbol_referencer::callback)
1532 (meta . ((class . Item)
1533 (interfaces . (stem-interface
1534 font-interface))))))
1538 (Y-extent . ,Stem_tremolo::height)
1539 (stencil . ,Stem_tremolo::print)
1541 (beam-width . 1.6) ; staff-space
1542 (beam-thickness . 0.48) ; staff-space
1543 (meta . ((class . Item)
1544 (interfaces . (stem-tremolo-interface))))))
1548 (no-spacing-rods . #t)
1549 (stencil . ,Sustain_pedal::print)
1550 (self-alignment-X . 0)
1552 (padding . 0.0) ;; padding relative to SustainPedalLineSpanner
1553 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
1554 (meta . ((class . Item)
1555 (interfaces . (piano-pedal-interface
1556 text-spanner-interface
1558 self-alignment-interface
1559 font-interface))))))
1561 (SustainPedalLineSpanner
1564 (X-extent . ,Axis_group_interface::height)
1565 (Y-offset . ,Side_position_interface::y_aligned_side)
1568 (staff-padding . 1.2)
1569 (minimum-space . 1.0)
1571 (meta . ((class . Spanner)
1572 (interfaces . (piano-pedal-interface
1573 axis-group-interface
1574 side-position-interface))))))
1579 (X-extent . ,Axis_group_interface::width)
1580 (Y-extent . ,Axis_group_interface::height)
1581 (meta . ((class . System)
1582 (interfaces . (system-interface
1583 axis-group-interface))))))
1585 (NestedSystemStartDelimiter
1587 (stencil . ,Nested_system_start_delimiter::print)
1588 (X-offset . ,Side_position_interface::x_aligned_side)
1590 (collapse-height . 1.0)
1592 (font-encoding . fetaBraces)
1594 (meta . ((class . Spanner)
1595 (interfaces . (system-start-delimiter-interface
1596 side-position-interface
1597 font-interface))))))
1603 (stencil . ,System_start_delimiter::print)
1604 (collapse-height . 5.0)
1605 (X-offset . ,Side_position_interface::x_aligned_side)
1607 (font-encoding . fetaBraces)
1609 (meta . ((class . Spanner)
1610 (interfaces . (system-start-delimiter-interface
1611 side-position-interface
1612 font-interface))))))
1618 (X-offset . ,Side_position_interface::x_aligned_side)
1620 (stencil . ,System_start_delimiter::print)
1622 (collapse-height . 5.0)
1624 (meta . ((class . Spanner)
1625 (interfaces . (font-interface
1626 side-position-interface
1627 system-start-delimiter-interface))))))
1633 (X-offset . ,Side_position_interface::x_aligned_side)
1637 (stencil . ,System_start_delimiter::print)
1638 (meta . ((class . Spanner)
1639 (interfaces . (side-position-interface
1640 system-start-delimiter-interface))))))
1646 (stencil . ,Text_interface::print)
1647 (Y-offset . ,Staff_symbol_referencer::callback)
1649 (stem-attachment . (1.0 . 1.35))
1650 (font-series . bold)
1651 (meta . ((class . Item)
1653 . (rhythmic-head-interface
1654 font-interface rhythmic-grob-interface
1656 staff-symbol-referencer-interface
1657 text-interface))))))
1661 (no-spacing-rods . #t)
1662 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
1665 ;; sync with Fingering ?
1667 (staff-padding . 0.5)
1669 (stencil . ,Text_interface::print)
1670 (direction . ,Script_interface::calc_direction)
1672 (avoid-slur . around)
1673 (slur-padding . 0.5)
1674 (script-priority . 200)
1675 ;; todo: add X self alignment?
1676 (meta . ((class . Item)
1677 (interfaces . (text-script-interface
1679 side-position-interface
1680 font-interface))))))
1684 (stencil . ,Text_spanner::print)
1685 (Y-offset . ,Side_position_interface::y_aligned_side)
1686 (font-shape . italic)
1687 (style . dashed-line)
1688 (staff-padding . 0.8)
1689 (dash-fraction . 0.2)
1693 (meta . ((class . Spanner)
1694 (interfaces . (text-spanner-interface
1695 side-position-interface
1696 font-interface))))))
1700 (control-points . ,Tie::calc_control_points)
1701 (direction . ,Tie::calc_direction)
1702 (stencil . ,Tie::print)
1703 (details . ((ratio . 0.333)
1704 (height-limit . 1.0)
1705 (between-length-limit . 1.0)))
1707 (meta . ((class . Spanner)
1708 (interfaces . (tie-interface))))
1713 (positioning-done . ,Tie_column::calc_positioning_done)
1714 (before-line-breaking . ,Tie_column::before_line_breaking)
1717 (meta . ((class . Spanner)
1718 (interfaces . (tie-column-interface))))))
1722 (stencil . ,Time_signature::print)
1723 (break-align-symbol . time-signature)
1724 (break-visibility . ,all-visible)
1726 (first-note . (fixed-space . 2.0))
1727 (right-edge . (extra-space . 0.5))
1728 (staff-bar . (minimum-space . 2.0))))
1731 (meta . ((class . Item)
1732 (interfaces . (time-signature-interface
1733 break-aligned-interface
1734 font-interface))))))
1738 (stencil . ,Dynamic_text_spanner::print)
1739 (edge-text . ,(cons (make-musicglyph-markup "scripts.trill")
1742 (staff-padding . 1.0)
1745 (Y-offset . ,Side_position_interface::y_aligned_side)
1747 (meta . ((class . Spanner)
1748 (interfaces . (text-spanner-interface
1749 side-position-interface
1750 font-interface))))))
1752 (TrillPitchAccidental
1753 . ((X-offset . ,Side_position_interface::x_aligned_side)
1758 (stencil . ,Accidental_interface::print)
1759 (meta . ((class . Item)
1760 (interfaces . (item-interface
1761 accidental-interface
1762 side-position-interface
1763 font-interface))))))
1766 . ((X-offset . ,Side_position_interface::x_aligned_side)
1769 (stencil . ,parenthesize-elements)
1770 (direction . ,RIGHT)
1773 (meta . ((class . Item)
1774 (interfaces . (side-position-interface
1776 rhythmic-head-interface
1778 accidental-interface
1779 axis-group-interface))))))
1783 (stencil . ,Note_head::print)
1785 (Y-offset . ,Staff_symbol_referencer::callback)
1787 (meta . ((class . Item)
1788 (interfaces . (item-interface
1789 rhythmic-head-interface
1791 pitched-trill-interface
1793 staff-symbol-referencer-interface))))))
1799 (edge-height . (0.7 . 0.7))
1800 (shorten-pair . (-0.2 . -0.2))
1801 (direction . ,Tuplet_bracket::calc_direction)
1802 (positions . ,Tuplet_bracket::calc_positions)
1803 (stencil . ,Tuplet_bracket::print)
1804 (font-shape . italic)
1806 (meta . ((class . Spanner)
1807 (interfaces . (text-interface
1809 tuplet-bracket-interface
1810 font-interface))))))
1814 (stencil . ,Text_interface::print)
1815 (font-shape . italic)
1816 (no-spacing-rods . #t)
1817 (self-alignment-X . 0)
1819 (padding . 0.0) ;; padding relative to UnaCordaPedalLineSpanner
1820 (X-offset . ,Self_alignment_interface::x_aligned_on_self)
1821 (meta . ((class . Item)
1822 (interfaces . (text-interface
1823 self-alignment-interface
1824 font-interface))))))
1826 (UnaCordaPedalLineSpanner
1829 (X-extent . ,Axis_group_interface::height)
1830 (Y-offset . ,Side_position_interface::y_aligned_side)
1833 (staff-padding . 1.2)
1834 (minimum-space . 1.0)
1836 (meta . ((class . Spanner)
1837 (interfaces . (piano-pedal-interface
1838 axis-group-interface
1839 side-position-interface))))))
1845 (stencil . ,Vaticana_ligature::print)
1846 (meta . ((class . Spanner)
1847 (interfaces . (vaticana-ligature-interface
1848 font-interface))))))
1853 (positioning-done . ,Align_interface::calc_positioning_done)
1854 (after-line-breaking . ,Align_interface::stretch_after_break)
1855 (Y-extent . ,Axis_group_interface::height)
1856 (X-extent . ,Axis_group_interface::width)
1858 (meta . ((class . Spanner)
1859 (interfaces . (align-interface
1860 axis-group-interface))))))
1864 (Y-offset . ,Hara_kiri_group_spanner::force_hara_kiri_callback)
1865 (Y-extent . ,Hara_kiri_group_spanner::y_extent)
1866 (X-extent . ,Axis_group_interface::width)
1867 (meta . ((class . Spanner)
1868 (interfaces . (axis-group-interface
1869 hara-kiri-group-interface
1870 vertically-spaceable-interface))))))
1875 (Y-offset . ,Side_position_interface::y_aligned_on_support_refpoints)
1877 (space-alist . ((left-edge . (extra-space . 1.0))))
1878 (break-align-symbol . instrument-name)
1879 (stencil . ,Text_interface::print)
1880 (break-align-symbol . clef)
1881 (break-visibility . ,begin-of-line-visible)
1884 (meta . ((class . Item)
1885 (interfaces . (font-interface
1886 self-alignment-interface
1887 side-position-interface
1889 break-aligned-interface))))))
1893 (stencil . ,Volta_bracket_interface::print)
1894 (after-line-breaking . ,Volta_bracket_interface::after_line_breaking)
1897 (font-encoding . fetaNumber)
1898 (Y-offset . ,Side_position_interface::y_aligned_side)
1900 (thickness . 1.6) ;; linethickness
1901 (edge-height . (2.0 . 2.0)) ;; staffspace;
1904 (meta . ((class . Spanner)
1905 (interfaces . (volta-bracket-interface
1906 horizontal-bracket-interface
1909 side-position-interface
1921 (stencil . ,Line_spanner::print)
1922 (after-line-breaking . ,Line_spanner::after_line_breaking)
1923 (meta . ((class . Spanner)
1924 (interfaces . (line-spanner-interface
1930 (define (completize-grob-entry x)
1931 "Transplant assoc key into 'name entry of 'meta of X. Set interfaces for Item, Spanner etc.
1933 ;; (display (car x))
1935 (let* ((name-sym (car x))
1936 (grob-entry (cdr x))
1937 (meta-entry (cdr (assoc 'meta grob-entry)))
1938 (class (cdr (assoc 'class meta-entry)))
1940 (cdr (assoc 'interfaces meta-entry))))
1944 (set! ifaces-entry (cons 'item-interface ifaces-entry)))
1945 ((eq? 'Spanner class)
1946 (set! ifaces-entry (cons 'spanner-interface ifaces-entry)))
1947 ((eq? 'Paper_column class)
1948 (set! ifaces-entry (cons 'item-interface
1949 (cons 'paper-column-interface ifaces-entry))))
1950 ((eq? 'System class)
1951 (set! ifaces-entry (cons 'system-interface
1952 (cons 'spanner-interface ifaces-entry))))
1954 (ly:warning "Unknown class ~a" class)))
1955 (set! ifaces-entry (cons 'grob-interface ifaces-entry))
1957 (set! meta-entry (assoc-set! meta-entry 'name name-sym))
1958 (set! meta-entry (assoc-set! meta-entry 'interfaces
1960 (set! grob-entry (assoc-set! grob-entry 'meta meta-entry))
1961 (cons name-sym grob-entry)))
1963 (set! all-grob-descriptions (map completize-grob-entry all-grob-descriptions))
1965 ;; (display (map pair? all-grob-descriptions))
1967 ;; make sure that \property Foo.Bar =\turnOff doesn't complain
1970 ;; (display (car x)) (newline)
1972 (set-object-property! (car x) 'translation-type? list?)
1973 (set-object-property! (car x) 'is-grob? #t))
1974 all-grob-descriptions)
1976 (set! all-grob-descriptions (sort all-grob-descriptions alist<?))