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