]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface-description.scm
patch::: 1.3.118.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     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    '( fraction style )))
310
311 (define bar-line-interface
312   (lily-interface
313    'bar-line-interface
314    "Bar line.
315
316 This is a request to print a special bar symbol. It replaces the 
317 regular bar symbol with a special
318 symbol.  The argument @var{bartype} is a string which specifies the
319 kind of bar to print.  Options are @code{\":|\"}
320 @cindex \"|A@@@code{:|}
321 ,
322 @code{\"|:\"}
323 @cindex \"|B@@@code{|:}
324 , @code{\":|:\"}
325 @cindex \"|C@@@code{:|:}
326 ,
327 @code{\"||\"}
328 @cindex \"|D@@@code{||}
329 , @code{\"|.\"}
330 @cindex \"|E@@@code{|.}
331 ,
332 @code{\".|\"}
333 @cindex \"|F@@@code{.|}
334 , and @code{\".|.\"}
335 @cindex \"|G@@@code{.|.}
336
337
338 These produce, respectively, a right repeat, a left repeat, a double
339 repeat, a double bar, a start bar, an end bar, and a thick double bar.
340 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
341 but a line break is allowed at that spot.
342
343 "
344    '( barsize-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )))
345
346 (define hairpin-interface
347   (lily-interface
348    'hairpin-interface
349    "hairpin crescendo.
350
351 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
352
353 "
354    '( grow-direction thickness height padding )
355    ))
356
357 (define arpeggio-interface
358   (lily-interface
359    'arpeggio-interface
360    "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
361    '(stems)
362    )
363   )
364
365 (define note-collision-interface
366   (lily-interface
367    'note-collision-interface
368    "An object that handles collisions between notes with different
369 stem directions and horizontal shifts. Most of the interesting
370 properties are to be set in @ref{note-column-interface}"
371    '(merge-differently-dotted note-width)
372    ))
373
374
375 (define custos-interface
376   (lily-interface
377    'custos-interface
378    "A custos is a staff context symbol that appears at the end of a
379   staff line with monophonic musical contents (i.e. with a single
380   voice).  It anticipates the pitch of the first note of the following
381   line and thus helps the player or singer to manage line breaks
382   during performance, thus enhancing readability of a score.
383
384   Custodes were frequently used in music notation until the 16th
385   century.  There were different appearences for different notation
386   styles.  Nowadays, they have survived only in special forms of
387   musical notation such as via the editio vaticana dating back to the
388   beginning of the 20th century.
389
390 [TODO: add to glossary]"
391  
392    '(style)
393 )
394   )
395
396
397
398
399 (define dot-interface
400   (lily-interface
401    'dots-interface
402    "The dots to go with a notehead/rest.  A separate interface, since they
403   are a party in collision resolution.
404  #'direction is the Direction to handle staff-line collisions in."
405    '(direction dot-count)
406
407    )) 
408
409 (define font-interface
410   (lily-interface
411    'font-interface
412    "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
413    '(font-style font-series font-shape font-family font-name
414 font-point-size font-relative-size)
415    ))
416
417
418 (define text-interface
419   (lily-interface
420    'text-interface
421    "A scheme markup text"
422    '(text align lookup raise kern magnify)))
423
424 (define dot-column-interface
425   (lily-interface
426    'dot-column-interface
427    "Interface that groups dots so they form a column"
428    '( )
429    ))
430
431 (define dynamic-interface
432   (lily-interface
433    'dynamic-interface
434    "Any kind of loudness sign"
435    '()
436     ))
437
438
439 (define finger-interface
440   (lily-interface
441    'finger-interface
442    "A fingering instruction"
443    '()
444     ))
445
446 (define separation-spanner-interface
447   (lily-interface
448    'separation-spanner-interface
449    "Spanner that containing @code{separation-item-interface} grobs to calculate rods"
450    '()
451   ))
452 (define text-script-interface
453   (lily-interface
454    'text-script-interface
455    "Any text script"
456    '()
457     ))
458
459 (define grace-alignment-interface
460   (lily-interface
461    'grace-alignment-interface
462    "put grace notes in line"
463    '(
464     horizontal-space 
465     )
466    ))
467
468 (define hara-kiri-group-interface
469   (lily-interface
470    'hara-kiri-group-interface
471    "  As Vertical_group_spanner, but keep track of interesting items.  If
472   we don't contain any interesting items after linebreaking, then
473   gracefully commit suicide.  Objective: don't disgrace Lily by
474   typesetting empty lines in orchestral scores."
475    '( items-worth-living )
476 ))
477
478 (define line-spanner-interface
479   (lily-interface
480    'line-spanner-interface
481    "Generic line drawn between two objects, eg. for use with glissandi.
482 gap is measured in staff-spaces.   "
483
484    '(gap dash-period dash-length line-thickness type )
485    ))
486
487 (define lyric-hyphen-interface
488   (lily-interface
489    'lyric-hyphen-interface
490    "A centred hyphen is a simple line between lyrics used to divide
491 syllables.   The length of the hyphen line should stretch based on the
492   size of the gap between syllables."
493
494    '( thickness height minimum-length word-space )
495    ))
496
497 (define key-signature-interface
498   (lily-interface
499    'key-signature-interface
500    "A group of  accidentals."
501    '(
502     c0-position  
503     old-accidentals  
504     new-accidentals  
505     )))
506
507 (define lyric-extender-interface
508   (lily-interface
509    'lyric-extender-interface
510    "The extender is a simple line at the baseline of the lyric
511   that helps show the length of a melissima (tied/slurred note)."
512    '(
513     word-space  
514     height  
515     right-trim-amount  
516     )))
517
518
519 (define lyric-syllable-interface
520   (lily-interface
521    'lyric-syllable-interface
522    "a single piece of lyrics"
523    '(
524     word-space  
525     )))
526
527
528 (define mark-interface
529   (lily-interface
530    'mark-interface
531    "a rehearsal mark"
532    '(
533     )))
534
535 (define multi-measure-rest-interface
536   (lily-interface
537    'multi-measure-rest-interface
538    "A rest that spans a whole number of measures.  For typesetting the
539 numbers, fields from font-interface may be used.
540
541 padding is the space between number and rest. Measured in staffspace.
542  
543 "
544    '(    columns expand-limit minimum-width padding )
545
546    ))
547
548 (define paper-column-interface
549   (lily-interface
550    'paper-column-interface
551    ""
552
553    '(column-space-strength before-musical-spacing-factor
554 stem-spacing-correction before-grace-spacing-factor when bounded-by-me
555 dir-list shortest-playing-duration shortest-starter-duration
556 contains-grace extra-space stretch-distance ))
557
558   )
559
560 (define spaceable-element-interface
561   (lily-interface
562    'spaceable-element-interface
563    "An grob (generally a Paper_column) that takes part in the
564 spacing problem. "
565    '(
566      minimum-distances 
567      ideal-distances  
568      dir-list 
569      )))
570
571 (define rest-collision-interface
572   (lily-interface
573    'rest-collision-interface
574    "Move around ordinary rests (not multi-measure-rests) to avoid
575 conflicts."
576    '(
577     maximum-rest-count 
578     minimum-distance 
579     elements 
580     )))
581
582 (define script-interface
583   (lily-interface
584    'script-interface
585    ""
586    '(
587     script-priority 
588     )))
589
590 (define script-column-interface
591   (lily-interface
592    'script-column-interface
593    "An interface that sorts scripts according to their @code{script-priority}"
594    '( )))
595
596
597 (define spacing-spanner-interface
598   (lily-interface
599    'spacing-spanner-interface
600    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
601 The space taken by a note is determined by the formula 
602
603   
604
605 where TIME is the amount of time a note occupies.  The value of C is
606 chosen such that the smallest space within a measure is
607 arithmetic_basicspace:
608
609   C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
610
611 The smallest space is the one following the shortest note in the
612 measure, or the space following a hypothetical 1/8 note.  Typically
613 arithmetic_basicspace is set to a value so that the shortest note
614 takes about two noteheads of space (ie, is followed by a notehead of
615 space):
616
617 @example
618    2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
619
620    @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
621    @{ assuming: SHORTEST <= 1/8 @}
622
623                = arithmetic_multiplier *
624                ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
625
626                = arithmetic_multiplier * arithmetic_basicspace
627
628    @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
629
630                = quartwidth * arithmetic_basicspace
631
632    =>          
633
634    arithmetic_basicspace = 2/1 = 2
635
636
637 If you want to space your music wider, use something like:
638
639    arithmetic_basicspace = 4.;
640
641 @end example"
642    '(
643   maximum-duration-for-spacing 
644     arithmetic-basicspace 
645     arithmetic-multiplier 
646     
647     )))
648
649 (define staff-symbol-interface
650   (lily-interface
651    'staff-symbol-interface
652    "This spanner draws the lines of a staff.  The middle line is
653 position 0."
654    '(
655     staff-space 
656     line-count 
657     )))
658
659 (define stem-tremolo-interface
660   (lily-interface
661    'stem-tremolo-interface
662    ""
663    '(
664     stem 
665     beam-width 
666     beam-thickness 
667     beam-space-function 
668     )))
669
670 (define separation-item-interface
671   (lily-interface
672    'separation-item-interface
673    "Item that computes widths to generate spacing rods.
674
675 Calc dimensions for the Separating_group_spanner; this has to be
676    an item to get dependencies correct.  It can't be an grob_group
677    since these usually are in a different X_group
678 "
679    '(
680     elements 
681      )))
682
683 (define sustain-pedal-interface
684   (lily-interface
685    'sustain-pedal-interface
686    ""
687    '(
688     )))
689 (define system-start-delimiter-interface
690   (lily-interface
691    'system-start-delimiter-interface
692    "#'style can be bar-line, bracket or brace"
693    '(collapse-height thickness arch-height arch-angle arch-thick
694                      arch-width bracket-thick bracket-width glyph )))
695
696 (define text-spanner-interface
697   (lily-interface
698    'text-spanner-interface
699    "generic text spanner"
700    '(
701     dash-period  
702     dash-length 
703     line-thickness 
704     edge-height 
705     edge-text 
706     type 
707     )
708 ))
709
710 (define tie-interface
711   (lily-interface
712    'tie-interface
713    "A tie connecting two noteheads.
714 direction = Forced direction for all ties"
715    
716    '(
717     staffline-clearance 
718     control-points 
719     heads 
720     details 
721     thickness 
722     x-gap 
723     direction 
724     minimum-length 
725     )))
726
727
728
729 (define tie-column-interface
730   (lily-interface
731    'tie-column-interface
732    "that sets tie directions in a tied chord"
733    '(direction)
734    ))
735
736 (define volta-bracket-interface
737   (lily-interface
738    'volta-bracket-interface
739    "Volta bracket with number"
740    '(
741     bars  
742     thickness  
743     height  
744     )))
745
746 (define span-bar-interface
747   (lily-interface
748    'span-bar-interface
749    ""
750    '(
751     )))
752
753
754
755