]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-context-properties.scm
(accurate_boxes): enlarge Y-extent of flat to
[lilypond.git] / scm / define-context-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--2004  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   symbol
22   )
23
24 (define-public all-user-translation-properties
25   (map
26    (lambda (x)
27      (apply translator-property-description x))
28    `(
29      (aDueText ,string? "Text to print at a unisono passage.")
30      (alignBassFigureAccidentals ,boolean?
31                                  "If true, then the accidentals are aligned in bass figure context.")
32
33      (allowBeamBreak ,boolean? "If true allow line breaks for  beams over barlines.")
34      (associatedVoice ,string? "Name of the
35 @code{Voice} that has the melody for this @code{Lyrics} line.")
36      (autoBeamSettings ,list? "Specifies
37 when automatically generated beams should begin and end.
38 See @usermanref{Setting automatic beam behavior} for more information.
39 ")
40      (autoAccidentals ,list? "List of
41 different ways to typeset an accidental.
42
43 For determining when to print an accidental, several different rules
44 are tried.  The rule that gives the highest number of accidentals is
45 used.  Each rule consists of
46
47 @table @var
48
49 @item context:
50       In which context is the rule applied. For example, if
51 @var{context} is @internalsref{Score} then all staves share
52 accidentals, and if @var{context} is @internalsref{Staff} then all
53 voices in the same staff share accidentals, but staves do not.
54
55 @item octavation:
56       Whether the accidental changes all octaves or only the current
57       octave. Valid choices are 
58
59      @table @samp
60       @item same-octave:
61       This is the default algorithm. Accidentals are typeset if the note changes
62       the accidental of that note in that octave. Accidentals lasts to the end of the measure 
63       and then as many measures as specified in the value. I.e. 1 means to the end
64       of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever.
65       @item any-octave:
66       Accidentals are typeset if the note is different from 
67       the previous note on the same pitch in any octave. The value has same meaning as in
68       same-octave.
69       @end table
70
71 @item laziness
72
73 Over how many bar lines the accidental lasts.
74 If @var{laziness} is @code{-1} then the accidental is forget
75 immediately, and if @var{laziness} is @code{#t} then the accidental
76 lasts forever.
77 @end table
78 ")
79      (autoBeaming ,boolean? "If set to true then beams are generated
80 automatically.")
81
82      (autoCautionaries ,list? "List similar to
83 @code{autoAccidentals}, but it controls cautionary accidentals rather than
84 normal ones. Both lists are tried, and the one giving the most accidentals
85 wins. In case of draw, a normal accidental is typeset.
86 ")
87      (automaticBars ,boolean? " If set to true then bar lines will not be
88 printed automatically; they must be explicitly created with
89 @code{\\bar} command.  Unlike the @code{\\cadenza} keyword, measures
90 are still counted.  Bar generation will resume according to that count
91 if this property is unset.
92 ")
93
94      (barAlways ,boolean? "If set to true a bar line is drawn after each
95 note.")
96
97      (barCheckSynchronize ,boolean? "If true then reset @code{measurePosition}
98 when finding a barcheck.")
99
100      (barNumberVisibility ,procedure? "Procedure that takes an int and
101 returns whether the corresponding bar number should be printed")
102      (bassFigureFormatFunction ,procedure? "Procedure that produces a markup text. It takes a list of @code{BassFigureEvent}s, and a context.")
103      (beatLength ,ly:moment? "The length of one beat in this time signature.")
104      (beatGrouping ,list?
105                    "List of beatgroups. Eg. in 5/8 time @code{'(2 3)}.")
106
107
108      (breakAlignOrder ,list? "Defines the order in which
109 prefatory matter (clefs, key signatures) appears, eg. this puts the
110 key signatures after the bar lines:
111
112 @example
113         \\property Score.breakAlignOrder = #'(
114           span-bar
115           breathing-sign
116           clef
117           staff-bar
118           key
119           time-signature
120         )
121 @end example
122 ")
123
124      (middleCPosition ,number? "Place of the middle C, measured in half
125 staffspaces.  Usually determined by looking at @code{clefPosition} and
126 @code{clefGlyph}.")
127
128      (chordNameFunction ,procedure?
129                         "The function that converts lists of pitches to chord names.")
130      (chordNoteNamer ,procedure?
131                      "Function that converts from a pitch object to a text markup. Used for single pitches.")
132      (chordRootNamer ,procedure?
133                      "Function that converts from a pitch object to a text markup. Used for chords.")
134      (chordNameExceptions ,list?
135                           "Alist of chord exceptions.
136 Contains (@var{chord} . @var{markup}) entries.")
137      (chordNameExceptionsFull ,list?
138                               "Alist of chord exceptions.
139 Contains (@var{chord} . @var{markup}) entries.")
140      (chordNameExceptionsPartial
141       ,list?
142       "Alist of partial chord exceptions. Contains (@var{chord} . (@var{prefix-markup} @var{suffix-markup})) entries.")
143      
144      (chordNameSeparator ,markup?
145                          "The markup object used to separate
146  parts of a chord name.")
147      (chordChanges ,boolean? "Only show changes in chords scheme?")
148      (clefGlyph ,string? "Name of the symbol within the music font.")
149      (clefOctavation ,integer? "Add
150 this much extra octavation. Values of 7 and -7 are common.")
151
152      (clefPosition ,number? "Where should the center of the clef
153 symbol go, measured in half staff spaces from the center of the staff.")
154
155      (connectArpeggios ,boolean? " If set, connect arpeggios across
156 piano staff.")
157      (createKeyOnClefChange ,boolean? "Print a key signature whenever the clef is changed.")
158      (crescendoText ,markup? "Text to print at start of non-hairpin crecscendo, ie: @samp{cresc.}")
159      (crescendoSpanner ,symbol? "Type of spanner to be used for crescendi.
160 One of: @samp{hairpin}, @samp{line}, @samp{dashed-line},
161 @samp{dotted-line}.  If unset, hairpin type is used.")
162      (decrescendoText ,markup? "Text to print at start of non-hairpin decrecscendo, ie: @samp{dim.}")
163
164      (drumPitchTable ,hash-table? "A table mapping percussion
165 instruments (symbols) to pitches.")
166
167      (drumStyleTable ,hash-table? "A hash table containing mapping
168 drums to layout settings.  Predefined values: @samp{drums-style},
169 @samp{timbales-style}, @samp{congas-style}, @samp{bongos-style} and
170 @samp{percussion-style}.
171
172 The layout style is a hash table, containing the drum-pitches (eg. the
173 symbol @samp{hihat}) as key, and a list (@var{notehead-style}
174 @var{script} @var{vertical-position}) as values.
175  ")
176      (currentBarNumber ,integer? "Contains the current barnumber. This property is incremented at
177 every barline.
178 ")
179      (defaultBarType ,string? "Sets the default type of bar line.
180 See @code{whichBar} for information on available bar types.
181
182 This variable is  read by @internalsref{Timing_engraver} at
183 @internalsref{Score} level.
184 ")
185
186      (decrescendoSpanner ,symbol? "See @code{crescendoSpanner}.")
187
188      (explicitClefVisibility ,procedure? "@samp{break-visibility} function for clef changes.")
189
190      (explicitKeySignatureVisibility ,procedure?
191 "@samp{break-visibility} function for explicit key
192 changes. @samp{\\override} of @samp{#'break-visibility} will set the
193 visibility for normal (i.e. at the start of the line) key signatures.")
194
195      (extraNatural ,boolean? "Whether to typeset an
196 extra natural sign before accidentals changing from a non-natural to 
197 another non-natural.")
198
199      (extraVerticalExtent ,number-pair?
200                           "extra vertical extent, same format as @var{minimumVerticalExtent}")
201
202
203      (followVoice ,boolean? "if set, note heads are tracked across staff
204 switches by a thin line")
205
206      (fontSize ,number?
207                "The relative size of all grobs in a context. ")
208
209      (fingeringOrientations ,list?
210                             "List of symbols, containing
211 @samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list
212 determines where fingerings are put relative to the chord being
213 fingered.")
214
215      (forceClef ,boolean? "Show clef symbol, even if it has not
216 changed. Only active for the first clef after the property is set, not
217 for the full staff.")
218
219      (highStringOne ,boolean? "Whether the 1st string is the string with
220 highest pitch on the instrument. This used by the automatic string
221 selector for tab notation.")
222
223      (ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics} line.")
224      (instr ,markup? "See @code{instrument}")
225
226      (instrument ,markup? "The name to print left of a staff.  The
227 @code{instrument} property labels the staff in the first system, and
228 the @code{instr} property labels following lines.")
229      (instrumentEqualizer ,procedure? "
230 Function taking a string (instrument name), and returning a (@var{min} . @var{max}) pair of numbers for the loudness range of the instrument.
231 ")
232      (instrumentTransposition ,ly:pitch? "Define the transposition of the instrument. This is used to transpose the MIDI output, and @code{\\quote}s.")
233
234      (keyAccidentalOrder ,list? " Alist that defines in what order
235 alterations should be printed.  The format is (@var{name}
236 . @var{alter}), where @var{name} is from 0 .. 6 and @var{alter} from -1, 1.
237 ")
238
239      (keySignature ,list? "The current key signature. This is an alist
240 containing (@var{name} . @var{alter}) or ((@var{octave} . @var{name}) . @var{alter}).
241  where @var{name} is from 0.. 6 and
242 @var{alter} from -4 (double flat) to 4 (double sharp).
243 ")
244
245      (majorSevenSymbol ,markup? "How should
246 the major 7th be formatted in a chord name?")
247      (markFormatter ,procedure? "Procedure
248 taking as arguments context and rehearsal mark. It should return the
249 formatted mark as a markup object.")
250
251      (measureLength ,ly:moment? "Length of one
252 measure in the current time signature.")
253
254      (measurePosition ,ly:moment? "How much of the current measure
255 have we had.  This can be set manually to create incomplete
256 measures.")
257
258      (melismaBusyProperties ,list? "List of properties (symbols) to
259 determine whether a melisma is playing.  Setting this property will
260 influence how lyrics are aligned to notes.  For example, if set to
261 @code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and
262 manual beams are considered. Possible values include
263 @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and
264 @code{beamMelismaBusy}")
265
266
267      (metronomeMarkFormatter ,procedure? "How to produce a metronome
268 markup.  Called with 2 arguments, event and context.")
269      (midiInstrument ,string? "Name of the MIDI instrument to use ")
270      (midiMinimumVolume ,number? "Sets the minimum loudness for MIDI. Ranges from 0 to 1.")
271      (midiMaximumVolume ,number? "Analogous to @code{midiMinimumVolume}.")
272      (minimumFret ,number? "The tablature auto string-selecting mechanism
273 selects the highest string with a fret at least @var{minimumFret}")
274      (minimumVerticalExtent ,number-pair? "minimum vertical extent, same
275 format as @var{verticalExtent}")
276      (recordEventSequence ,procedure? "When
277 @internalsref{Recording_group_engraver} is in this context, then upon
278 termination of the context, this function is called with current
279 context and a list of music objects.  The list of contains entries
280 with start times, music objects and whether they are processed in this
281 context.")
282      (ottavation ,string? "If set, the text for an ottava spanner. Changing
283 this creates a new text spanner. ")
284      (pedalSustainStrings ,list? "List of string to print for
285 sustain-pedal. Format is (@var{up} @var{updown} @var{down}), where
286 each of the three is the string to print when this is done with the
287 pedal.")
288      (pedalUnaCordaStrings ,list? "See @code{pedalSustainStrings}.")
289      (pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
290      (pedalSustainStyle ,symbol? "A symbol that indicates how to print
291 sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
292      (pedalUnaCordaStyle ,symbol? "see @code{pedalSustainStyle}.")
293      (pedalSostenutoStyle ,symbol? "see @code{pedalSustainStyle}.")
294      (printOctaveNames ,boolean? "Print octave marks for the NoteNames context.")
295      (rehearsalMark ,integer? "The last rehearsal mark printed.")
296      (repeatCommands ,list? "This property is read to find any command of the form @code{(volta . @var{x})}, where @var{x} is a string or @code{#f}")
297
298      (restNumberThreshold ,number?
299                           "If a multimeasure rest takes less
300 than this number of measures, no number is printed. ")
301
302      (skipBars ,boolean? "If set to true, then
303 skip the empty bars that are produced by multimeasure notes and rests.
304 These bars will not appear on the printed output.  If not set (the
305 default) multimeasure notes and rests expand into their full length,
306 printing the appropriate number of empty bars so that synchronization
307 with other voices is preserved.
308
309
310 @example
311 @@lilypond[fragment,verbatim,center]
312 r1 r1*3 R1*3  \\\\property Score.skipBars= ##t r1*3 R1*3
313 @@end lilypond
314 @end example
315 ")
316      (skipTypesetting ,boolean?
317                       "When true, all no typesetting is done, speeding
318 up  the interpretation phase. This speeds up debugging large scores.")
319      (soloADue ,boolean? "set Solo/A due texts in the part combiner?")
320      (soloIIText ,string? "text for begin of solo for voice ``two'' when part-combining.")
321      (soloText ,string? "text for begin of solo when part-combining.")
322      (squashedPosition ,integer? " Vertical position of
323 squashing for @internalsref{Pitch_squash_engraver}.")
324
325      (stringOneTopmost ,boolean? "Whether the 1st string is printed on the
326 top line of the tablature.")
327
328      (stanza ,markup? "Stanza `number' to print before the start of a
329 verse. Use in Lyrics context.")
330
331      (stemLeftBeamCount ,integer? " Specify the number of beams to draw on
332 the left side of the next note.  Overrides automatic beaming.  The
333 value is only used once, and then it is erased.")
334
335      (stemRightBeamCount ,integer? "See @code{stemLeftBeamCount}.")
336
337      (stringTunings ,list? "The tablature strings tuning. It is a list
338 of the pitch (in semitones) of each string (starting with the lower
339 one).")
340
341      (subdivideBeams ,boolean? "If set, multiple beams will be subdivided
342 at beat positions by only drawing one beam over the beat.")
343
344      (systemStartDelimiter ,symbol? "Which grob to make for the start of
345 the system/staff? Set to @code{SystemStartBrace},
346 @code{SystemStartBracket} or @code{SystemStartBar}.")
347
348      (tablatureFormat ,procedure? "Function formatting a tab notehead; it
349 takes a string number, a list of string tunings and Pitch object. It
350 returns the text as a string.")
351
352      (timeSignatureFraction ,number-pair?
353                             "pair of numbers, signifying the time
354 signature. For example @code{#'(4 . 4)} is a 4/4 time signature.")
355
356      (timing ,boolean? " Keep administration of measure length, position, bar number, etc?
357 Switch off for cadenzas.")
358      (tonic ,ly:pitch?
359             "The tonic of the current scale")
360
361      (tremoloFlags ,integer? "Number of tremolo flags to add if no
362 number is specified.")
363
364      (tupletNumberFormatFunction
365       ,procedure?
366       "Function taking a music as input, producing a string. This function
367 is called to determine the text to print on a tuplet bracket.")
368
369      (tupletSpannerDuration ,ly:moment? "
370 Normally a tuplet bracket is as wide as the
371 @code{\\times} expression that gave rise to it. By setting this
372 property, you can make brackets last shorter. Example
373
374 @example
375 @@lilypond[verbatim,fragment]
376 context Voice \\times 2/3 @{
377   property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
378   c-[8 c c-] c-[ c c-]
379 @}
380 @@end lilypond
381 @end example
382 .")
383      (verticalAlignmentChildCallback ,procedure? "What callback to add
384 to children of a vertical alignment.  It determines what
385 procedure is used on the alignment itself.")
386      (verticalExtent ,number-pair? "Hard coded vertical extent.  The format
387 is a pair of dimensions, for example, this sets the sizes of a staff
388 to 10 (5+5) staffspaces high.
389
390 @example
391 \\set Staff.verticalExtent = #'(-5.0 . 5.0)
392 @end example
393
394
395 This does not work for Voice or any other context  that doesn't form a
396 vertical group.")
397
398      (vocalName ,markup? "Name of a vocal line.")
399      (vocNam ,markup? "Name of a vocal line, short version.")
400
401      (voltaOnThisStaff ,boolean?
402                        "Normally, volta brackets are put only on the
403 topmost staff. Setting this variable will create a bracket on
404 this staff as well.")
405
406      (voltaSpannerDuration ,ly:moment? "This specifies the maximum duration
407 to use for the brackets printed for @code{\\alternative}.  This can be
408 used to shrink the length of brackets in the situation where one
409 alternative is very large.")
410
411      (whichBar
412       ,string?
413       "This property is read to determine what type of barline to create.
414
415 Example:
416 @example
417 \\set Staff.whichBar = \"|:\"
418 @end example
419
420 This will create a start-repeat bar in this staff only.
421 Valid values are described in @internalsref{bar-line-interface}.
422 ")
423      )))
424
425 (define-public all-internal-translation-properties
426   (map
427    (lambda (x)
428      (set-object-property! (car x) 'internal-translation #t)
429      (apply translator-property-description x)
430
431      )
432
433    `((slurMelismaBusy ,boolean? "Signal if a slur is present.")
434      (originalCentralCPosition
435       ,integer?
436       "Used for temporary overriding middle C in octavation brackets. ")
437      (melismaBusy ,boolean? "Signifies
438 whether a melisma is active. This can be used to signal melismas on
439 top of those automatically detected. ")
440      (graceSettings ,vector?
441                     "Overrides for grace notes. This property should
442 be manipulated through the @code{add-grace-property} function.")
443      (currentCommandColumn ,ly:grob? "Grob that is X-parent to all
444 current breakable (clef, key signature, etc.) items.")
445      (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
446 non-breakable items (note heads, lyrics, etc.).")
447      (breakableSeparationItem ,ly:grob?
448                               "The breakable items in this time step,
449 for this staff.")
450
451      (localKeySignature ,list? "the key signature at this point in the
452 measure.  The format is the same as for keySignature, but can also
453 contain ((@var{octave} . @var{name}) . (@var{alter} . @var{barnumber}))
454 pairs. It is reset at every bar line."  )
455
456      
457      (localKeySignatureChanges ,list? "Experimental. [DOCME]")
458
459      (finalizations ,list? "List of expressions to evaluate before proceeding to next time step. Internal variable.")
460      (busyGrobs ,list? "a queue of (@var{end-moment} . @var{GROB})
461 conses. This is for internal (C++) use only.  This property contains
462 the grobs which are still busy (eg. noteheads, spanners, etc.)
463 ")
464      (barCheckLastFail ,ly:moment? "Where in  the measurze did the last barcheck fail?") 
465      (associatedVoiceContext ,ly:context? "The context object of the Voice that has the melody for this Lyrics.")
466      (acceptHashTable ,vector? "Internal
467 variable: store table with MusicName to Engraver entries.")
468      (acknowledgeHashTable ,vector?
469                            "Internal variable: store interface to engraver smob table for current
470 context.")
471
472      (beamMelismaBusy ,boolean? "Signal if a beam is present.")
473      (dynamicAbsoluteVolumeFunction ,procedure? "[DOCUMENT-ME]")
474
475      (lastKeySignature ,list? "Last key signature before a key
476 signature change.")
477
478      (scriptDefinitions ,list? "Description of scripts. This is used by
479 Script_engraver for typesetting note-super/subscripts. See
480 @file{scm/script.scm} for more information
481 ")
482      (quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
483      (stavesFound ,grob-list? "list of all staff-symbols found.")
484      (instrumentSupport ,grob-list? "list of grobs to attach instrument name
485 to.")
486      (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
487      )
488    ))
489
490 (define-public all-translation-properties
491   (append all-user-translation-properties
492           all-internal-translation-properties))
493
494 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
495
496 (define-public default-melisma-properties '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))