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