]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface.scm
patch::: 1.3.96.jcn10
[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 (define note-name-interface
179   (lily-interface
180    'note-name-interface
181    "Note naem"
182    (list
183     (property-description 'style symbol? "symbol that sets note name style")
184     )
185    ))
186
187
188 (define rhythmic-head-interface
189   (lily-interface
190    'rhythmic-head-interface
191    "Note head or rest"
192    (list
193     (property-description 'dot ly-element? "reference to Dots object.")
194     (property-description 'stem ly-element? "pointer to Stem object")
195     (property-description 'duration-log integer? "2-log of the notehead duration")
196     )))
197
198 (define rest-interface
199   (lily-interface
200    'rest-interface
201    "a rest"
202    (list
203     (property-description 'style string? "string specifying glyph style"))))
204
205 (define tuplet-bracket-interface
206   (lily-interface
207    'tuplet-bracket-interface
208    "A bracket with a number in the middle" 
209    (list
210     (property-description 'beams list? "list of beam ptrs.")
211     (property-description 'columns list? " list of note-columns.")
212     (property-description 'number-gap number? "")
213     (property-description 'delta-y number? "")
214     (property-description 'thick number? "")
215     )
216 ))
217
218
219 (define align-interface
220   (lily-interface
221    'align-interface
222    " Order elements top to bottom/left to right/right to left etc."
223    (list
224     (property-description 'stacking-dir  dir? "stack contents of elements in which direction ?")
225     (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")
226     (property-description 'threshold  pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace")
227     (property-description 'alignment-done  boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once)")
228     (property-description 'center-element ly-element? "element which will be at the
229 center of the group after aligning (when using
230 Align_interface::center_on_element). The center element should have
231 this object as a reference point.")
232     (property-description 'elements  list? "to be aligned elements ")
233     (property-description 'axes  list? "list of axis numbers. Should contain only one number.")
234     )))    
235
236 (define aligned-interface
237   (lily-interface
238    'aligned-interface
239    "read by align-interface"
240    (list
241     (property-description 'minimum-space pair? "(cons LEFT RIGHT)")
242     (property-description 'extra-space pair? "(cons LEFT RIGHT)")
243     )))
244
245 (define break-aligned-interface
246   (lily-interface
247    'break-aligned-interface
248    "Items that are aligned in prefatory matter"
249    (list
250     (property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.")
251     (property-description 'visibility-lambda procedure? "")
252     (property-description 'breakable boolean? "")
253     )))
254
255 (define chord-name-interface
256   (lily-interface
257    'chord-name-interface
258    ""
259    (list
260     )))
261 (define time-signature-interface
262   (lily-interface
263    'time-signature-interface
264    "A time signature, in different styles"
265    (list
266     (property-description 'fraction pair? "")
267     (property-description 'style string? "")
268     )))
269
270 (define bar-line-interface
271   (lily-interface
272    'bar-line-interface
273    "Bar line"
274    (list
275     (property-description 'barsize-procedure procedure? "")
276     (property-description 'kern number? "")
277     (property-description 'thin-kern number? "")
278     (property-description 'hair-thickness number? "")
279     (property-description 'thick-thickness number? "")
280     (property-description 'glyph string? "")
281     (property-description 'bar-size number? "")
282     (property-description 'break-glyph-function procedure? "")
283    )))
284
285
286
287
288 (define text-spanner-interface
289   (lily-interface
290    'text-spanner-interface
291    "generic text spanner"
292    (list
293     (property-description 'dash-period  number? "")
294     (property-description 'dash-length number? "")
295     (property-description 'line-thickness number? "")
296     (property-description 'edge-height pair? "(leftheight . rightheight)")
297     (property-description 'edge-text pair? "(lefttext . righttext)")
298     (property-description 'text-style string? "") ; SYMBOL!!?
299     (property-description 'type string? "line, dashed-line or dotted-line") ; SYMBOL!!?    
300     )
301 ))
302
303 (define hairpin-interface
304   (lily-interface
305    'hairpin-interface
306    "hairpin crescendo"
307    (list
308     (property-description 'grow-direction dir? "")
309     (property-description 'thickness number? "")
310     (property-description 'height number? "")
311     )))
312
313
314 (define arpeggio-interface
315   (lily-interface
316    'arpeggio-interface
317    "arpeggio "
318    (list
319     (property-description 'stems list? "list of stem objects, corresponding to the notes that the  arp has to be before.")
320     )
321    )
322   )
323
324 (define note-collision-interface
325   (lily-interface
326    'note-collision-interface
327    "note collision"
328    (list
329     (property-description 'note-width 'number? "unit for horizontal translation, measured in staff-space.")
330     )   )  )
331 (define dot-interface
332   (lily-interface
333    'dots-interface
334    "The dots to go with a notehead/rest.  A separate interface, since they
335   are a party in collision resolution."
336    (list
337     (property-description 'dot-count integer? "number of dots")
338     )))
339
340 (define text-interface
341   (lily-interface
342    'text-interface
343    "A text"
344    (list
345     (property-description 'text string? "")
346     (property-description 'style string? "")
347     )))
348
349
350 (define dot-column-interface
351   (lily-interface
352    'dot-column-interface
353    ""
354    (list
355     )))
356
357 (define dynamic-interface
358   (lily-interface
359    'dynamic-interface
360    "Any kind of loudness sign"
361    '()
362     ))
363
364
365 (define finger-interface
366   (lily-interface
367    'finger-interface
368    "Any kind of loudness sign"
369    '()
370     ))
371
372 (define separation-spanner-interface
373   (lily-interface
374    'separation-spanner-interface
375    ""
376    '()
377   ))
378 (define text-script-interface
379   (lily-interface
380    'text-script-interface
381    "Any text script"
382    '()
383     ))
384
385 (define grace-alignment-interface
386   (lily-interface
387    'grace-alignment-interface
388    "put grace notes in line"
389    (list
390     (property-description 'horizontal-space number? "amount of space to add after a note (in staff-space)")
391     )
392    ))
393
394 (define hara-kiri-group-interface
395   (lily-interface
396    'hara-kiri-group-interface
397    "seppuku"
398    '()))
399
400 (define lyric-hyphen-interface
401   (lily-interface
402    'lyric-hyphen-interface
403    "A centred hyphen is a simple line between lyrics used to divide
404 syllables.   The length of the hyphen line should stretch based on the
405   size of the gap between syllables."
406    (list
407     
408     (property-description 'thickness number? "thickness of line (in stafflinethickness)")
409     (property-description 'height number? "vertical offset  (in staffspace)")
410
411     (property-description 'minimum-length number? "try to make the hyphens at least this long. Also works as a scaling parameter for the length")
412     (property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics)")
413     )))
414
415 (define key-signature-interface
416   (lily-interface
417    'key-signature-interface
418    "A group of  accidentals."
419    (list
420     (property-description 'c0-position  integer? "integer indicating the position of central C?")
421     (property-description 'old-accidentals  list? "list of (pitch, accidental) pairs")
422     (property-description 'new-accidentals  list? "list of (pitch, accidental) pairs")
423     )))
424
425 (define lyric-extender-interface
426   (lily-interface
427    'lyric-extender-interface
428    "The extender is a simple line at the baseline of the lyric
429   that helps show the length of a melissima (tied/slurred note)."
430    (list
431     (property-description 'word-space  number? "")
432     (property-description 'height  number? "in stafflinethickness")
433     (property-description 'right-trim-amount  number? "")
434     )))
435
436
437 (define lyric-syllable-interface
438   (lily-interface
439    'lyric-syllable-interface
440    ""
441    (list
442     (property-description 'word-space  number? "")
443     )))
444
445
446 (define mark-interface
447   (lily-interface
448    'mark-interface
449    ""
450    (list
451     )))
452
453 (define multi-measure-rest-interface
454   (lily-interface
455    'multi-measure-rest-interface
456    ""
457    (list
458     
459     (property-description 'columns  list? "list of paper-columns")
460     (property-description 'expand-limit  integer? "int : max number of measures expanded in church rests")
461     (property-description 'minimum-width number? "Real in staffspace")
462     (property-description 'padding  number? "staffspace")
463     )))
464
465 (define paper-column-interface
466   (lily-interface
467    'paper-column-interface
468    ""
469    (list
470     (property-description 'dir-list  list? "list of stem directions")
471     (property-description 'shortest-playing-duration  moment? "duration of the shortest playing in that column.")
472     (property-description 'shortest-starter-duration  moment? "duration of the shortest notes that starts exactly in this column.")
473     (property-description 'contains-grace  boolean? "Used to widen entries for grace notes.")
474     (property-description 'extra-space  pair? "pair of distances")
475     (property-description 'stretch-distance pair? "pair of distances")
476     )))
477
478 (define spaceable-element-interface
479   (lily-interface
480    'spaceable-element-interface
481    ""
482    (list
483      (property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs)")
484      (property-description 'ideal-distances  list? "(OBJ . (DIST . STRENGTH)) pairs")
485      (property-description 'dir-list list? "list of stem directions.")
486      )))
487
488 (define rest-collision-interface
489   (lily-interface
490    'rest-collision-interface
491    ""
492    (list
493     (property-description 'maximum-rest-count integer? "")
494     (property-description 'minimum-distance number? "")    
495     )))
496
497 (define script-interface
498   (lily-interface
499    'script-interface
500    ""
501    (list
502     (property-description 'script-priority number? "")
503     )))
504
505 (define script-column-interface
506   (lily-interface
507    'script-column-interface
508    ""
509    (list )))
510
511
512 (define spacing-spanner-interface
513   (lily-interface
514    'spacing-spanner-interface
515    ""
516    (list
517     (property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.")
518     )))
519
520 (define staff-symbol-interface
521   (lily-interface
522    'staff-symbol-interface
523    "This spanner draws the lines of a staff.  The middle line is
524 position 0."
525    (list
526     (property-description 'staff-space number? "")
527     (property-description 'line-count integer? "")
528     )))
529
530 (define stem-tremolo-interface
531   (lily-interface
532    'stem-tremolo-interface
533    ""
534    (list
535     (property-description 'stem ly-element? "pointer to the stem object.")
536     (property-description 'beam-width number? "")
537     (property-description 'beam-thickness number? "")
538     (property-description 'beam-space-function procedure? "")
539     )))
540
541 (define separation-item-interface
542   (lily-interface
543    'separation-item-interface
544    ""
545    (list
546     )))
547
548 (define sustain-pedal-interface
549   (lily-interface
550    'sustain-pedal-interface
551    ""
552    (list
553     )))
554 (define system-start-delimiter
555   (lily-interface
556    'system-start-delimiter
557    ""
558    (list
559     (property-description 'collapse-height number? "")
560     (property-description 'thickness number? "")
561     (property-description 'arch-height number? "")
562     (property-description 'arch-angle number? "")
563     (property-description 'arch-thick number? "")
564     (property-description 'arch-width number? "")
565     (property-description 'bracket-thick number? "")
566     (property-description 'bracket-width number? "")
567     )))
568
569 (define text-script-interface
570   (lily-interface
571    'text-script-interface
572    ""
573    (list
574     
575     )))
576
577 (define tie-interface
578   (lily-interface
579    'tie-interface
580    ""
581    (list
582     (property-description 'staffline-clearance number? "")
583     (property-description 'heads pair? "pair of element pointers, pointing to the two heads of the  tie. ")
584     (property-description 'details list? "")
585     (property-description 'thickness number? "")
586     (property-description 'x-gap number? "")
587     (property-description 'minimum-length number? "")
588     )))
589
590
591
592 (define tie-column-interface
593   (lily-interface
594    'tie-column-interface
595    ""
596    (list
597     )))
598
599 (define volta-bracket-interface
600   (lily-interface
601    'volta-bracket-interface
602    "Volta bracket with number"
603    (list
604     (property-description 'bars  list? "list of barline ptrs.")
605     (property-description 'thickness  number? "in stafflinethickness")
606     (property-description 'height  number? "in staffspace ")
607     )))
608
609 (define span-bar-interface
610   (lily-interface
611    'span-bar-interface
612    ""
613    (list
614     )))
615