]> git.donarmstrong.com Git - lilypond.git/blob - scm/interface.scm
patch::: 1.3.111.jcn1
[lilypond.git] / scm / interface.scm
1
2
3 ; should include default value?
4
5
6 ;;; FIXME: naming.
7 ;;; Score elements are called `objects' now and then, which gets
8 ;;; rather confusing, we now have `elements', `items', `spanners'
9 ;;; and `objects'.
10
11
12 (define (lily-interface symbol description props)
13   (list symbol
14         description
15         props
16         )
17   )
18
19
20 (define (element-description name . interfaces)
21   (let* ((ifs (cons general-element-interface interfaces))
22          (props (map caddr ifs))
23 ;        (prop-typep-pairs (map (lambda (x) (cons (car x) (cadr x)))
24 ;                                       (apply append props)))
25          (syms (map car ifs))
26         )
27     (list (cons 'separator "\n\n\n")    ;easy printing.
28           (cons 'name name)
29           (cons 'interfaces syms)
30           (cons 'interface-descriptions ifs)
31           ; (cons 'interface-descriptions (cadr merged))
32           ;; description of the element itself?
33 ;         (cons 'properties prop-typep-pairs)
34   )))
35
36 (define general-element-interface
37   (lily-interface
38    'general-element-interface
39    "All elements support this"
40    '(
41     X-offset-callbacks 
42     Y-offset-callbacks 
43     X-extent-callback 
44     Y-extent-callback 
45     font-relative-size 
46     extra-offset 
47     interfaces  
48     dependencies 
49     no-spacing-rods 
50     extra-extent-X 
51     extra-extent-Y 
52     minimum-extent-X 
53     minimum-extent-Y 
54     origin 
55     transparent 
56     ))
57   )
58
59 (define beam-interface
60   (lily-interface
61    'beam-interface
62    "A beam.
63
64 #'thickness= weight of beams, in staffspace
65   "
66    '(
67     y-position 
68     height 
69     flag-width-function 
70     damping 
71     default-neutral-direction 
72     thickness 
73     space-function 
74     beamed-stem-shorten 
75     height-quants 
76     vertical-position-quant-function 
77     damping 
78     outer-stem-length-limit 
79     slope-limit 
80     )
81    ))
82
83 (define clef-interface
84   (lily-interface
85    'clef-interface
86    "A clef sign"
87    '(
88     non-default 
89     full-size-change 
90     glyph 
91     ))
92   )
93
94 (define axis-group-interface
95   (lily-interface
96    'axis-group-interface
97    "a group of coupled elements"
98    '(
99     axes 
100    )))
101
102 (define note-column-interface
103   (lily-interface
104    'note-column-interface
105    "Stem and noteheads combined"
106    '(
107     horizontal-shift 
108     force-hshift 
109     ))
110   )
111
112 (define stem-interface
113   (lily-interface
114    'stem-interface
115    "A stem"
116    '(
117     thickness 
118     beamed-lengths 
119     beamed-minimum-lengths 
120     stem-centered 
121     lengths 
122     beam 
123     stem-shorten 
124     duration-log 
125     beaming 
126     default-neutral-direction 
127     stem-end-position 
128     support-head 
129     heads 
130     direction 
131     stem-length 
132     style 
133     flag-style 
134     dir-forced 
135     )))
136
137
138 (define slur-interface
139   (lily-interface
140    'slur-interface
141    "A slur"
142    '(
143     de-uglify-parameters 
144     details 
145     attachment 
146     direction 
147    attachment-offset 
148      beautiful 
149      y-free 
150      control-points 
151      extremity-rules  
152      extremity-offset-alist 
153      thickness 
154      dashed 
155
156     )
157    )
158   )
159
160 (define side-position-interface
161   (lily-interface
162    'side-position-interface
163    "Position a victim object (this one) next to other objects (the support).
164 #'direction = where to put the victim object (left or right?)
165 "
166    '(
167    side-support 
168    direction-source 
169     direction 
170     side-relative-direction 
171     minimum-space 
172     padding 
173     self-alignment-X 
174     self-alignment-Y 
175     
176     )
177   ))
178
179 (define accidentals-interface
180   (lily-interface
181    'accidentals-interface
182    "Accidentals"
183    '(
184     left-padding 
185     right-padding 
186     )
187    ))
188
189 (define line-of-score-interface
190   (lily-interface
191    'line-of-score-interface
192    "Super element, parent of all:
193
194 The columns of a score that form one line.  The toplevel element.  Any
195 element has a Line_of_score as both X and Y reference point. The
196 Paper_score contains one element of this type. Control enters the
197 Grob dependency calculation from this single Line_of_score
198 object."
199    '(
200     between-system-string 
201     spacing-procedure 
202     before-line-breaking-callback
203     after-line-breaking-callback 
204     all-elements 
205     columns 
206     )))
207
208 (define note-head-interface
209   (lily-interface
210    'note-head-interface
211    "Note head"
212    '(
213     style 
214     )
215    ))
216
217 (define note-name-interface
218   (lily-interface
219    'note-name-interface
220    "Note name"
221    '(
222     style 
223     )
224    ))
225
226
227 (define rhythmic-head-interface
228   (lily-interface
229    'rhythmic-head-interface
230    "Note head or rest"
231    '(
232     dot 
233     stem 
234     duration-log 
235     )))
236
237 (define rest-interface
238   (lily-interface
239    'rest-interface
240    "a rest"
241    '(style )))
242
243 (define tuplet-bracket-interface
244   (lily-interface
245    'tuplet-bracket-interface
246    "A bracket with a number in the middle, used for tuplets." 
247    '(
248     beams 
249     columns 
250     number-gap 
251     delta-y 
252     tuplet-bracket-visibility 
253     tuplet-number-visibility 
254     parallel-beam 
255     thick 
256     )
257 ))
258
259
260 (define align-interface
261   (lily-interface
262    'align-interface
263    " Order elements top to bottom/left to right/right to left etc."
264    '(
265     stacking-dir  
266     align-dir  
267     threshold  
268     alignment-done  
269     center-element 
270     elements  
271     axes  
272     )))    
273
274 (define aligned-interface
275   (lily-interface
276    'aligned-interface
277    "read by align-interface"
278    '(
279     minimum-space 
280     extra-space 
281     )))
282
283 (define break-aligned-interface
284   (lily-interface
285    'break-aligned-interface
286    "Items that are aligned in prefatory matter"
287    '(
288     break-align-symbol 
289     visibility-lambda 
290     breakable 
291     )))
292
293 (define chord-name-interface
294   (lily-interface
295    'chord-name-interface
296    "generate a chord name"
297    '( pitches inversion bass)))
298
299 (define time-signature-interface
300   (lily-interface
301    'time-signature-interface
302    "A time signature, in different styles"
303    '( fraction style )))
304
305 (define bar-line-interface
306   (lily-interface
307    'bar-line-interface
308    "Bar line.
309
310 This is a request to print a special bar symbol. It replaces the 
311 regular bar symbol with a special
312 symbol.  The argument @var{bartype} is a string which specifies the
313 kind of bar to print.  Options are @code{\":|\"}
314 @cindex \"|A@@@code{:|}
315 ,
316 @code{\"|:\"}
317 @cindex \"|B@@@code{|:}
318 , @code{\":|:\"}
319 @cindex \"|C@@@code{:|:}
320 ,
321 @code{\"||\"}
322 @cindex \"|D@@@code{||}
323 , @code{\"|.\"}
324 @cindex \"|E@@@code{|.}
325 ,
326 @code{\".|\"}
327 @cindex \"|F@@@code{.|}
328 , and @code{\".|.\"}
329 @cindex \"|G@@@code{.|.}
330
331
332 These produce, respectively, a right repeat, a left repeat, a double
333 repeat, a double bar, a start bar, an end bar, and a thick double bar.
334 If @var{bartype} is set to @code{\"empty\"} then nothing is printed,
335 but a line break is allowed at that spot.
336
337 "
338    '( barsize-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function )))
339
340 (define hairpin-interface
341   (lily-interface
342    'hairpin-interface
343    "hairpin crescendo.
344
345 padding -- horizontal padding. This is useful if a crescendo is set next to a text like `mf'
346
347 "
348    '( grow-direction thickness height padding )
349    ))
350
351 (define arpeggio-interface
352   (lily-interface
353    'arpeggio-interface
354    "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
355    '(stems)
356    )
357   )
358
359 (define note-collision-interface
360   (lily-interface
361    'note-collision-interface
362    "An object that handles collisions between notes with different
363 stem directions and horizontal shifts. Most of the interesting
364 properties are to be set in @ref{note-column-interface}"
365    '(merge-differently-dotted note-width)
366    ))
367
368
369 (define custos-interface
370   (lily-interface
371    'custos-interface
372    "A custos is a staff context symbol that appears at the end of a
373   staff line with monophonic musical contents (i.e. with a single
374   voice).  It anticipates the pitch of the first note of the following
375   line and thus helps the player or singer to manage line breaks
376   during performance, thus enhancing readability of a score.
377
378   Custodes were frequently used in music notation until the 16th
379   century.  There were different appearences for different notation
380   styles.  Nowadays, they have survived only in special forms of
381   musical notation such as via the editio vaticana dating back to the
382   beginning of the 20th century.
383
384 [TODO: add to glossary]"
385  
386    '(style)
387 )
388   )
389
390
391
392
393 (define dot-interface
394   (lily-interface
395    'dots-interface
396    "The dots to go with a notehead/rest.  A separate interface, since they
397   are a party in collision resolution.
398  #'direction is the Direction to handle staff-line collisions in."
399    '(direction dot-count)
400
401    )) 
402
403 (define font-interface
404   (lily-interface
405    'font-interface
406    "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)"
407    '(font-style font-series font-shape font-family font-name
408 font-point-size font-relative-size)
409    ))
410
411
412 (define text-interface
413   (lily-interface
414    'text-interface
415    "A scheme markup text"
416    '(text align lookup raise kern magnify)))
417
418 (define dot-column-interface
419   (lily-interface
420    'dot-column-interface
421    "Interface that groups dots so they form a column"
422    '( )
423    ))
424
425 (define dynamic-interface
426   (lily-interface
427    'dynamic-interface
428    "Any kind of loudness sign"
429    '()
430     ))
431
432
433 (define finger-interface
434   (lily-interface
435    'finger-interface
436    "A fingering instruction"
437    '()
438     ))
439
440 (define separation-spanner-interface
441   (lily-interface
442    'separation-spanner-interface
443    "Spanner that containing @code{separation-item-interface} elements to calculate rods"
444    '()
445   ))
446 (define text-script-interface
447   (lily-interface
448    'text-script-interface
449    "Any text script"
450    '()
451     ))
452
453 (define grace-alignment-interface
454   (lily-interface
455    'grace-alignment-interface
456    "put grace notes in line"
457    '(
458     horizontal-space 
459     )
460    ))
461
462 (define hara-kiri-group-interface
463   (lily-interface
464    'hara-kiri-group-interface
465    "  As Vertical_group_spanner, but keep track of interesting items.  If
466   we don't contain any interesting items after linebreaking, then
467   gracefully commit suicide.  Objective: don't disgrace Lily by
468   typesetting empty lines in orchestral scores."
469    '(
470     items-worth-living 
471
472
473     )))
474
475 (define line-spanner-interface
476   (lily-interface
477    'line-spanner-interface
478    "generic line spanner"
479    '(
480     dash-period 
481     dash-length 
482     line-thickness 
483     type 
484     )
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     
495     thickness 
496     height 
497
498     minimum-length 
499     word-space 
500     )))
501
502 (define key-signature-interface
503   (lily-interface
504    'key-signature-interface
505    "A group of  accidentals."
506    '(
507     c0-position  
508     old-accidentals  
509     new-accidentals  
510     )))
511
512 (define lyric-extender-interface
513   (lily-interface
514    'lyric-extender-interface
515    "The extender is a simple line at the baseline of the lyric
516   that helps show the length of a melissima (tied/slurred note)."
517    '(
518     word-space  
519     height  
520     right-trim-amount  
521     )))
522
523
524 (define lyric-syllable-interface
525   (lily-interface
526    'lyric-syllable-interface
527    "a single piece of lyrics"
528    '(
529     word-space  
530     )))
531
532
533 (define mark-interface
534   (lily-interface
535    'mark-interface
536    "a rehearsal mark"
537    '(
538     )))
539
540 (define multi-measure-rest-interface
541   (lily-interface
542    'multi-measure-rest-interface
543    "A rest that spans a whole number of measures.  For typesetting the
544 numbers, fields from font-interface may be used.
545
546 padding is the space between number and rest. Measured in staffspace.
547  
548 "
549    '(
550     
551     columns  
552     expand-limit  
553     minimum-width 
554     padding  
555     )))
556
557 (define paper-column-interface
558   (lily-interface
559    'paper-column-interface
560    ""
561    '(
562     column-space-strength 
563     before-musical-spacing-factor 
564     stem-spacing-correction 
565     before-grace-spacing-factor 
566     when 
567     bounded-by-me 
568     dir-list  
569     shortest-playing-duration  
570     shortest-starter-duration  
571     contains-grace  
572     extra-space  
573     stretch-distance 
574     )))
575
576 (define spaceable-element-interface
577   (lily-interface
578    'spaceable-element-interface
579    "An element (generally a Paper_column) that takes part in the
580 spacing problem. "
581    '(
582      minimum-distances 
583      ideal-distances  
584      dir-list 
585      )))
586
587 (define rest-collision-interface
588   (lily-interface
589    'rest-collision-interface
590    "Move around ordinary rests (not multi-measure-rests) to avoid
591 conflicts."
592    '(
593     maximum-rest-count 
594     minimum-distance 
595     elements 
596     )))
597
598 (define script-interface
599   (lily-interface
600    'script-interface
601    ""
602    '(
603     script-priority 
604     )))
605
606 (define script-column-interface
607   (lily-interface
608    'script-column-interface
609    "An interface that sorts scripts according to their @code{script-priority}"
610    '( )))
611
612
613 (define spacing-spanner-interface
614   (lily-interface
615    'spacing-spanner-interface
616    " SPACE = arithmetic_multiplier * ( C + log2 (TIME) ))
617 The space taken by a note is determined by the formula 
618
619   
620
621 where TIME is the amount of time a note occupies.  The value of C is
622 chosen such that the smallest space within a measure is
623 arithmetic_basicspace:
624
625   C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) 
626
627 The smallest space is the one following the shortest note in the
628 measure, or the space following a hypothetical 1/8 note.  Typically
629 arithmetic_basicspace is set to a value so that the shortest note
630 takes about two noteheads of space (ie, is followed by a notehead of
631 space):
632
633 @example
634    2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) ))
635
636    @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @}
637    @{ assuming: SHORTEST <= 1/8 @}
638
639                = arithmetic_multiplier *
640                ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) )
641
642                = arithmetic_multiplier * arithmetic_basicspace
643
644    @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @}
645
646                = quartwidth * arithmetic_basicspace
647
648    =>          
649
650    arithmetic_basicspace = 2/1 = 2
651
652
653 If you want to space your music wider, use something like:
654
655    arithmetic_basicspace = 4.;
656
657 @end example"
658    '(
659   maximum-duration-for-spacing 
660     arithmetic-basicspace 
661     arithmetic-multiplier 
662     
663     )))
664
665 (define staff-symbol-interface
666   (lily-interface
667    'staff-symbol-interface
668    "This spanner draws the lines of a staff.  The middle line is
669 position 0."
670    '(
671     staff-space 
672     line-count 
673     )))
674
675 (define stem-tremolo-interface
676   (lily-interface
677    'stem-tremolo-interface
678    ""
679    '(
680     stem 
681     beam-width 
682     beam-thickness 
683     beam-space-function 
684     )))
685
686 (define separation-item-interface
687   (lily-interface
688    'separation-item-interface
689    "Item that computes widths to generate spacing rods.
690
691 Calc dimensions for the Separating_group_spanner; this has to be
692    an item to get dependencies correct.  It can't be an element_group
693    since these usually are in a different X_group
694 "
695    '(
696     elements 
697      )))
698
699 (define sustain-pedal-interface
700   (lily-interface
701    'sustain-pedal-interface
702    ""
703    '(
704     )))
705 (define system-start-delimiter-interface
706   (lily-interface
707    'system-start-delimiter-interface
708    "#'style can be bar-line, bracket or brace"
709    '(collapse-height thickness arch-height arch-angle arch-thick
710                      arch-width bracket-thick bracket-width glyph )))
711
712 (define text-spanner-interface
713   (lily-interface
714    'text-spanner-interface
715    "generic text spanner"
716    '(
717     dash-period  
718     dash-length 
719     line-thickness 
720     edge-height 
721     edge-text 
722     type 
723     )
724 ))
725
726 (define tie-interface
727   (lily-interface
728    'tie-interface
729    "A tie connecting two noteheads.
730 direction = Forced direction for all ties"
731    
732    '(
733     staffline-clearance 
734     control-points 
735     heads 
736     details 
737     thickness 
738     x-gap 
739     direction 
740     minimum-length 
741     )))
742
743
744
745 (define tie-column-interface
746   (lily-interface
747    'tie-column-interface
748    "that sets tie directions in a tied chord"
749    '(direction)
750    ))
751
752 (define volta-bracket-interface
753   (lily-interface
754    'volta-bracket-interface
755    "Volta bracket with number"
756    '(
757     bars  
758     thickness  
759     height  
760     )))
761
762 (define span-bar-interface
763   (lily-interface
764    'span-bar-interface
765    ""
766    '(
767     )))
768
769
770
771