]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-translator-properties.scm
* lily/translator-def.cc (get_translator_names): new function
[lilypond.git] / scm / define-translator-properties.scm
1 ;;;; translator-property-description.scm -- part of backend documentation
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c)  1998--2003  Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
7
8
9 (define-public all-translation-properties '())
10
11 (define (translator-property-description symbol type? description)
12  (if (not (equal? #f (object-property symbol 'translation-doc)))
13       (begin
14         (ly:warn (string-append "Redefining " (symbol->string symbol) "\n"))
15         (exit 2)
16       ))
17   
18   (set-object-property! symbol 'translation-type? type?)
19   (set-object-property! symbol 'translation-doc description)
20   (set! all-translation-properties (cons symbol all-translation-properties))
21   )
22
23
24
25 (translator-property-description 'acceptHashTable vector? "Internal
26 variable: store table with MusicName to Engraver entries.")
27 (translator-property-description 'acknowledgeHashTable vector?
28 "Internal variable: store interface to engraver smob table for current
29 context. Don't mess with this.")
30 (translator-property-description 'aDueText string? "text for begin of a due")
31 (translator-property-description 'alignBassFigureAccidentals boolean?
32                                  "If true, then the accidentals are aligned in bass figure context.")
33
34 (translator-property-description 'allowBeamBreak boolean?
35                                  "If true allow line breaks during beams.")
36 (translator-property-description 'associatedVoice string? "Name of the
37 Voice that has the melody for this LyricsVoice.")
38 (translator-property-description 'autoBeamSettings list? "Specifies
39 when automatically generated beams should begin and end.  The elements
40 have the format:
41
42 @example
43
44    function shortest-duration-in-beam time-signature
45
46 where
47
48     function = begin or end
49     shortest-duration-in-beam = numerator denominator; eg: 1 16
50     time-signature = numerator denominator, eg: 4 4
51
52 unspecified or wildcard entries for duration or time-signature
53 are given by * *
54
55 The user can override beam begin or end time by pushing a wildcard entries
56 '(begin * * * *) or '(end * * * *) resp., eg:
57
58     property Voice.autoBeamSettings push #'(end * * * *) = #(ly:make-moment 1 4)
59
60 The head of the list:
61     '(
62 ((end * * 3 2) . ,(ly:make-moment 1 2))
63 ((end 1 16 3 2) . ,(ly:make-moment 1 4))
64 ((end 1 32 3 2) . ,(ly:make-moment 1 8))
65      ...
66     )
67
68 @end example")
69
70 ;; "
71
72 (translator-property-description 'autoAccidentals list? "List of
73 different ways to typeset an accidental. All algorithms in the list
74 are tried, and the one returning the most accidentals is used.
75 Each entry is either a symbol containg a context name or a name-value
76 pair containing an algorithm-description.
77 The list must begin with a symbol (context name).
78 The symbols denote in which context THE FOLLOWING algorithms (until next symbol) 
79 will be interpreted. All notes in the interpretation context will share accidentals.
80 The contexts must be stated in order, innermost first.
81 The algorithms are:
82 @table @samp
83 @item same-octave:
84 This is the default algorithm. Accidentals are typeset if the note changes
85 the accidental of that note in that octave. Accidentals lasts to the end of the measure 
86 and then as many measures as specified in the value. I.e. 1 means to the end
87 of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever.
88 @item any-octave:
89 Accidentals are typeset if the note is different from 
90 the previous note on the same pitch in any octave. The value has same meaning as in
91 same-octave.
92 @end table
93 ")
94 (translator-property-description 'autoBeaming boolean? "If set to true
95 then beams are generated automatically.")
96
97 (translator-property-description 'autoCautionaries list? "List similar to
98 autoAccidentals, but it controls cautionary accidentals rather than
99 normal ones. Both lists are tried, and the one giving the most accidentals
100 wins. In case of draw, a normal accidental is typeset.
101 ")
102 (translator-property-description 'automaticBars boolean? " If set to true then bar lines will not be printed
103     automatically; they must be explicitly created with @code{bar}
104     keywords.  Unlike with the @code{cadenza} keyword, measures are
105     still counted.  Bar generation will resume according to that
106     count if this property is set to zero.
107 ")
108
109 (translator-property-description 'barAlways boolean? "If set to true a bar line is drawn after each note.
110 ")
111 (translator-property-description 'barCheckSynchronize boolean? "If
112 true then reset measurePosition when finding a barcheck. Turn off when
113 using barchecks in polyphonic music.")
114 (translator-property-description 'barNumberVisibility procedure? "Procedure that takes an int and returns whether the corresponding bar number should be printed")
115 (translator-property-description 'bassFigureFormatFunction procedure? "DOCME")
116 (translator-property-description 'beamMelismaBusy boolean? "Signal if a beam is set when automaticMelismata is set")
117 (translator-property-description 'beatLength ly:moment? "The length of one beat in this time signature.")
118 (translator-property-description 'beatGrouping list?
119                                  "List of beatgroups. Eg. in 5/8 time #(list 2 3).")
120
121
122 (translator-property-description 'breakableSeparationItem ly:grob?
123 "The breakable items in this time step, for this staff.")
124
125 (translator-property-description 'breakAlignOrder list? "Defines the order in which
126 prefatory matter (clefs, key signatures) appears, eg. this puts the
127 key signatures after the bar lines:
128
129 @example
130         \\property Score.breakAlignOrder = #'(
131           span-bar
132           breathing-sign
133           clef
134           staff-bar
135           key
136           time-signature
137         )
138 @end example
139 ")
140 (translator-property-description 'busyGrobs list? "
141 a queue of (END-MOMENT . GROB) conses. This is for internal (C++) use only.
142 Use at your own risk.  This property contains the grobs for which  END-MOMENT >= NOW.
143 ")
144
145 (translator-property-description 'centralCPosition number? "Place of
146 the central C, measured in half staffspaces.  Usually determined by
147 looking at clefPosition and clefGlyph.")
148
149 (translator-property-description
150  'changeMoment moment-pair?
151  "duration that voices are examined for differences, when
152 part-combining.  Usually unset or zero when combining threads into one
153 voice, and 1 (or the duration of one measure) when combining voices
154 into one staff.")
155
156 (translator-property-description
157  'chordNameFunction procedure?
158  "The function that converts lists of pitches to chord names.")
159 (translator-property-description
160  'chordNoteNamer procedure?
161  "Function that converts from a pitch object to a text markup. Used for single pitches.")
162 (translator-property-description
163  'chordRootNamer procedure?
164  "Function that converts from a pitch object to a text markup. Used for chords.")
165 (translator-property-description
166  'chordNameExceptions list?
167  "Alist of chord exceptions. Contains (CHORD . MARKUP) entries.")
168 (translator-property-description
169  'chordNameExceptionsFull list?
170  "Alist of chord exceptions. Contains (CHORD . (MARKUP)) entries.")
171 (translator-property-description
172  'chordNameExceptionsPartial list?
173  "Alist of partial chord exceptions. Contains (CHORD . (PREFIX-MARKUP SUFFIX-MARKUP)) entries.")
174 (translator-property-description
175  'chordNameSeparator markup?
176  "The markup object used to separate parts of a chord name.")
177
178 (translator-property-description 'chordChanges boolean? "Only show changes in chords scheme?")
179 (translator-property-description 'clefGlyph string? "Name of the symbol within the music font")
180 (translator-property-description 'clefOctavation integer? "Add
181 this much extra octavation. Values of 7 and -7 are common.")
182
183 (translator-property-description 'clefPosition number? "Where should
184 the center of the clef symbol go?  On systems with an odd number of
185 stafflines, the value 0 puts the clef on the middle staffline; a
186 positive value shifts it up, a negative value shifts it down.  The
187 unit of this distance is the half staff space.")
188
189 (translator-property-description 'combineParts boolean? "try to combine parts?")
190 (translator-property-description 'connectArpeggios boolean? " If
191 set, connect all arpeggios that are found.  In this way, you can make
192 arpeggios that cross staves.
193 ")
194 (translator-property-description 'createKeyOnClefChange boolean? "Print a key signature whenever the clef is changed.")
195 (translator-property-description 'crescendoText markup? "Text to print at start of non-hairpin crecscendo, ie: @samp{cresc.}")
196 (translator-property-description 'crescendoSpanner symbol? "Type of spanner to be used for crescendi.  One of: @samp{hairpin}, @samp{line}, @samp{dashed-line}, @samp{dotted-line}.  If unset, hairpin type is used.")
197 (translator-property-description 'decrescendoText markup? "Text to print at start of non-hairpin decrecscendo, ie: @samp{dim.}")
198 (translator-property-description 'currentBarNumber integer? "Contains the current barnumber. This property is incremented at
199 every barline.
200 ")
201 (translator-property-description 'currentCommandColumn ly:grob? "Grob that is X-parent to all current breakable (clef, key signature, etc.) items.")
202 (translator-property-description 'currentMusicalColumn ly:grob? "Grob that is X-parent to all non-breakable items (note heads, lyrics, etc.).")
203 (translator-property-description 'defaultBarType string? "Sets the default type of bar line.  Available bar types: [FIXME];
204
205 This variable is typically read at Score level, so overriding
206 Staff.defaultBarType will have no effect.
207
208 ")
209 (translator-property-description 'devNullThread symbol? "User control of Thread_devnull_engraver: one of
210 @table @samp
211 @item (), or unset
212 Behave in normal way: remove one set of grobs when in unisolo.
213 @item always:
214 Remove any grob that comes along.
215 @item never:
216 Do nothing.
217 @end table
218 ")
219 (translator-property-description 'devNullVoice symbol? "User control of Voice_devnull_engraver: one of
220 @table @samp
221 @item (), or unset
222 Behave in normal way: remove spanners when in unisolo.
223 @item always:
224 Remove any spanners that come along.
225 @item never:
226 Do nothing.
227 @end table
228 ")
229 (translator-property-description 'decrescendoSpanner symbol? "Type of spanner to be used for decrescendi.  One of: @samp{hairpin}, @samp{line}, @samp{dashed-line}, @samp{dotted-line}.  If unset, hairpin type is used.")
230
231 (translator-property-description 'dynamicAbsoluteVolumeFunction procedure? "
232 [DOCUMENT-ME]
233 ")
234 (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clef changes.")
235
236 (translator-property-description 'explicitKeySignatureVisibility
237 procedure? "visibility-lambda function for explicit Key changes;
238 \override of #'break-visibility will set the visibility for normal
239 (ie. at the start of the line) key signatures.")
240
241 (translator-property-description 'extraNatural boolean? "Whether to typeset an
242 extra natural sign before accidentals changing from a non-natural to 
243 another non-natural.
244 ")
245
246 (translator-property-description 'extraVerticalExtent number-pair?
247 "extra vertical extent, same format as MinimumVerticalExtent")
248
249
250 (translator-property-description 'finalizations list? "List of expressions to evaluate before proceeding to next time step. Internal variable.")
251 (translator-property-description 'followVoice boolean?
252                                  "if set, note heads are tracked  across staff switches by a thin line")
253 (translator-property-description 'fontSize number?
254                                  "Used to set the relative size of all grobs
255 in a context. This is done using the @code{Font_size_engraver}.")
256
257 (translator-property-description
258  'fingeringOrientations list?
259  "List of symbols, containing left, right, up and/or down. This list determines where fingerings are put wrt. to the chord being fingered.")
260
261 (translator-property-description 'forceClef boolean? "Show clef symbol, even if it hasn't changed. Only active for the first clef after the property is set, not for the full staff.")
262
263 (translator-property-description 'graceSettings vector?
264                                  "Overrides for grace notes. This
265 property should be manipulated through the @code{add-grace-property}
266 function.")
267
268 (translator-property-description 'highStringOne boolean? "Whether the
269 1st string is the string with highest pitch on the instrument (used by
270 the automatic string selector).")
271 (translator-property-description 'instr markup? "see @code{instrument}")
272 (translator-property-description 'instrument markup? " If @code{Instrument_name_engraver}
273 @cindex Instrument_name_engraver
274  is
275     added to the Staff translator, then the @code{instrument} property
276     is used to label the first line of the staff and the @code{instr}
277     property is used to label subsequent lines.  If the
278     @code{midiInstrument} property is not set, then @code{instrument}
279     is used to determine the instrument for MIDI output.")
280
281 (translator-property-description 'instrumentEqualizer procedure? "[DOCUMENT-ME]")
282 (translator-property-description 'instrumentSupport list? "
283 list of grobs to attach instrument name to. 
284 ")                               
285 (translator-property-description 'keyAccidentalOrder list? "
286 Alist that defines in what order  alterations should be printed.
287 The format is (NAME . ALTER), where NAME is from 0 .. 6 and ALTER from  -1, 1.
288 ")
289 (translator-property-description 'keySignature list? "The current key signature. This is an alist containing (NAME . ALTER) or ((OCTAVE . NAME) . ALTER) or ((OCTAVE . NAME) . (ALTER . BARNUMBER)) pairs, where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2. The optional barnumber contains the number of the measure of the accidental. FIXME: describe broken tie entries.")
290
291 (translator-property-description 'lastKeySignature list? "Last key
292 signature before a key signature change.")
293
294 (translator-property-description 'localKeySignature list? "the key
295 signature at this point in the measure.  The format is the same as for keySignature. Is reset at every bar line."
296
297 (translator-property-description 'localKeySignatureChanges list? "Experimental.
298  [DOCME]")
299 (translator-property-description 'majorSevenSymbol markup? "How should
300 the major7 be formatted in a chord name?")
301 (translator-property-description 'measureLength ly:moment? "Length of one
302 measure in the current time signature last?")
303 (translator-property-description 'measurePosition ly:moment? "How much
304 of the current measure (measured in whole notes) have we had.  This
305 can be set manually to create incomplete measures (anacrusis, upbeat),
306 the start of the music.
307 ")
308 (translator-property-description 'melismaBusy boolean? "Signifies
309 whether a melisma is active. This can be used to signal melismas on
310 top of those automatically detected. ")
311 (translator-property-description 'melismaBusyProperties list?
312                                  "List of  properties (symbols) to
313 determine whether a melisma  is playing.")
314
315
316 (translator-property-description 'metronomeMarkFormatter procedure?
317                                  "How to produce a metronome markup.
318 Called with 2 arguments,  event and context.")
319 (translator-property-description 'midiInstrument string? "Name of the
320 MIDI instrument to use ")
321 (translator-property-description 'midiMinimumVolume number? "[DOCUMENT-ME]")
322 (translator-property-description 'midiMaximumVolume number? "[DOCUMENT-ME]")
323 (translator-property-description 'minimumFret number? "The tablature
324 auto string-selecting mechanism selects the highest string with a fret
325 not less than minimumFret")
326 (translator-property-description 'minimumVerticalExtent number-pair?
327 "minimum vertical extent, same format as VerticalExtent")
328 (translator-property-description 'recordEventSequence procedure?
329                                  "Upon termination of this context,
330 this function is called with current context and a list of music
331 objects.  The list of contains entries with start times, music objects
332 and whether they're processed in this context.")
333
334 (translator-property-description 'noDirection boolean? "Don't set directions by a2-engraver when part-combining.")
335 (translator-property-description
336  'originalCentralCPosition integer?
337  "Used for temporary overriding central C in octavation brackets. ")
338 (translator-property-description 'othersolo boolean? "FIXME")
339 (translator-property-description 'ottavation string? "If set, the text
340 for an 8va spanner. Changing this implies a new text spanner. ")
341 (translator-property-description 'pedalSustainStrings list? "List of   string to print for sustain-pedal. Format is
342  (UP UPDOWN DOWN), where each of the three is the string to print when
343 this is done with the pedal.")
344 (translator-property-description 'pedalUnaCordaStrings list? "see pedalSustainStrings.")
345 (translator-property-description 'pedalSostenutoStrings list? "see pedalSustainStrings.")
346 (translator-property-description 'pedalSustainStyle symbol? "A symbol
347 that indicates how to print sustain pedals: text, bracket or mixed
348 (both).")
349 (translator-property-description 'pedalUnaCordaStyle symbol? "see pedalSustainStyle.")
350 (translator-property-description 'pedalSostenutoStyle symbol? "see pedalSustainStyle.")
351
352 (translator-property-description 'rehearsalMark number-or-string? "The
353 last rehearsal mark printed.")
354 (translator-property-description 'repeatCommands list? "This property is read to find any command of the form (volta . X), where X is a string or #f")
355 (translator-property-description 'scriptDefinitions list? "
356 Description of scripts. This is used by Script_engraver for typesetting note-super/subscripts. See @file{scm/script.scm} for more information
357 ")
358
359 (translator-property-description 'restNumberThreshold number?
360                                  "If a multimeasure rest takes less
361 than this number of measures, no number is printed. ")
362
363 (translator-property-description 'scriptHorizontal boolean? "  Put
364 scripts left or right of note heads.  Support for this is limited.
365 Accidentals will collide with scripts.
366 ")
367 (translator-property-description 'skipBars boolean? "If set to true, then
368 skip the empty bars that are produced by multimeasure notes and rests.
369 These bars will not appear on the printed output.  If not set (the
370 default) multimeasure notes and rests expand into their full length,
371 printing the appropriate number of empty bars so that synchronization
372 with other voices is preserved.
373
374
375 @example
376 @@lilypond[fragment,verbatim,center]
377 r1 r1*3 R1*3  \\\\property Score.skipBars= ##t r1*3 R1*3
378
379 @@end lilypond
380 @end example
381
382 ")
383 (translator-property-description 'skipTypesetting boolean?
384                                  "When true, all no typesetting is done at
385 this moment, causing  the interpretation phase to go a lot faster. This can
386 help with debugging large scores.")
387 (translator-property-description 'slurMelismaBusy boolean? "Signal a slur if automaticMelismata is set.")
388 (translator-property-description 'solo boolean? "set if solo is detected by the part combiner.")
389 (translator-property-description 'soloADue boolean? "set Solo/A due texts in the part combiner?.")
390 (translator-property-description 'soloIIText string? "text for begin of solo for voice ``two'' when part-combining.")
391 (translator-property-description 'soloText string? "text for begin of solo when part-combining.")
392 (translator-property-description 'sparseTies boolean? "only create one tie per chord.")
393 (translator-property-description 'splitInterval number-pair? "part-combiner will separate its two voices (or threads) when interval between the two voices is contained in this range.")
394 (translator-property-description 'split-interval boolean? "set if part-combiner separated voices based on splitInterval.")
395 (translator-property-description 'squashedPosition integer? " Vertical position of
396 squashing for Pitch_squash_engraver.")
397 (translator-property-description 'stringOneTopmost boolean? "Whether the 1st string is printed on the
398 top line of the tablature.")
399 (translator-property-description 'stavesFound list? "list of all staff-symbols found.")
400 (translator-property-description 'stanza markup? "Stanza `number' to
401 print before the start of a verse. Use in LyricsVoice context.")
402 (translator-property-description 'stemLeftBeamCount integer? "
403 Specify the number of beams to draw on the left side of the next note.
404 Overrides automatic beaming.  The value is only used once, and then it
405 is erased.
406 .")
407 (translator-property-description 'stemRightBeamCount integer? "idem, for the right side.")
408 (translator-property-description 'stringTunings list? "The tablature strings tuning. Must be a list of the different semitons pitch of each string (starting by the lower one).")
409 (translator-property-description 'subdivideBeams boolean? "If set, multiple beams will be subdivided at beat
410 positions - by only drawing one beam over the beat.")
411 (translator-property-description 'systemStartDelimiter symbol? "Which grob to make for the start of the system/staff? Set to @code{SystemStartBrace}, @code{SystemStartBracket} or @code{SystemStartBar}.")
412 (translator-property-description 'tablatureFormat procedure?
413                                  "Function formatting a tab notehead; it takes
414 a string number, a list of string tunings and Pitch object. It returns the text as a string.")
415
416 (translator-property-description 'tieMelismaBusy boolean? "Signal ties when automaticMelismata is set.")
417 (translator-property-description 'timeSignatureFraction number-pair? "
418 pair of numbers,  signifying the time signature. For example #'(4 . 4) is a 4/4time signature.")
419 (translator-property-description 'timing boolean? " Keep administration of measure length, position, bar number, etc?
420 Switch off for cadenzas.")
421 (translator-property-description 'tonic ly:pitch?
422                                  "The tonic of the current scale")
423 (translator-property-description 'transposing integer? "Transpose the MIDI output.  Set this property to the number of half-steps to transpose by.")
424 (translator-property-description 'tremoloFlags integer? "Number of tremolo flags to add if none is specified.")
425 (translator-property-description 'tupletNumberFormatFunction procedure?
426                                  "Function taking a music as input, producing a string. This function is called to determine the text to print on a tuplet bracket.")
427
428
429 ;; remove this? 
430 (translator-property-description 'tupletInvisible boolean? "
431     If set to true, tuplet bracket creation is switched off
432 entirely. This has the same effect as setting both
433 @code{tupletNumberVisibility} and @code{tupletBracketVisibility} to
434 @code{#f}, but as this does not even create any grobs, this setting
435 uses less memory and time.")
436
437 (translator-property-description 'tupletSpannerDuration ly:moment? "
438 Normally a tuplet bracket is as wide as the
439 @code{  imes} expression that gave rise to it. By setting this
440 property, you can make brackets last shorter. Example
441
442 @example
443 @@lilypond[verbatim,fragment]
444 context Voice   imes 2/3 @{
445   property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
446   c-[8 c c-] c-[ c c-]
447 @}
448 @@end lilypond
449 @end example
450 .")
451 (translator-property-description 'unirhythm boolean? "set if unirhythm is detected by the part combiner.")
452 (translator-property-description 'unisilence boolean? "set if unisilence is detected by the part combiner.")
453 (translator-property-description 'unison boolean? "set if unisono is detected  by the part combiner. .")
454 (translator-property-description 'verticalAlignmentChildCallback
455 procedure? "what callback to add to children of a vertical alignment.
456 It determines what alignment procedure is used on the alignment
457 itself.  .")
458 (translator-property-description 'verticalExtent number-pair? "hard
459 coded vertical extent.  The format is a pair of dimensions, for
460 example, this sets the sizes of a staff to 10 (5+5) staffspaces high.
461
462 @example
463 property Staff.verticalExtent = #(-5.0 . 5.0)
464 @end example
465
466 VerticalExtent, MinimumVerticalExtent and ExtraVerticalExtent are
467 predefined in all relevant contexts to @code{#f}, so they will not
468 inherit values.
469
470 Note that these VerticalExtents can only operate on vertical groups,
471 and therefore only work in contexts which contain an
472 @code{Axis_group_engraver}.
473 ")
474
475 (translator-property-description 'voltaOnThisStaff boolean?
476  "Normally, volta brackets are put only on the topmost staff. Setting
477 this variable to true, will force a bracket to be on this staff as
478 well.")
479
480 (translator-property-description 'voltaSpannerDuration ly:moment? "maximum duration of the volta bracket.
481
482     Set to a duration to control the size of the brackets printed by
483 @code{\\alternative}.  It specifies the number of whole notes duration
484 to use for the brackets.  This can be used to shrink the length of
485 brackets in the situation where one alternative is very large.  It may
486 have odd effects if the specified duration is longer than the music
487 given in an @code{\\alternative}.
488 .")
489 (translator-property-description 'whichBar string?
490                                  "This property is read to determine what type of barline to create.
491
492 Example:
493 @example
494 \\property Staff.whichBar = \"|:\"
495 @end example
496
497 This will create a start-repeat bar in this staff only.
498
499 If not set explicitly (by property or @code{\bar}), this is set
500 according to values of @code{defaultBarType}, @code{barAlways},
501 @code{barNonAuto} and @code{measurePosition}.
502
503 Valid values are described in @ref{(lilypond-internals)bar-line-interface}.
504
505 .")
506
507
508 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
509
510 (define-public default-melisma-properties '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))