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