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