]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
release: 1.5.41
[lilypond.git] / scm / interface-description.scm
1 ;;;; interface-description.scm -- part of generated backend documentation
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 1998--2001  Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
7
8
9 ; should include default value?
10
11
12 ;;; FIXME: naming.
13 ;;; Score elements are called `objects' now and then, which gets
14 ;;; rather confusing, we now have `elements', `items', `spanners'
15 ;;; and `objects'.
16
17
18 ;;; TODO: this should be done through C++ macros, in order to have
19 ;;; tighter coupling between the C++ and its doco.
20
21 (define all-interfaces '())
22
23 (define (lily-interface symbol description props)
24   (set! all-interfaces (acons symbol (list symbol
25                                            description
26                                            props) all-interfaces)
27         )
28   )
29
30 (define (grob-description . interfaces)
31   (let* ((ifs (cons grob-interface interfaces))
32          (props (map caddr ifs))
33                                         ;        (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
34                                         ;                                       (apply append props)))
35          (syms (map car ifs))
36          )
37     (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 grob itself?
42                                         ;         (cons 'properties prop-typep-pairs)
43           )))
44
45
46 (lily-interface
47  'grob-interface
48  "All grobs support this"
49  '(
50    X-offset-callbacks 
51    Y-offset-callbacks 
52    X-extent-callback 
53    Y-extent-callback
54    molecule-callback
55    font-relative-size 
56    extra-offset 
57    interfaces  
58    dependencies 
59    no-spacing-rods 
60    extra-extent-X 
61    extra-extent-Y 
62    minimum-extent-X 
63    minimum-extent-Y 
64    origin 
65    transparent 
66    ))
67
68
69 (lily-interface
70  'beam-interface
71  "A beam.
72
73 #'thickness= weight of beams, in staffspace
74   "
75  '(auto-knee-gap
76    staff-position
77    height
78    flag-width-function 
79    damping 
80    neutral-direction 
81    thickness 
82    space-function 
83    beamed-stem-shorten 
84    height-quants 
85    vertical-position-quant-function 
86    damping 
87    outer-stem-length-limit 
88    slope-limit 
89    auto-knee-gap
90    )
91  )
92
93 (lily-interface
94  'staff-spacing-interface
95  ""
96  '(
97    ))
98
99 (lily-interface
100  'note-spacing-interface
101  ""
102  '(
103    ))
104
105 (lily-interface
106  'clef-interface
107  "A clef sign"
108  '(
109    non-default 
110    full-size-change 
111    glyph 
112    ))
113
114
115
116 (lily-interface
117  'axis-group-interface
118  "a group of coupled grobs"
119  '(
120    axes 
121    ))
122
123
124 (lily-interface
125  'note-column-interface
126  "Stem and noteheads combined"
127  '(
128    note-heads
129    horizontal-shift 
130    force-hshift 
131    ))
132
133
134 (lily-interface
135  'stem-interface
136  "A stem"
137  '(
138    thickness 
139    beamed-lengths 
140    beamed-minimum-lengths 
141    lengths 
142    beam 
143    stem-shorten 
144    duration-log 
145    beaming 
146    neutral-direction 
147    stem-end-position 
148    support-head 
149    heads 
150    direction 
151    length 
152    style 
153    flag-style 
154    dir-forced 
155    ))
156
157
158
159 (lily-interface
160  'slur-interface
161  "A slur"
162  '(
163    de-uglify-parameters 
164    details 
165    attachment 
166    direction 
167    attachment-offset 
168    beautiful 
169    y-free 
170    control-points 
171    extremity-rules  
172    extremity-offset-alist 
173    thickness 
174    dashed 
175
176    )
177  )
178
179
180
181 (lily-interface
182  'side-position-interface
183  "Position a victim object (this one) next to other objects (the support).
184 #'direction = where to put the victim object (left or right?)
185 "
186  '(
187    side-support-elements 
188    direction-source 
189    direction 
190    side-relative-direction 
191    minimum-space 
192    padding 
193    self-alignment-X 
194    self-alignment-Y 
195    
196    )
197  )
198
199
200 (lily-interface
201  'accidentals-interface
202  "Accidentals"
203  '(accidentals
204    left-padding 
205    right-padding
206    paren-cautionaries
207    cautionary-size
208    ))
209
210
211
212 (lily-interface
213  'line-of-score-interface
214  "Super grob, parent of all:
215
216 The columns of a score that form one line.  The toplevel grob.  Any
217 grob has a Line_of_score as both X and Y reference point. The
218 Paper_score contains one grob of this type. Control enters the
219 Grob dependency calculation from this single Line_of_score
220 object."
221  '(
222    between-system-string 
223    spacing-procedure 
224    before-line-breaking-callback
225    after-line-breaking-callback 
226    all-elements 
227    columns 
228    ))
229
230
231 (lily-interface
232  'note-head-interface
233  "Note head"
234  '( style stem-attachment-function ))
235
236
237 (lily-interface
238  'note-name-interface
239  "Note name"
240  '( style ))
241
242
243
244 (lily-interface
245  'rhythmic-head-interface
246  "Note head or rest"
247  '(
248    dot 
249    stem 
250    duration-log 
251    ))
252
253
254 (lily-interface
255  'rest-interface
256  "a rest"
257  '(style ))
258
259
260 (lily-interface
261  'tuplet-bracket-interface
262  "A bracket with a number in the middle, used for tuplets." 
263  '(
264    columns 
265    number-gap 
266    delta-y 
267    tuplet-bracket-visibility 
268    tuplet-number-visibility 
269    thick 
270    direction
271    ))
272
273
274 (lily-interface
275  'align-interface
276  " Order grobs top to bottom/left to right/right to left etc."
277  '(
278    stacking-dir  
279    align-dir  
280    threshold  
281    alignment-done  
282    center-element 
283    elements  
284    axes  
285    ))
286
287
288 (lily-interface
289  'aligned-interface
290  "read by align-interface"
291  '(
292    minimum-space 
293    extra-space 
294    ))
295
296
297 (lily-interface
298  'break-aligned-interface
299  "Items that are aligned in prefatory matter"
300  '(
301    break-align-symbol
302    space-alist
303    visibility-lambda 
304    breakable 
305    ))
306
307
308 (lily-interface
309  'chord-name-interface
310  "generate a chord name"
311  '( pitches inversion bass))
312
313
314 (lily-interface
315  'time-signature-interface
316  "A time signature, in different styles.
317   The following values for 'style are are recognized:
318
319     @table @samp
320       @item @code{C}
321         4/4 and 2/2 are typeset as C and struck C, respectively.  All
322         other time signatures are written with two digits.
323
324       @item @code{old}
325         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
326         typeset with old-style mensuration marks.  All other time
327         signatures are written with two digits.
328
329       @item @code{1xxx}
330         All time signatures are typeset with a single
331         digit, e.g. 3/2 is written as 3. (Any symbol starting
332         with the digit @code{1} will do.)
333
334       @item @code{C}@var{M}@code{/}@var{N}, 
335 @code{old}@var{M}@code{/}@var{N} or
336       @code{old6/8alt}
337         Tells LilyPond to use a specific symbol as time signature, 
338         regardless of the actual time signature.
339     @end table
340
341 See also the test-file @file{input/test/time.ly}.
342 "
343  '(fraction style ))
344
345
346 (lily-interface
347  'bar-line-interface
348  "Bar line.
349
350 This is a request to print a special bar symbol. It replaces the 
351 regular bar symbol with a special
352 symbol.  The argument @var{bartype} is a string which specifies the
353 kind of bar to print.  Options are @code{\":|\"}
354 @cindex \"|A@@@code{:|}
355 ,
356 @code{\"|:\"}
357 @cindex \"|B@@@code{|:}
358 , @code{\":|:\"}
359 @cindex \"|C@@@code{:|:}
360 ,
361 @code{\"||\"}
362 @cindex \"|D@@@code{||}
363 , @code{\"|.\"}
364 @cindex \"|E@@@code{|.}
365 ,
366 @code{\".|\"}
367 @cindex \"|F@@@code{.|}
368 , and @code{\".|.\"}
369 @cindex \"|G@@@code{.|.}
370
371
372 These produce, respectively, a right repeat, a left repeat, a double
373 repeat, a double bar, a start bar, an end bar, and a thick double bar.
374 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
375 but a line break is allowed at that spot.
376
377 "
378  '(bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function ))
379
380
381 (lily-interface
382  'hairpin-interface
383  "hairpin crescendo.
384
385 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
386
387 "
388  '( grow-direction thickness height padding
389                    ))
390
391
392 (lily-interface
393  'arpeggio-interface
394  "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
395  '(stems arpeggio-direction))
396
397
398
399 (lily-interface
400  'note-collision-interface
401  "An object that handles collisions between notes with different
402 stem directions and horizontal shifts. Most of the interesting
403 properties are to be set in @ref{note-column-interface}"
404  '(merge-differently-dotted note-width))
405
406
407
408 (lily-interface
409  'custos-interface
410  "A custos is a staff context symbol that appears at the end of a
411   staff line with monophonic musical contents (i.e. with a single
412   voice).  It anticipates the pitch of the first note of the following
413   line and thus helps the player or singer to manage line breaks
414   during performance, thus enhancing readability of a score.
415
416   Custodes were frequently used in music notation until the 16th
417   century.  There were different appearences for different notation
418   styles.  Nowadays, they have survived only in special forms of
419   musical notation such as via the editio vaticana dating back to the
420   beginning of the 20th century.
421
422 [TODO: add to glossary]"
423  
424    '(style))
425
426
427
428
429
430
431   (lily-interface
432    'dots-interface
433    "The dots to go with a notehead/rest.  A separate interface, since they
434 are a party in collision resolution.
435 #'direction is the Direction to handle staff-line collisions in."
436    '(direction dot-count))
437
438
439   (lily-interface
440    'font-interface
441    "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
442    '(font-style font-series font-shape font-family font-name
443 font-design-size font-relative-size)
444    )
445
446
447
448   (lily-interface
449    'text-interface
450    "A scheme markup text"
451    '(text align baseline-skip lookup raise kern magnify))
452
453
454   (lily-interface
455    'dot-column-interface
456    "Interface that groups dots so they form a column"
457    '( )
458    )
459
460
461   (lily-interface
462    'dynamic-interface
463    "Any kind of loudness sign"
464    '()
465     )
466
467
468
469   (lily-interface
470    'finger-interface
471    "A fingering instruction"
472    '()
473     )
474
475
476   (lily-interface
477    'separation-spanner-interface
478    "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
479    '()
480   )
481
482   (lily-interface
483    'text-script-interface
484    "Any text script"
485    '()
486    )
487
488
489   (lily-interface
490    'grace-alignment-interface
491    "put grace notes in line"
492    '(
493     horizontal-space 
494     )
495    )
496
497
498   (lily-interface
499    'hara-kiri-group-interface
500    "  As Vertical_group_spanner, but keep track of interesting items.  If
501 we don't contain any interesting items after linebreaking, then
502 gracefully commit suicide.  Objective: don't disgrace Lily by
503 typesetting empty lines in orchestral scores."
504    '( items-worth-living )
505 )
506
507
508   (lily-interface
509    'line-spanner-interface
510    "Generic line drawn between two objects, eg. for use with glissandi.
511 gap is measured in staff-spaces.   "
512
513    '(gap dash-period dash-length line-thickness type 
514    ))
515
516
517   (lily-interface
518    'lyric-hyphen-interface
519    "A centred hyphen is a simple line between lyrics used to divide
520 syllables.   The length of the hyphen line should stretch based on the
521 size of the gap between syllables."
522
523    '( thickness height minimum-length word-space 
524    ))
525
526
527   (lily-interface
528    'key-signature-interface
529    "A group of  accidentals."
530    '(
531     c0-position  
532     old-accidentals  
533     new-accidentals  
534     ))
535
536
537   (lily-interface
538    'lyric-extender-interface
539    "The extender is a simple line at the baseline of the lyric
540 that helps show the length of a melissima (tied/slurred note)."
541    '(
542     word-space  
543     height  
544     right-trim-amount  
545     ))
546
547
548
549   (lily-interface
550    'lyric-syllable-interface
551    "a single piece of lyrics"
552    '(
553     word-space
554     alignment
555     ignore-length-mismatch
556     begin-alignment
557     end-alignment
558     ))
559
560
561
562   (lily-interface
563    'mark-interface
564    "a rehearsal mark"
565    '(
566     ))
567
568
569   (lily-interface
570    'multi-measure-rest-interface
571    "A rest that spans a whole number of measures.  For typesetting the
572 numbers, fields from font-interface may be used.
573
574 padding is the space between number and rest. Measured in staffspace.
575
576 "
577    '(    columns expand-limit minimum-width padding))
578
579
580   (lily-interface
581    'paper-column-interface
582    ""
583
584    '(column-space-strength before-musical-spacing-factor
585 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
586 dir-list shortest-playing-duration shortest-starter-duration
587 contains-grace extra-space stretch-distance ))
588
589
590   (lily-interface
591    'piano-pedal-interface
592    ""
593    '(pedal-type
594     ))
595
596
597   (lily-interface
598    'porrectus-interface
599    "A porrectus ligature, joining two note heads into a single grob."
600    '(
601     ))
602
603
604   (lily-interface
605    'spaceable-element-interface
606    "An grob (generally a Paper_column) that takes part in the
607 spacing problem. "
608    '(penalty 
609      minimum-distances 
610      ideal-distances  
611      dir-list 
612      ))
613
614
615   (lily-interface
616    'rest-collision-interface
617    "Move around ordinary rests (not multi-measure-rests) to avoid
618 conflicts."
619    '(
620     maximum-rest-count 
621     minimum-distance 
622     elements 
623     ))
624
625
626   (lily-interface
627    'script-interface
628    ""
629    '(
630     script-priority 
631     ))
632
633
634   (lily-interface
635    'script-column-interface
636    "An interface that sorts scripts according to their @code{script-priority}"
637    '( ))
638
639
640
641   (lily-interface
642    'spacing-spanner-interface
643    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
644 The space taken by a note is determined by the formula 
645
646
647
648 where TIME is the amount of time a note occupies.  The value of C is
649 chosen such that the smallest space within a measure is
650 arithmetic_basicspace:
651
652 C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
653
654 The smallest space is the one following the shortest note in the
655 measure, or the space following a hypothetical 1/8 note.  Typically
656 arithmetic_basicspace is set to a value so that the shortest note
657 takes about two noteheads of space (ie, is followed by a notehead of
658 space):
659
660 @example
661 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
662
663 @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
664 @{ assuming: SHORTEST <= 1/8 @}
665
666 = arithmetic_multiplier *
667 ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
668
669 = arithmetic_multiplier * arithmetic_basicspace
670
671 @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
672
673 = quartwidth * arithmetic_basicspace
674
675 =>             
676
677 arithmetic_basicspace = 2/1 = 2
678
679
680 If you want to space your music wider, use something like:
681
682 arithmetic_basicspace = 4.;
683
684 @end example"
685    '(
686 spacing-increment
687 shortest-duration-space
688     
689     ))
690
691
692   (lily-interface
693    'staff-symbol-referencer-interface
694    
695    "Object whose Y position is meaning with reference to a staff
696 symbol. Objects that have this interface should include
697 Staff_symbol_referencer::callback in their Y-offset-callback.
698 "
699    '(
700     staff-symbol
701     staff-position
702     ))
703   
704
705   (lily-interface
706    'staff-symbol-interface
707    "This spanner draws the lines of a staff.  The middle line is
708 position 0."
709    '(
710     staff-space 
711     line-count
712     invisible-staff
713     ))
714
715
716   (lily-interface
717    'stem-tremolo-interface
718    ""
719    '( stem beam-width beam-thickness beam-space-function 
720     ))
721
722
723   (lily-interface
724    'separation-item-interface
725    "Item that computes widths to generate spacing rods.
726
727 Calc dimensions for the Separating_group_spanner; this has to be
728 an item to get dependencies correct.  It can't be an grob_group
729 since these usually are in a different X_group
730 "
731    '(
732     elements 
733      ))
734
735
736   (lily-interface
737    'system-start-delimiter-interface
738    "#'style can be bar-line, bracket or brace"
739    '(bar-line-collapse-height brace-collapse-height bracket-collapse-height
740                               thickness arch-height arch-angle arch-thick
741                               arch-width bracket-thick glyph ))
742
743
744   (lily-interface
745    'text-spanner-interface
746    "generic text spanner"
747    '(
748     dash-period  
749     dash-length 
750     line-thickness 
751     edge-height 
752     edge-width
753     edge-text 
754     type 
755 ))
756
757
758   (lily-interface
759    'tie-interface
760    "A tie connecting two noteheads.
761 direction = Forced direction for all ties"
762    
763    '(
764     staffline-clearance 
765     control-points 
766     heads 
767     details 
768     thickness 
769     x-gap 
770     direction 
771     minimum-length 
772     ))
773
774
775
776
777   (lily-interface
778    'tie-column-interface
779    "that sets tie directions in a tied chord"
780    '(direction
781    ))
782
783 (lily-interface
784  'percent-repeat-interface
785  "Repeats that look like percent signs"
786  '(slope thickness))
787
788 (lily-interface
789  'volta-bracket-interface
790  "Volta bracket with number"
791  '(
792    bars  
793    thickness  
794    height  
795    ))
796
797
798 (lily-interface
799  'span-bar-interface
800  "A bar line that spans other barlines (typically used to get cross-staff barlines."
801  '(
802    ))
803
804
805 (primitive-eval (cons
806           'begin
807           (map (lambda (x) (list 'define (car x) (list 'quote (cdr x))))
808                all-interfaces)))
809
810
811 (define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
812
813