]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
release: 1.3.153
[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    columns 
249    number-gap 
250    delta-y 
251    tuplet-bracket-visibility 
252    tuplet-number-visibility 
253    thick 
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))
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     ))
537
538
539
540   (lily-interface
541    'mark-interface
542    "a rehearsal mark"
543    '(
544     ))
545
546
547   (lily-interface
548    'multi-measure-rest-interface
549    "A rest that spans a whole number of measures.  For typesetting the
550 numbers, fields from font-interface may be used.
551
552 padding is the space between number and rest. Measured in staffspace.
553
554 "
555    '(    columns expand-limit minimum-width padding))
556
557
558   (lily-interface
559    'paper-column-interface
560    ""
561
562    '(column-space-strength before-musical-spacing-factor
563 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
564 dir-list shortest-playing-duration shortest-starter-duration
565 contains-grace extra-space stretch-distance ))
566
567
568
569   (lily-interface
570    'spaceable-element-interface
571    "An grob (generally a Paper_column) that takes part in the
572 spacing problem. "
573    '(
574      minimum-distances 
575      ideal-distances  
576      dir-list 
577      ))
578
579
580   (lily-interface
581    'rest-collision-interface
582    "Move around ordinary rests (not multi-measure-rests) to avoid
583 conflicts."
584    '(
585     maximum-rest-count 
586     minimum-distance 
587     elements 
588     ))
589
590
591   (lily-interface
592    'script-interface
593    ""
594    '(
595     script-priority 
596     ))
597
598
599   (lily-interface
600    'script-column-interface
601    "An interface that sorts scripts according to their @code{script-priority}"
602    '( ))
603
604
605
606   (lily-interface
607    'spacing-spanner-interface
608    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
609 The space taken by a note is determined by the formula 
610
611
612
613 where TIME is the amount of time a note occupies.  The value of C is
614 chosen such that the smallest space within a measure is
615 arithmetic_basicspace:
616
617 C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
618
619 The smallest space is the one following the shortest note in the
620 measure, or the space following a hypothetical 1/8 note.  Typically
621 arithmetic_basicspace is set to a value so that the shortest note
622 takes about two noteheads of space (ie, is followed by a notehead of
623 space):
624
625 @example
626 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
627
628 @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
629 @{ assuming: SHORTEST <= 1/8 @}
630
631 = arithmetic_multiplier *
632 ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
633
634 = arithmetic_multiplier * arithmetic_basicspace
635
636 @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
637
638 = quartwidth * arithmetic_basicspace
639
640 =>             
641
642 arithmetic_basicspace = 2/1 = 2
643
644
645 If you want to space your music wider, use something like:
646
647 arithmetic_basicspace = 4.;
648
649 @end example"
650    '(
651   maximum-duration-for-spacing 
652     arithmetic-basicspace 
653     arithmetic-multiplier 
654     
655     ))
656
657
658   (lily-interface
659    'staff-symbol-referencer-interface
660    
661    "Object whose Y position is meaning with reference to a staff
662 symbol. Objects that have this interface should include
663 Staff_symbol_referencer::callback in their Y-offset-callback.
664 "
665    '(
666     staff-symbol
667     staff-position
668     ))
669   
670
671   (lily-interface
672    'staff-symbol-interface
673    "This spanner draws the lines of a staff.  The middle line is
674 position 0."
675    '(
676     staff-space 
677     line-count
678     invisible-staff
679     ))
680
681
682   (lily-interface
683    'stem-tremolo-interface
684    ""
685    '( stem beam-width beam-thickness beam-space-function 
686     ))
687
688
689   (lily-interface
690    'separation-item-interface
691    "Item that computes widths to generate spacing rods.
692
693 Calc dimensions for the Separating_group_spanner; this has to be
694 an item to get dependencies correct.  It can't be an grob_group
695 since these usually are in a different X_group
696 "
697    '(
698     elements 
699      ))
700
701
702   (lily-interface
703    'sustain-pedal-interface
704    ""
705    '(
706     ))
707
708   (lily-interface
709    'system-start-delimiter-interface
710    "#'style can be bar-line, bracket or brace"
711    '(bar-line-collapse-height brace-collapse-height bracket-collapse-height
712                               thickness arch-height arch-angle arch-thick
713                               arch-width bracket-thick glyph ))
714
715
716   (lily-interface
717    'text-spanner-interface
718    "generic text spanner"
719    '(
720     dash-period  
721     dash-length 
722     line-thickness 
723     edge-height 
724     edge-text 
725     type 
726 ))
727
728
729   (lily-interface
730    'tie-interface
731    "A tie connecting two noteheads.
732 direction = Forced direction for all ties"
733    
734    '(
735     staffline-clearance 
736     control-points 
737     heads 
738     details 
739     thickness 
740     x-gap 
741     direction 
742     minimum-length 
743     ))
744
745
746
747
748   (lily-interface
749    'tie-column-interface
750    "that sets tie directions in a tied chord"
751    '(direction
752    ))
753
754 (lily-interface
755  'percent-repeat-interface
756  "Repeats that look like percent signs"
757  '(slope thickness))
758
759 (lily-interface
760  'volta-bracket-interface
761  "Volta bracket with number"
762  '(
763    bars  
764    thickness  
765    height  
766    ))
767
768
769 (lily-interface
770  'span-bar-interface
771  "A bar line that spans other barlines (typically used to get cross-staff barlines."
772  '(
773    ))
774
775
776 (ly-eval (cons
777           'begin
778           (map (lambda (x) (list 'define (car x) (list 'quote (cdr x))))
779                all-interfaces)))
780
781
782 (define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
783
784