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