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