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