]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
release: 1.3.122
[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     y-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
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 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     )))
684
685 (define stem-tremolo-interface
686   (lily-interface
687    'stem-tremolo-interface
688    ""
689    '( stem beam-width beam-thickness beam-space-function 
690     )))
691
692 (define separation-item-interface
693   (lily-interface
694    'separation-item-interface
695    "Item that computes widths to generate spacing rods.
696
697 Calc dimensions for the Separating_group_spanner; this has to be
698    an item to get dependencies correct.  It can't be an grob_group
699    since these usually are in a different X_group
700 "
701    '(
702     elements 
703      )))
704
705 (define sustain-pedal-interface
706   (lily-interface
707    'sustain-pedal-interface
708    ""
709    '(
710     )))
711 (define system-start-delimiter-interface
712   (lily-interface
713    'system-start-delimiter-interface
714    "#'style can be bar-line, bracket or brace"
715    '(collapse-height 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
776
777