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