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