]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
patch::: 1.3.127.jcn3
[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--2000  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 (lily-interface symbol description props)
19   (list symbol
20         description
21         props
22         )
23   )
24
25
26 (define (grob-description name . interfaces)
27   (let* ((ifs (cons general-grob-interface interfaces))
28          (props (map caddr ifs))
29 ;        (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
30 ;                                       (apply append props)))
31          (syms (map car ifs))
32         )
33     (list (cons 'separator "\n\n\n")    ;easy printing.
34           (cons 'name name)
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 (define general-grob-interface
43   (lily-interface
44    'general-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     font-relative-size 
52     extra-offset 
53     interfaces  
54     dependencies 
55     no-spacing-rods 
56     extra-extent-X 
57     extra-extent-Y 
58     minimum-extent-X 
59     minimum-extent-Y 
60     origin 
61     transparent 
62     ))
63   )
64
65 (define beam-interface
66   (lily-interface
67    'beam-interface
68    "A beam.
69
70 #'thickness= weight of beams, in staffspace
71   "
72    '(
73      staff-position
74     height 
75     flag-width-function 
76     damping 
77     default-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     )
87    ))
88
89 (define clef-interface
90   (lily-interface
91    'clef-interface
92    "A clef sign"
93    '(
94     non-default 
95     full-size-change 
96     glyph 
97     ))
98   )
99
100 (define axis-group-interface
101   (lily-interface
102    'axis-group-interface
103    "a group of coupled grobs"
104    '(
105     axes 
106    )))
107
108 (define note-column-interface
109   (lily-interface
110    'note-column-interface
111    "Stem and noteheads combined"
112    '(
113     horizontal-shift 
114     force-hshift 
115     ))
116   )
117
118 (define stem-interface
119   (lily-interface
120    'stem-interface
121    "A stem"
122    '(
123     thickness 
124     beamed-lengths 
125     beamed-minimum-lengths 
126     stem-centered 
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 (define slur-interface
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 (define side-position-interface
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 (define accidentals-interface
186   (lily-interface
187    'accidentals-interface
188    "Accidentals"
189    '(
190     left-padding 
191     right-padding 
192     )
193    ))
194
195 (define line-of-score-interface
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 (define note-head-interface
215   (lily-interface
216    'note-head-interface
217    "Note head"
218    '(
219     style 
220     )
221    ))
222
223 (define note-name-interface
224   (lily-interface
225    'note-name-interface
226    "Note name"
227    '(
228     style 
229     )
230    ))
231
232
233 (define rhythmic-head-interface
234   (lily-interface
235    'rhythmic-head-interface
236    "Note head or rest"
237    '(
238     dot 
239     stem 
240     duration-log 
241     )))
242
243 (define rest-interface
244   (lily-interface
245    'rest-interface
246    "a rest"
247    '(style )))
248
249 (define tuplet-bracket-interface
250   (lily-interface
251    'tuplet-bracket-interface
252    "A bracket with a number in the middle, used for tuplets." 
253    '(
254     beams 
255     columns 
256     number-gap 
257     delta-y 
258     tuplet-bracket-visibility 
259     tuplet-number-visibility 
260     parallel-beam 
261     thick 
262     )
263 ))
264
265 (define align-interface
266   (lily-interface
267    'align-interface
268    " Order grobs top to bottom/left to right/right to left etc."
269    '(
270     stacking-dir  
271     align-dir  
272     threshold  
273     alignment-done  
274     center-element 
275     elements  
276     axes  
277     )))    
278
279 (define aligned-interface
280   (lily-interface
281    'aligned-interface
282    "read by align-interface"
283    '(
284     minimum-space 
285     extra-space 
286     )))
287
288 (define break-aligned-interface
289   (lily-interface
290    'break-aligned-interface
291    "Items that are aligned in prefatory matter"
292    '(
293     break-align-symbol 
294     visibility-lambda 
295     breakable 
296     )))
297
298 (define chord-name-interface
299   (lily-interface
300    'chord-name-interface
301    "generate a chord name"
302    '( pitches inversion bass)))
303
304 (define time-signature-interface
305   (lily-interface
306    'time-signature-interface
307    "A time signature, in different styles.
308   The following values for 'style are are recognized:
309
310     @table @samp
311       @item @code{C}
312         4/4 and 2/2 are typeset as C and struck C, respectively.  All
313         other time signatures are written with two digits.
314
315       @item @code{old}
316         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
317         typeset with old-style mensuration marks.  All other time
318         signatures are written with two digits.
319
320       @item @code{1xxx}
321         All time signatures are typeset with a single
322         digit, e.g. 3/2 is written as 3. (Any symbol starting
323         with the digit @code{1} will do.)
324
325       @item @code{C}@var{M}@code{/}@var{N}, 
326 @code{old}@var{M}@code{/}@var{N} or
327       @code{old6/8alt}
328         Tells LilyPond to use a specific symbol as time signature, 
329         regardless of the actual time signature.
330     @end table
331
332 See also the test-file @file{input/test/time.ly}.
333 "
334    '(fraction style )))
335
336 (define bar-line-interface
337   (lily-interface
338    'bar-line-interface
339    "Bar line.
340
341 This is a request to print a special bar symbol. It replaces the 
342 regular bar symbol with a special
343 symbol.  The argument @var{bartype} is a string which specifies the
344 kind of bar to print.  Options are @code{\":|\"}
345 @cindex \"|A@@@code{:|}
346 ,
347 @code{\"|:\"}
348 @cindex \"|B@@@code{|:}
349 , @code{\":|:\"}
350 @cindex \"|C@@@code{:|:}
351 ,
352 @code{\"||\"}
353 @cindex \"|D@@@code{||}
354 , @code{\"|.\"}
355 @cindex \"|E@@@code{|.}
356 ,
357 @code{\".|\"}
358 @cindex \"|F@@@code{.|}
359 , and @code{\".|.\"}
360 @cindex \"|G@@@code{.|.}
361
362
363 These produce, respectively, a right repeat, a left repeat, a double
364 repeat, a double bar, a start bar, an end bar, and a thick double bar.
365 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
366 but a line break is allowed at that spot.
367
368 "
369    '( barsize-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )))
370
371 (define hairpin-interface
372   (lily-interface
373    'hairpin-interface
374    "hairpin crescendo.
375
376 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
377
378 "
379    '( grow-direction thickness height padding )
380    ))
381
382 (define arpeggio-interface
383   (lily-interface
384    'arpeggio-interface
385    "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
386    '(stems)
387    )
388   )
389
390 (define note-collision-interface
391   (lily-interface
392    'note-collision-interface
393    "An object that handles collisions between notes with different
394 stem directions and horizontal shifts. Most of the interesting
395 properties are to be set in @ref{note-column-interface}"
396    '(merge-differently-dotted note-width)
397    ))
398
399
400 (define custos-interface
401   (lily-interface
402    'custos-interface
403    "A custos is a staff context symbol that appears at the end of a
404   staff line with monophonic musical contents (i.e. with a single
405   voice).  It anticipates the pitch of the first note of the following
406   line and thus helps the player or singer to manage line breaks
407   during performance, thus enhancing readability of a score.
408
409   Custodes were frequently used in music notation until the 16th
410   century.  There were different appearences for different notation
411   styles.  Nowadays, they have survived only in special forms of
412   musical notation such as via the editio vaticana dating back to the
413   beginning of the 20th century.
414
415 [TODO: add to glossary]"
416  
417    '(style)
418 )
419   )
420
421
422
423
424 (define dot-interface
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
434 (define font-interface
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-point-size font-relative-size)
440    ))
441
442
443 (define text-interface
444   (lily-interface
445    'text-interface
446    "A scheme markup text"
447    '(text align lookup raise kern magnify)))
448
449 (define dot-column-interface
450   (lily-interface
451    'dot-column-interface
452    "Interface that groups dots so they form a column"
453    '( )
454    ))
455
456 (define dynamic-interface
457   (lily-interface
458    'dynamic-interface
459    "Any kind of loudness sign"
460    '()
461     ))
462
463
464 (define finger-interface
465   (lily-interface
466    'finger-interface
467    "A fingering instruction"
468    '()
469     ))
470
471 (define separation-spanner-interface
472   (lily-interface
473    'separation-spanner-interface
474    "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
475    '()
476   ))
477 (define text-script-interface
478   (lily-interface
479    'text-script-interface
480    "Any text script"
481    '()
482     ))
483
484 (define grace-alignment-interface
485   (lily-interface
486    'grace-alignment-interface
487    "put grace notes in line"
488    '(
489     horizontal-space 
490     )
491    ))
492
493 (define hara-kiri-group-interface
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 (define line-spanner-interface
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 (define lyric-hyphen-interface
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 (define key-signature-interface
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 (define lyric-extender-interface
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 (define lyric-syllable-interface
545   (lily-interface
546    'lyric-syllable-interface
547    "a single piece of lyrics"
548    '(
549     word-space  
550     )))
551
552
553 (define mark-interface
554   (lily-interface
555    'mark-interface
556    "a rehearsal mark"
557    '(
558     )))
559
560 (define multi-measure-rest-interface
561   (lily-interface
562    'multi-measure-rest-interface
563    "A rest that spans a whole number of measures.  For typesetting the
564 numbers, fields from font-interface may be used.
565
566 padding is the space between number and rest. Measured in staffspace.
567  
568 "
569    '(    columns expand-limit minimum-width padding )
570
571    ))
572
573 (define paper-column-interface
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
585 (define spaceable-element-interface
586   (lily-interface
587    'spaceable-element-interface
588    "An grob (generally a Paper_column) that takes part in the
589 spacing problem. "
590    '(
591      minimum-distances 
592      ideal-distances  
593      dir-list 
594      )))
595
596 (define rest-collision-interface
597   (lily-interface
598    'rest-collision-interface
599    "Move around ordinary rests (not multi-measure-rests) to avoid
600 conflicts."
601    '(
602     maximum-rest-count 
603     minimum-distance 
604     elements 
605     )))
606
607 (define script-interface
608   (lily-interface
609    'script-interface
610    ""
611    '(
612     script-priority 
613     )))
614
615 (define script-column-interface
616   (lily-interface
617    'script-column-interface
618    "An interface that sorts scripts according to their @code{script-priority}"
619    '( )))
620
621
622 (define spacing-spanner-interface
623   (lily-interface
624    'spacing-spanner-interface
625    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
626 The space taken by a note is determined by the formula 
627
628   
629
630 where TIME is the amount of time a note occupies.  The value of C is
631 chosen such that the smallest space within a measure is
632 arithmetic_basicspace:
633
634   C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
635
636 The smallest space is the one following the shortest note in the
637 measure, or the space following a hypothetical 1/8 note.  Typically
638 arithmetic_basicspace is set to a value so that the shortest note
639 takes about two noteheads of space (ie, is followed by a notehead of
640 space):
641
642 @example
643    2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
644
645    @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
646    @{ assuming: SHORTEST <= 1/8 @}
647
648                = arithmetic_multiplier *
649                ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
650
651                = arithmetic_multiplier * arithmetic_basicspace
652
653    @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
654
655                = quartwidth * arithmetic_basicspace
656
657    =>          
658
659    arithmetic_basicspace = 2/1 = 2
660
661
662 If you want to space your music wider, use something like:
663
664    arithmetic_basicspace = 4.;
665
666 @end example"
667    '(
668   maximum-duration-for-spacing 
669     arithmetic-basicspace 
670     arithmetic-multiplier 
671     
672     )))
673
674 (define staff-symbol-interface
675   (lily-interface
676    'staff-symbol-interface
677    "This spanner draws the lines of a staff.  The middle line is
678 position 0."
679    '(
680     staff-space 
681     line-count 
682     )))
683
684 (define stem-tremolo-interface
685   (lily-interface
686    'stem-tremolo-interface
687    ""
688    '( stem beam-width beam-thickness beam-space-function 
689     )))
690
691 (define separation-item-interface
692   (lily-interface
693    'separation-item-interface
694    "Item that computes widths to generate spacing rods.
695
696 Calc dimensions for the Separating_group_spanner; this has to be
697    an item to get dependencies correct.  It can't be an grob_group
698    since these usually are in a different X_group
699 "
700    '(
701     elements 
702      )))
703
704 (define sustain-pedal-interface
705   (lily-interface
706    'sustain-pedal-interface
707    ""
708    '(
709     )))
710 (define system-start-delimiter-interface
711   (lily-interface
712    'system-start-delimiter-interface
713    "#'style can be bar-line, bracket or brace"
714    '(bar-line-collapse-height brace-collapse-height bracket-collapse-height
715                               thickness arch-height arch-angle arch-thick
716                               arch-width bracket-thick glyph )))
717
718 (define text-spanner-interface
719   (lily-interface
720    'text-spanner-interface
721    "generic text spanner"
722    '(
723     dash-period  
724     dash-length 
725     line-thickness 
726     edge-height 
727     edge-text 
728     type 
729     )
730 ))
731
732 (define tie-interface
733   (lily-interface
734    'tie-interface
735    "A tie connecting two noteheads.
736 direction = Forced direction for all ties"
737    
738    '(
739     staffline-clearance 
740     control-points 
741     heads 
742     details 
743     thickness 
744     x-gap 
745     direction 
746     minimum-length 
747     )))
748
749
750
751 (define tie-column-interface
752   (lily-interface
753    'tie-column-interface
754    "that sets tie directions in a tied chord"
755    '(direction)
756    ))
757
758 (define volta-bracket-interface
759   (lily-interface
760    'volta-bracket-interface
761    "Volta bracket with number"
762    '(
763     bars  
764     thickness  
765     height  
766     )))
767
768 (define span-bar-interface
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 ;(define urg-miss-last-interface )
776
777