]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface.scm
release: 1.3.97
[lilypond.git] / scm / interface.scm
1
2 ; should include default value?
3
4 ;;; ::::::: should generate documentation for score elements from here.
5
6 (define (property-description symbol type? description)
7   (list symbol type? description))
8   
9 (define (lily-interface symbol description props)
10   (list symbol
11         description
12         props
13         )
14   )
15
16
17 (define (merge-interfaces ifs)
18    (list
19     (apply append (map car ifs))
20     (apply append (map cadr ifs))
21     (apply append (map caddr ifs))
22   ))
23
24 (define (uniqued-alist  alist acc)
25   (if (null? alist) acc
26       (if (assoc (caar alist) acc)
27           (uniqued-alist (cdr alist) acc)
28           (uniqued-alist (cdr alist) (cons (car alist) acc)
29   ))))
30
31 (define (element-description name . interfaces)
32   (let* ((ifs (cons general-element-interface interfaces))
33          (props (map caddr ifs))
34          (syms (map car ifs))
35         )
36     (list (cons 'separator "\n\n\n")    ;easy printing.
37           (cons 'name name)
38           (cons 'interfaces syms)
39           (cons 'interface-descriptions ifs)
40           ; (cons 'interface-descriptions (cadr merged))
41           ;; description of the element itself?
42           (cons 'properties (apply append props))
43   )))
44
45
46 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47 ;;;;;;;;;;;;;;;;
48 ;;;;;;;;;;;;;;;;;
49
50 (define general-element-interface
51   (lily-interface
52    'general-element-interface
53    "All elements support this"
54    (list (property-description 'X-offset-callbacks list? "")
55     (property-description 'Y-offset-callbacks list? "")
56     (property-description 'X-extent-callback procedure? "")
57     (property-description 'Y-extent-callback procedure? "")
58     (property-description 'font-size integer? "")
59     ))
60 )
61
62 (define beam-interface
63   (lily-interface
64    'beam-interface
65    "A beam. "
66    (list
67     (property-description 'y-position number? "position of left edge")
68     (property-description 'height number? "dy")
69     (property-description 'flag-width-function procedure? "")
70     (property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams ")
71     (property-description 'default-neutral-direction dir? "which
72 direction to choose if we're in the middle of the staff ")
73     (property-description 'thickness number? "weight of beams, in staffspace")
74     (property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)")
75     (property-description 'beamed-stem-shorten number? "")
76     (property-description 'height-quants number? "")
77     (property-description 'vertical-position-quant-function procedure? "")
78     (property-description 'dir-function procedure? "")
79     (property-description 'damping number? "damping factor.")
80     (property-description 'outer-stem-length-limit number? "catch
81 suspect beam slopes, set slope to zero if outer stem is lengthened
82 more than this (in staffspace)")
83     (property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.")
84     )
85 ))
86
87
88
89 ;;;;;;;;;;;;;;;;;;;;
90
91 (define clef-interface
92   (lily-interface
93    'clef-interface
94    "A clef sign"
95    (list
96     (property-description 'non-default boolean? "not set because of existence of a bar?")
97     (property-description 'change boolean? "is this a change clef (smaller size)?")
98     (property-description 'glyph string? "a string determining what glyph is typeset")
99     ))
100   )
101
102 (define axis-group-interface
103   (lily-interface
104    'axis-group-interface
105    "a group of coupled elements"
106    (list
107     (property-description 'axes list? "list of axis (number) in which this group works")
108    )))
109
110 (define note-column-interface
111   (lily-interface
112    'note-column-interface
113    "Stem and noteheads combined"
114    (list
115     (property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting.")
116     (property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings.")
117     (property-description 'merge-differently-dotted boolean? "merge black noteheads with differing dot count.")
118     ))
119   )
120
121 (define stem-interface
122   (lily-interface
123    'stem-interface
124    "A stem"
125    (list
126     (property-description 'thickness number? "")
127     (property-description 'beamed-lengths list? "")
128     (property-description 'beamed-minimum-lengths list? "")
129     (property-description 'lengths list? "")
130     (property-description 'stem-shorten list? "")
131     (property-description 'default-neutral-direction dir? "")
132     (property-description 'direction dir? "")
133     (property-description 'stem-length number? "")
134     (property-description 'style string? "") ; symbol!?
135     (property-description 'flag-style string? "") ; symbol!?
136     (property-description 'X-offset-callbacks list? "")
137     )))
138
139
140 (define slur-interface
141   (lily-interface
142    'slur-interface
143    "A slur"
144    (list
145     (property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
146     (property-description 'details list? "alist containing contaning a few magic constants.")
147     (property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
148     (property-description 'direction dir? "up or down?")
149     (property-description 'y-free number? "? ")
150     (property-description 'control-points list? "")
151     (property-description 'extremity-rules  list? "")
152     (property-description 'extremity-offset-alist list? "")
153     (property-description 'thickness list? "")
154     (property-description 'dash number? "number representing the length of the dashes.")
155     )
156    )
157   )
158
159 (define side-position-interface
160   (lily-interface
161    'side-position-interface
162    "put an element next to another one."
163    (list
164     (property-description 'direction dir? "where to put the victim object (left or right?)")
165     (property-description 'side-relative-direction dir? "if set: get the direction from a different object, and multiply by this.")
166     (property-description 'minimum-space number? "minimum distance that the victim should move (after padding)")
167     (property-description 'padding number? "add this much extra space between victim and support")
168     (property-description 'self-alignment-X number? "real number: -1 = left aligned, 0 = center, 1 right-aligned in X direction. Set to an element pointer, if you want that element to be the center. ")
169     (property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis")
170     
171     )
172   ))
173
174 (define accidentals-interface
175   (lily-interface
176    'accidentals-interface
177    "Accidentals"
178    (list
179     (property-description 'left-padding number? "space left of accs")
180     (property-description 'right-padding number? "space right of accs")     
181     )
182    ))
183
184 (define note-head-interface
185   (lily-interface
186    'note-head-interface
187    "Note head"
188    (list
189     (property-description 'style symbol? "symbol that sets note head style")
190     )
191    ))
192
193 (define note-name-interface
194   (lily-interface
195    'note-name-interface
196    "Note naem"
197    (list
198     (property-description 'style symbol? "symbol that sets note name style")
199     )
200    ))
201
202
203 (define rhythmic-head-interface
204   (lily-interface
205    'rhythmic-head-interface
206    "Note head or rest"
207    (list
208     (property-description 'dot ly-element? "reference to Dots object.")
209     (property-description 'stem ly-element? "pointer to Stem object")
210     (property-description 'duration-log integer? "2-log of the notehead duration")
211     )))
212
213 (define rest-interface
214   (lily-interface
215    'rest-interface
216    "a rest"
217    (list
218     (property-description 'style string? "string specifying glyph style"))))
219
220 (define tuplet-bracket-interface
221   (lily-interface
222    'tuplet-bracket-interface
223    "A bracket with a number in the middle" 
224    (list
225     (property-description 'beams list? "list of beam ptrs.")
226     (property-description 'columns list? " list of note-columns.")
227     (property-description 'number-gap number? "")
228     (property-description 'delta-y number? "")
229     (property-description 'thick number? "")
230     )
231 ))
232
233
234 (define align-interface
235   (lily-interface
236    'align-interface
237    " Order elements top to bottom/left to right/right to left etc."
238    (list
239     (property-description 'stacking-dir  dir? "stack contents of elements in which direction ?")
240     (property-description 'align-dir  dir? "Which side to align? -1: left side, 0: centered around center-element if not nil, or around center of width), 1: right side")
241     (property-description 'threshold  pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
242     (property-description 'alignment-done  boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
243     (property-description 'center-element ly-element? "element which will be at the
244 center of the group after aligning (when using
245 Align_interface::center_on_element). The center element should have
246 this object as a reference point.")
247     (property-description 'elements  list? "to be aligned elements ")
248     (property-description 'axes  list? "list of axis numbers. Should contain only one number.")
249     )))    
250
251 (define aligned-interface
252   (lily-interface
253    'aligned-interface
254    "read by align-interface"
255    (list
256     (property-description 'minimum-space pair? "(cons LEFT RIGHT)")
257     (property-description 'extra-space pair? "(cons LEFT RIGHT)")
258     )))
259
260 (define break-aligned-interface
261   (lily-interface
262    'break-aligned-interface
263    "Items that are aligned in prefatory matter"
264    (list
265     (property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
266     (property-description 'visibility-lambda procedure? "")
267     (property-description 'breakable boolean? "")
268     )))
269
270 (define chord-name-interface
271   (lily-interface
272    'chord-name-interface
273    ""
274    (list
275     )))
276 (define time-signature-interface
277   (lily-interface
278    'time-signature-interface
279    "A time signature, in different styles"
280    (list
281     (property-description 'fraction pair? "")
282     (property-description 'style string? "")
283     )))
284
285 (define bar-line-interface
286   (lily-interface
287    'bar-line-interface
288    "Bar line"
289    (list
290     (property-description 'barsize-procedure procedure? "")
291     (property-description 'kern number? "")
292     (property-description 'thin-kern number? "")
293     (property-description 'hair-thickness number? "")
294     (property-description 'thick-thickness number? "")
295     (property-description 'glyph string? "")
296     (property-description 'bar-size number? "")
297     (property-description 'break-glyph-function procedure? "")
298    )))
299
300
301
302
303 (define text-spanner-interface
304   (lily-interface
305    'text-spanner-interface
306    "generic text spanner"
307    (list
308     (property-description 'dash-period  number? "")
309     (property-description 'dash-length number? "")
310     (property-description 'line-thickness number? "")
311     (property-description 'edge-height pair? "(leftheight . rightheight)")
312     (property-description 'edge-text pair? "(lefttext . righttext)")
313     (property-description 'text-style string? "") ; SYMBOL!!?
314     (property-description 'type string? "line, dashed-line or dotted-line") ; SYMBOL!!?    
315     )
316 ))
317
318 (define hairpin-interface
319   (lily-interface
320    'hairpin-interface
321    "hairpin crescendo"
322    (list
323     (property-description 'grow-direction dir? "")
324     (property-description 'thickness number? "")
325     (property-description 'height number? "")
326     )))
327
328
329 (define arpeggio-interface
330   (lily-interface
331    'arpeggio-interface
332    "arpeggio "
333    (list
334     (property-description 'stems list? "list of stem objects, corresponding to the notes that the  arp has to be before.")
335     )
336    )
337   )
338
339 (define note-collision-interface
340   (lily-interface
341    'note-collision-interface
342    "note collision"
343    (list
344     (property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
345     )   )  )
346 (define dot-interface
347   (lily-interface
348    'dots-interface
349    "The dots to go with a notehead/rest.  A separate interface, since they
350   are a party in collision resolution."
351    (list
352     (property-description 'dot-count integer? "number of dots")
353     )))
354
355 (define text-interface
356   (lily-interface
357    'text-interface
358    "A text"
359    (list
360     (property-description 'text string? "")
361     (property-description 'style string? "")
362     )))
363
364
365 (define dot-column-interface
366   (lily-interface
367    'dot-column-interface
368    ""
369    (list
370     )))
371
372 (define dynamic-interface
373   (lily-interface
374    'dynamic-interface
375    "Any kind of loudness sign"
376    '()
377     ))
378
379
380 (define finger-interface
381   (lily-interface
382    'finger-interface
383    "Any kind of loudness sign"
384    '()
385     ))
386
387 (define separation-spanner-interface
388   (lily-interface
389    'separation-spanner-interface
390    ""
391    '()
392   ))
393 (define text-script-interface
394   (lily-interface
395    'text-script-interface
396    "Any text script"
397    '()
398     ))
399
400 (define grace-alignment-interface
401   (lily-interface
402    'grace-alignment-interface
403    "put grace notes in line"
404    (list
405     (property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
406     )
407    ))
408
409 (define hara-kiri-group-interface
410   (lily-interface
411    'hara-kiri-group-interface
412    "seppuku"
413    '()))
414
415 (define lyric-hyphen-interface
416   (lily-interface
417    'lyric-hyphen-interface
418    "A centred hyphen is a simple line between lyrics used to divide
419 syllables.   The length of the hyphen line should stretch based on the
420   size of the gap between syllables."
421    (list
422     
423     (property-description 'thickness number? "thickness of line (in stafflinethickness)")
424     (property-description 'height number? "vertical offset  (in staffspace)")
425
426     (property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
427     (property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
428     )))
429
430 (define key-signature-interface
431   (lily-interface
432    'key-signature-interface
433    "A group of  accidentals."
434    (list
435     (property-description 'c0-position  integer? "integer indicating the position of central C?")
436     (property-description 'old-accidentals  list? "list of (pitch, accidental) pairs")
437     (property-description 'new-accidentals  list? "list of (pitch, accidental) pairs")
438     )))
439
440 (define lyric-extender-interface
441   (lily-interface
442    'lyric-extender-interface
443    "The extender is a simple line at the baseline of the lyric
444   that helps show the length of a melissima (tied/slurred note)."
445    (list
446     (property-description 'word-space  number? "")
447     (property-description 'height  number? "in stafflinethickness")
448     (property-description 'right-trim-amount  number? "")
449     )))
450
451
452 (define lyric-syllable-interface
453   (lily-interface
454    'lyric-syllable-interface
455    ""
456    (list
457     (property-description 'word-space  number? "")
458     )))
459
460
461 (define mark-interface
462   (lily-interface
463    'mark-interface
464    ""
465    (list
466     )))
467
468 (define multi-measure-rest-interface
469   (lily-interface
470    'multi-measure-rest-interface
471    ""
472    (list
473     
474     (property-description 'columns  list? "list of paper-columns")
475     (property-description 'expand-limit  integer? "int : max number of measures expanded in church rests")
476     (property-description 'minimum-width number? "Real in staffspace")
477     (property-description 'padding  number? "staffspace")
478     )))
479
480 (define paper-column-interface
481   (lily-interface
482    'paper-column-interface
483    ""
484    (list
485     (property-description 'dir-list  list? "list of stem directions")
486     (property-description 'shortest-playing-duration  moment? "duration of the shortest playing in that column.")
487     (property-description 'shortest-starter-duration  moment? "duration of the shortest notes that starts exactly in this column.")
488     (property-description 'contains-grace  boolean? "Used to widen entries for grace notes.")
489     (property-description 'extra-space  pair? "pair of distances")
490     (property-description 'stretch-distance pair? "pair of distances")
491     )))
492
493 (define spaceable-element-interface
494   (lily-interface
495    'spaceable-element-interface
496    ""
497    (list
498      (property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
499      (property-description 'ideal-distances  list? "(OBJ . (DIST . STRENGTH)) pairs")
500      (property-description 'dir-list list? "list of stem directions.")
501      )))
502
503 (define rest-collision-interface
504   (lily-interface
505    'rest-collision-interface
506    ""
507    (list
508     (property-description 'maximum-rest-count integer? "")
509     (property-description 'minimum-distance number? "")    
510     )))
511
512 (define script-interface
513   (lily-interface
514    'script-interface
515    ""
516    (list
517     (property-description 'script-priority number? "")
518     )))
519
520 (define script-column-interface
521   (lily-interface
522    'script-column-interface
523    ""
524    (list )))
525
526
527 (define spacing-spanner-interface
528   (lily-interface
529    'spacing-spanner-interface
530    ""
531    (list
532     (property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
533     )))
534
535 (define staff-symbol-interface
536   (lily-interface
537    'staff-symbol-interface
538    "This spanner draws the lines of a staff.  The middle line is
539 position 0."
540    (list
541     (property-description 'staff-space number? "")
542     (property-description 'line-count integer? "")
543     )))
544
545 (define stem-tremolo-interface
546   (lily-interface
547    'stem-tremolo-interface
548    ""
549    (list
550     (property-description 'stem ly-element? "pointer to the stem object.")
551     (property-description 'beam-width number? "")
552     (property-description 'beam-thickness number? "")
553     (property-description 'beam-space-function procedure? "")
554     )))
555
556 (define separation-item-interface
557   (lily-interface
558    'separation-item-interface
559    ""
560    (list
561     )))
562
563 (define sustain-pedal-interface
564   (lily-interface
565    'sustain-pedal-interface
566    ""
567    (list
568     )))
569 (define system-start-delimiter
570   (lily-interface
571    'system-start-delimiter
572    ""
573    (list
574     (property-description 'collapse-height number? "")
575     (property-description 'thickness number? "")
576     (property-description 'arch-height number? "")
577     (property-description 'arch-angle number? "")
578     (property-description 'arch-thick number? "")
579     (property-description 'arch-width number? "")
580     (property-description 'bracket-thick number? "")
581     (property-description 'bracket-width number? "")
582     )))
583
584 (define text-script-interface
585   (lily-interface
586    'text-script-interface
587    ""
588    (list
589     
590     )))
591
592 (define tie-interface
593   (lily-interface
594    'tie-interface
595    ""
596    (list
597     (property-description 'staffline-clearance number? "")
598     (property-description 'heads pair? "pair of element pointers, pointing to the two heads of the  tie. ")
599     (property-description 'details list? "")
600     (property-description 'thickness number? "")
601     (property-description 'x-gap number? "")
602     (property-description 'minimum-length number? "")
603     )))
604
605
606
607 (define tie-column-interface
608   (lily-interface
609    'tie-column-interface
610    ""
611    (list
612     )))
613
614 (define volta-bracket-interface
615   (lily-interface
616    'volta-bracket-interface
617    "Volta bracket with number"
618    (list
619     (property-description 'bars  list? "list of barline ptrs.")
620     (property-description 'thickness  number? "in stafflinethickness")
621     (property-description 'height  number? "in staffspace ")
622     )))
623
624 (define span-bar-interface
625   (lily-interface
626    'span-bar-interface
627    ""
628    (list
629     )))
630