]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
release: 1.5.20
[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
91 (lily-interface
92  'clef-interface
93  "A clef sign"
94  '(
95    non-default 
96    full-size-change 
97    glyph 
98    ))
99
100
101
102 (lily-interface
103  'axis-group-interface
104  "a group of coupled grobs"
105  '(
106    axes 
107    ))
108
109
110 (lily-interface
111  'note-column-interface
112  "Stem and noteheads combined"
113  '(
114    horizontal-shift 
115    force-hshift 
116    ))
117
118
119 (lily-interface
120  'stem-interface
121  "A stem"
122  '(
123    thickness 
124    beamed-lengths 
125    beamed-minimum-lengths 
126    lengths 
127    beam 
128    stem-shorten 
129    duration-log 
130    beaming 
131    neutral-direction 
132    stem-end-position 
133    support-head 
134    heads 
135    direction 
136    length 
137    style 
138    flag-style 
139    dir-forced 
140    ))
141
142
143
144 (lily-interface
145  'slur-interface
146  "A slur"
147  '(
148    de-uglify-parameters 
149    details 
150    attachment 
151    direction 
152    attachment-offset 
153    beautiful 
154    y-free 
155    control-points 
156    extremity-rules  
157    extremity-offset-alist 
158    thickness 
159    dashed 
160
161    )
162  )
163
164
165
166 (lily-interface
167  'side-position-interface
168  "Position a victim object (this one) next to other objects (the support).
169 #'direction = where to put the victim object (left or right?)
170 "
171  '(
172    side-support 
173    direction-source 
174    direction 
175    side-relative-direction 
176    minimum-space 
177    padding 
178    self-alignment-X 
179    self-alignment-Y 
180    
181    )
182  )
183
184
185 (lily-interface
186  'accidentals-interface
187  "Accidentals"
188  '(accidentals
189    left-padding 
190    right-padding
191    paren-cautionaries
192    cautionary-size
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  '( style stem-attachment-function note-character ))
220
221
222 (lily-interface
223  'note-name-interface
224  "Note name"
225  '( style ))
226
227
228
229 (lily-interface
230  'rhythmic-head-interface
231  "Note head or rest"
232  '(
233    dot 
234    stem 
235    duration-log 
236    ))
237
238
239 (lily-interface
240  'rest-interface
241  "a rest"
242  '(style ))
243
244
245 (lily-interface
246  'tuplet-bracket-interface
247  "A bracket with a number in the middle, used for tuplets." 
248  '(
249    columns 
250    number-gap 
251    delta-y 
252    tuplet-bracket-visibility 
253    tuplet-number-visibility 
254    thick 
255    direction
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  '(bar-size-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 arpeggio-direction))
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     alignment
539     ignore-length-mismatch
540     begin-alignment
541     end-alignment
542     ))
543
544
545
546   (lily-interface
547    'mark-interface
548    "a rehearsal mark"
549    '(
550     ))
551
552
553   (lily-interface
554    'multi-measure-rest-interface
555    "A rest that spans a whole number of measures.  For typesetting the
556 numbers, fields from font-interface may be used.
557
558 padding is the space between number and rest. Measured in staffspace.
559
560 "
561    '(    columns expand-limit minimum-width padding))
562
563
564   (lily-interface
565    'paper-column-interface
566    ""
567
568    '(column-space-strength before-musical-spacing-factor
569 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
570 dir-list shortest-playing-duration shortest-starter-duration
571 contains-grace extra-space stretch-distance ))
572
573
574
575   (lily-interface
576    'porrectus-interface
577    "A porrectus ligature, joining two note heads into a single grob."
578    '(
579     ))
580
581
582   (lily-interface
583    'spaceable-element-interface
584    "An grob (generally a Paper_column) that takes part in the
585 spacing problem. "
586    '(
587      minimum-distances 
588      ideal-distances  
589      dir-list 
590      ))
591
592
593   (lily-interface
594    'rest-collision-interface
595    "Move around ordinary rests (not multi-measure-rests) to avoid
596 conflicts."
597    '(
598     maximum-rest-count 
599     minimum-distance 
600     elements 
601     ))
602
603
604   (lily-interface
605    'script-interface
606    ""
607    '(
608     script-priority 
609     ))
610
611
612   (lily-interface
613    'script-column-interface
614    "An interface that sorts scripts according to their @code{script-priority}"
615    '( ))
616
617
618
619   (lily-interface
620    'spacing-spanner-interface
621    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
622 The space taken by a note is determined by the formula 
623
624
625
626 where TIME is the amount of time a note occupies.  The value of C is
627 chosen such that the smallest space within a measure is
628 arithmetic_basicspace:
629
630 C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
631
632 The smallest space is the one following the shortest note in the
633 measure, or the space following a hypothetical 1/8 note.  Typically
634 arithmetic_basicspace is set to a value so that the shortest note
635 takes about two noteheads of space (ie, is followed by a notehead of
636 space):
637
638 @example
639 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
640
641 @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
642 @{ assuming: SHORTEST <= 1/8 @}
643
644 = arithmetic_multiplier *
645 ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
646
647 = arithmetic_multiplier * arithmetic_basicspace
648
649 @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
650
651 = quartwidth * arithmetic_basicspace
652
653 =>             
654
655 arithmetic_basicspace = 2/1 = 2
656
657
658 If you want to space your music wider, use something like:
659
660 arithmetic_basicspace = 4.;
661
662 @end example"
663    '(
664   maximum-duration-for-spacing 
665     arithmetic-basicspace 
666     arithmetic-multiplier 
667     
668     ))
669
670
671   (lily-interface
672    'staff-symbol-referencer-interface
673    
674    "Object whose Y position is meaning with reference to a staff
675 symbol. Objects that have this interface should include
676 Staff_symbol_referencer::callback in their Y-offset-callback.
677 "
678    '(
679     staff-symbol
680     staff-position
681     ))
682   
683
684   (lily-interface
685    'staff-symbol-interface
686    "This spanner draws the lines of a staff.  The middle line is
687 position 0."
688    '(
689     staff-space 
690     line-count
691     invisible-staff
692     ))
693
694
695   (lily-interface
696    'stem-tremolo-interface
697    ""
698    '( stem beam-width beam-thickness beam-space-function 
699     ))
700
701
702   (lily-interface
703    'separation-item-interface
704    "Item that computes widths to generate spacing rods.
705
706 Calc dimensions for the Separating_group_spanner; this has to be
707 an item to get dependencies correct.  It can't be an grob_group
708 since these usually are in a different X_group
709 "
710    '(
711     elements 
712      ))
713
714
715   (lily-interface
716    'sustain-pedal-interface
717    ""
718    '(
719     ))
720
721   (lily-interface
722    'system-start-delimiter-interface
723    "#'style can be bar-line, bracket or brace"
724    '(bar-line-collapse-height brace-collapse-height bracket-collapse-height
725                               thickness arch-height arch-angle arch-thick
726                               arch-width bracket-thick glyph ))
727
728
729   (lily-interface
730    'text-spanner-interface
731    "generic text spanner"
732    '(
733     dash-period  
734     dash-length 
735     line-thickness 
736     edge-height 
737     edge-text 
738     type 
739 ))
740
741
742   (lily-interface
743    'tie-interface
744    "A tie connecting two noteheads.
745 direction = Forced direction for all ties"
746    
747    '(
748     staffline-clearance 
749     control-points 
750     heads 
751     details 
752     thickness 
753     x-gap 
754     direction 
755     minimum-length 
756     ))
757
758
759
760
761   (lily-interface
762    'tie-column-interface
763    "that sets tie directions in a tied chord"
764    '(direction
765    ))
766
767 (lily-interface
768  'percent-repeat-interface
769  "Repeats that look like percent signs"
770  '(slope thickness))
771
772 (lily-interface
773  'volta-bracket-interface
774  "Volta bracket with number"
775  '(
776    bars  
777    thickness  
778    height  
779    ))
780
781
782 (lily-interface
783  'span-bar-interface
784  "A bar line that spans other barlines (typically used to get cross-staff barlines."
785  '(
786    ))
787
788
789 (primitive-eval (cons
790           'begin
791           (map (lambda (x) (list 'define (car x) (list 'quote (cdr x))))
792                all-interfaces)))
793
794
795 (define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
796
797