]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
release: 1.5.32
[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 
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    visibility-lambda 
303    breakable 
304    ))
305
306
307 (lily-interface
308  'chord-name-interface
309  "generate a chord name"
310  '( pitches inversion bass))
311
312
313 (lily-interface
314  'time-signature-interface
315  "A time signature, in different styles.
316   The following values for 'style are are recognized:
317
318     @table @samp
319       @item @code{C}
320         4/4 and 2/2 are typeset as C and struck C, respectively.  All
321         other time signatures are written with two digits.
322
323       @item @code{old}
324         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
325         typeset with old-style mensuration marks.  All other time
326         signatures are written with two digits.
327
328       @item @code{1xxx}
329         All time signatures are typeset with a single
330         digit, e.g. 3/2 is written as 3. (Any symbol starting
331         with the digit @code{1} will do.)
332
333       @item @code{C}@var{M}@code{/}@var{N}, 
334 @code{old}@var{M}@code{/}@var{N} or
335       @code{old6/8alt}
336         Tells LilyPond to use a specific symbol as time signature, 
337         regardless of the actual time signature.
338     @end table
339
340 See also the test-file @file{input/test/time.ly}.
341 "
342  '(fraction style ))
343
344
345 (lily-interface
346  'bar-line-interface
347  "Bar line.
348
349 This is a request to print a special bar symbol. It replaces the 
350 regular bar symbol with a special
351 symbol.  The argument @var{bartype} is a string which specifies the
352 kind of bar to print.  Options are @code{\":|\"}
353 @cindex \"|A@@@code{:|}
354 ,
355 @code{\"|:\"}
356 @cindex \"|B@@@code{|:}
357 , @code{\":|:\"}
358 @cindex \"|C@@@code{:|:}
359 ,
360 @code{\"||\"}
361 @cindex \"|D@@@code{||}
362 , @code{\"|.\"}
363 @cindex \"|E@@@code{|.}
364 ,
365 @code{\".|\"}
366 @cindex \"|F@@@code{.|}
367 , and @code{\".|.\"}
368 @cindex \"|G@@@code{.|.}
369
370
371 These produce, respectively, a right repeat, a left repeat, a double
372 repeat, a double bar, a start bar, an end bar, and a thick double bar.
373 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
374 but a line break is allowed at that spot.
375
376 "
377  '(bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function ))
378
379
380 (lily-interface
381  'hairpin-interface
382  "hairpin crescendo.
383
384 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
385
386 "
387  '( grow-direction thickness height padding
388                    ))
389
390
391 (lily-interface
392  'arpeggio-interface
393  "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
394  '(stems arpeggio-direction))
395
396
397
398 (lily-interface
399  'note-collision-interface
400  "An object that handles collisions between notes with different
401 stem directions and horizontal shifts. Most of the interesting
402 properties are to be set in @ref{note-column-interface}"
403  '(merge-differently-dotted note-width))
404
405
406
407 (lily-interface
408  'custos-interface
409  "A custos is a staff context symbol that appears at the end of a
410   staff line with monophonic musical contents (i.e. with a single
411   voice).  It anticipates the pitch of the first note of the following
412   line and thus helps the player or singer to manage line breaks
413   during performance, thus enhancing readability of a score.
414
415   Custodes were frequently used in music notation until the 16th
416   century.  There were different appearences for different notation
417   styles.  Nowadays, they have survived only in special forms of
418   musical notation such as via the editio vaticana dating back to the
419   beginning of the 20th century.
420
421 [TODO: add to glossary]"
422  
423    '(style))
424
425
426
427
428
429
430   (lily-interface
431    'dots-interface
432    "The dots to go with a notehead/rest.  A separate interface, since they
433 are a party in collision resolution.
434 #'direction is the Direction to handle staff-line collisions in."
435    '(direction dot-count))
436
437
438   (lily-interface
439    'font-interface
440    "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
441    '(font-style font-series font-shape font-family font-name
442 font-design-size font-relative-size)
443    )
444
445
446
447   (lily-interface
448    'text-interface
449    "A scheme markup text"
450    '(text align baseline-skip lookup raise kern magnify))
451
452
453   (lily-interface
454    'dot-column-interface
455    "Interface that groups dots so they form a column"
456    '( )
457    )
458
459
460   (lily-interface
461    'dynamic-interface
462    "Any kind of loudness sign"
463    '()
464     )
465
466
467
468   (lily-interface
469    'finger-interface
470    "A fingering instruction"
471    '()
472     )
473
474
475   (lily-interface
476    'separation-spanner-interface
477    "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
478    '()
479   )
480
481   (lily-interface
482    'text-script-interface
483    "Any text script"
484    '()
485    )
486
487
488   (lily-interface
489    'grace-alignment-interface
490    "put grace notes in line"
491    '(
492     horizontal-space 
493     )
494    )
495
496
497   (lily-interface
498    'hara-kiri-group-interface
499    "  As Vertical_group_spanner, but keep track of interesting items.  If
500 we don't contain any interesting items after linebreaking, then
501 gracefully commit suicide.  Objective: don't disgrace Lily by
502 typesetting empty lines in orchestral scores."
503    '( items-worth-living )
504 )
505
506
507   (lily-interface
508    'line-spanner-interface
509    "Generic line drawn between two objects, eg. for use with glissandi.
510 gap is measured in staff-spaces.   "
511
512    '(gap dash-period dash-length line-thickness type 
513    ))
514
515
516   (lily-interface
517    'lyric-hyphen-interface
518    "A centred hyphen is a simple line between lyrics used to divide
519 syllables.   The length of the hyphen line should stretch based on the
520 size of the gap between syllables."
521
522    '( thickness height minimum-length word-space 
523    ))
524
525
526   (lily-interface
527    'key-signature-interface
528    "A group of  accidentals."
529    '(
530     c0-position  
531     old-accidentals  
532     new-accidentals  
533     ))
534
535
536   (lily-interface
537    'lyric-extender-interface
538    "The extender is a simple line at the baseline of the lyric
539 that helps show the length of a melissima (tied/slurred note)."
540    '(
541     word-space  
542     height  
543     right-trim-amount  
544     ))
545
546
547
548   (lily-interface
549    'lyric-syllable-interface
550    "a single piece of lyrics"
551    '(
552     word-space
553     alignment
554     ignore-length-mismatch
555     begin-alignment
556     end-alignment
557     ))
558
559
560
561   (lily-interface
562    'mark-interface
563    "a rehearsal mark"
564    '(
565     ))
566
567
568   (lily-interface
569    'multi-measure-rest-interface
570    "A rest that spans a whole number of measures.  For typesetting the
571 numbers, fields from font-interface may be used.
572
573 padding is the space between number and rest. Measured in staffspace.
574
575 "
576    '(    columns expand-limit minimum-width padding))
577
578
579   (lily-interface
580    'paper-column-interface
581    ""
582
583    '(column-space-strength before-musical-spacing-factor
584 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
585 dir-list shortest-playing-duration shortest-starter-duration
586 contains-grace extra-space stretch-distance ))
587
588
589
590   (lily-interface
591    'porrectus-interface
592    "A porrectus ligature, joining two note heads into a single grob."
593    '(
594     ))
595
596
597   (lily-interface
598    'spaceable-element-interface
599    "An grob (generally a Paper_column) that takes part in the
600 spacing problem. "
601    '(penalty 
602      minimum-distances 
603      ideal-distances  
604      dir-list 
605      ))
606
607
608   (lily-interface
609    'rest-collision-interface
610    "Move around ordinary rests (not multi-measure-rests) to avoid
611 conflicts."
612    '(
613     maximum-rest-count 
614     minimum-distance 
615     elements 
616     ))
617
618
619   (lily-interface
620    'script-interface
621    ""
622    '(
623     script-priority 
624     ))
625
626
627   (lily-interface
628    'script-column-interface
629    "An interface that sorts scripts according to their @code{script-priority}"
630    '( ))
631
632
633
634   (lily-interface
635    'spacing-spanner-interface
636    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
637 The space taken by a note is determined by the formula 
638
639
640
641 where TIME is the amount of time a note occupies.  The value of C is
642 chosen such that the smallest space within a measure is
643 arithmetic_basicspace:
644
645 C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
646
647 The smallest space is the one following the shortest note in the
648 measure, or the space following a hypothetical 1/8 note.  Typically
649 arithmetic_basicspace is set to a value so that the shortest note
650 takes about two noteheads of space (ie, is followed by a notehead of
651 space):
652
653 @example
654 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
655
656 @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
657 @{ assuming: SHORTEST <= 1/8 @}
658
659 = arithmetic_multiplier *
660 ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
661
662 = arithmetic_multiplier * arithmetic_basicspace
663
664 @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
665
666 = quartwidth * arithmetic_basicspace
667
668 =>             
669
670 arithmetic_basicspace = 2/1 = 2
671
672
673 If you want to space your music wider, use something like:
674
675 arithmetic_basicspace = 4.;
676
677 @end example"
678    '(
679   maximum-duration-for-spacing 
680     arithmetic-basicspace 
681     arithmetic-multiplier 
682     
683     ))
684
685
686   (lily-interface
687    'staff-symbol-referencer-interface
688    
689    "Object whose Y position is meaning with reference to a staff
690 symbol. Objects that have this interface should include
691 Staff_symbol_referencer::callback in their Y-offset-callback.
692 "
693    '(
694     staff-symbol
695     staff-position
696     ))
697   
698
699   (lily-interface
700    'staff-symbol-interface
701    "This spanner draws the lines of a staff.  The middle line is
702 position 0."
703    '(
704     staff-space 
705     line-count
706     invisible-staff
707     ))
708
709
710   (lily-interface
711    'stem-tremolo-interface
712    ""
713    '( stem beam-width beam-thickness beam-space-function 
714     ))
715
716
717   (lily-interface
718    'separation-item-interface
719    "Item that computes widths to generate spacing rods.
720
721 Calc dimensions for the Separating_group_spanner; this has to be
722 an item to get dependencies correct.  It can't be an grob_group
723 since these usually are in a different X_group
724 "
725    '(
726     elements 
727      ))
728
729
730   (lily-interface
731    'sustain-pedal-interface
732    ""
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-text 
753     type 
754 ))
755
756
757   (lily-interface
758    'tie-interface
759    "A tie connecting two noteheads.
760 direction = Forced direction for all ties"
761    
762    '(
763     staffline-clearance 
764     control-points 
765     heads 
766     details 
767     thickness 
768     x-gap 
769     direction 
770     minimum-length 
771     ))
772
773
774
775
776   (lily-interface
777    'tie-column-interface
778    "that sets tie directions in a tied chord"
779    '(direction
780    ))
781
782 (lily-interface
783  'percent-repeat-interface
784  "Repeats that look like percent signs"
785  '(slope thickness))
786
787 (lily-interface
788  'volta-bracket-interface
789  "Volta bracket with number"
790  '(
791    bars  
792    thickness  
793    height  
794    ))
795
796
797 (lily-interface
798  'span-bar-interface
799  "A bar line that spans other barlines (typically used to get cross-staff barlines."
800  '(
801    ))
802
803
804 (primitive-eval (cons
805           'begin
806           (map (lambda (x) (list 'define (car x) (list 'quote (cdr x))))
807                all-interfaces)))
808
809
810 (define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
811
812