1 ;;;; define-context-properties.scm -- part of backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
9 (define-public all-translation-properties '())
11 (define (translator-property-description symbol type? description)
15 (string? description)))
16 (throw 'init-format-error))
19 (if (not (equal? #f (object-property symbol 'translation-doc)))
20 (ly:error (_ "symbol ~S redefined" symbol)))
22 (set-object-property! symbol 'translation-type? type?)
23 (set-object-property! symbol 'translation-doc description)
24 (set! all-translation-properties (cons symbol all-translation-properties))
28 (define-public all-user-translation-properties
31 (apply translator-property-description x))
36 (aDueText ,string? "Text to print at a unisono passage.")
37 (alignBelowContext ,string? "Where to insert newly created context in
38 vertiical alignment.")
39 (alignAboveContext ,string? "Where to insert newly created context in
40 vertiical alignment.")
41 (alignBassFigureAccidentals ,boolean? "If true, then the accidentals
42 are aligned in bass figure context.")
43 (associatedVoice ,string? "Name of the @code{Voice} that has the
44 melody for this @code{Lyrics} line.")
45 (autoAccidentals ,list? "List of different ways to typeset an
48 For determining when to print an accidental, several different rules
49 are tried. The rule that gives the highest number of accidentals is
50 used. Each rule consists of
55 In which context is the rule applied. For example, if @var{context}
56 is @internalsref{Score} then all staves share accidentals, and if
57 @var{context} is @internalsref{Staff} then all voices in the same staff
58 share accidentals, but staves do not.
61 Whether the accidental changes all octaves or only the current octave.
67 This is the default algorithm. Accidentals are typeset if the note
68 changes the accidental of that note in that octave. Accidentals lasts
69 to the end of the measure and then as many measures as specified in the
70 value. This is, @code{1}@tie{}means to the end of next measure,
71 @code{-1}@tie{}means to the end of previous measure (that is: no
72 duration at all), etc. @code{#t} means forever.
75 Accidentals are typeset if the note is different from the previous note
76 on the same pitch in any octave. The value has same meaning as in
82 Over how many bar lines the accidental lasts. If @var{laziness} is
83 @code{-1} then the accidental is forgotten immediately, and if
84 @var{laziness} is @code{#t} then the accidental lasts forever.
87 (autoBeamCheck ,procedure? "A procedure taking three
88 arguments, @var{context}, @var{dir} [start/stop (-1 or 1)], and
89 @var{test} [shortest note in the beam]. A non-@code{#f} return value
90 starts or stops the auto beam.")
91 (autoBeamSettings ,list? "Specifies when automatically generated
92 beams should begin and end. See @ruser{Setting automatic beam
93 behavior} for more information.")
94 (autoBeaming ,boolean? "If set to true then beams are generated
96 (autoCautionaries ,list? "List similar to @code{autoAccidentals},
97 but it controls cautionary accidentals rather than normal ones. Both
98 lists are tried, and the one giving the most accidentals wins. In
99 case of draw, a normal accidental is typeset.")
100 (automaticBars ,boolean? "If set to true then bar lines will not
101 be printed automatically; they must be explicitly created with a
102 @code{\\bar} command. Unlike the @code{\\cadenza} keyword, measures
103 are still counted. Bar generation will resume according to that count
104 if this property is unset.")
107 (barAlways ,boolean? "If set to true a bar line is drawn after
109 (barCheckSynchronize ,boolean? "If true then reset
110 @code{measurePosition} when finding a bar check.")
111 (barNumberVisibility ,procedure? "A Procedure that takes an
112 integer and returns whether the corresponding bar number should be
114 (bassFigureFormatFunction ,procedure? "A procedure that is
115 called to produce the formatting for a @code{BassFigure} grob. It
116 takes a list of @code{BassFigureEvent}s, a context, and the grob to
118 (bassStaffProperties ,list? "An alist of property settings to
119 apply for the down staff of @code{PianoStaff}. Used by
120 @code{\\autochange}.")
121 (beatLength ,ly:moment? "The length of one beat in this time
123 (beatGrouping ,list? "A list of beatgroups, e.g., in 5/8 time
127 (chordChanges ,boolean? "Only show changes in chords scheme?")
128 (chordNameFunction ,procedure? "The function that converts lists
129 of pitches to chord names.")
130 (chordNameExceptions ,list? "An alist of chord exceptions.
131 Contains @code{(@var{chord} . @var{markup})} entries.")
132 (chordNameExceptionsFull ,list? "An alist of full chord
133 exceptions. Contains @code{(@var{chord} . @var{markup})} entries.")
134 (chordNameExceptionsPartial ,list? "An alist of partial chord
135 exceptions. Contains @code{(@var{chord} . (@var{prefix-markup}
136 @var{suffix-markup}))} entries.")
137 (chordNameSeparator ,markup? "The markup object used to
138 separate parts of a chord name.")
139 (chordNoteNamer ,procedure? "A function that converts from a pitch
140 object to a text markup. Used for single pitches.")
141 (chordPrefixSpacer ,number? "The space added between the root
142 symbol and the prefix of a chord name.")
143 (chordRootNamer ,procedure? "A function that converts from a pitch
144 object to a text markup. Used for chords.")
145 (clefGlyph ,string? "Name of the symbol within the music font.")
146 (clefOctavation ,integer? "Add this much extra octavation.
147 Values of 7 and -7 are common.")
148 (clefPosition ,number? "Where should the center of the clef
149 symbol go, measured in half staff spaces from the center of the
151 (connectArpeggios ,boolean? "If set, connect arpeggios across
153 (countPercentRepeats ,boolean? "If set, produce counters for
155 (createKeyOnClefChange ,boolean? "Print a key signature whenever
156 the clef is changed.")
157 (createSpacing ,boolean? "Create @code{StaffSpacing} objects?
158 Should be set for staves.")
159 (crescendoText ,markup? "The text to print at start of non-hairpin
160 crescendo, i.e., @samp{cresc.}.")
161 (crescendoSpanner ,symbol? "The type of spanner to be used for
162 crescendi. Available values are @samp{hairpin}, @samp{line},
163 @samp{dashed-line}, @samp{dotted-line}. If unset, a hairpin crescendo
165 (currentBarNumber ,integer? "Contains the current barnumber.
166 This property is incremented at every bar line.")
169 (decrescendoSpanner ,symbol? "See @code{crescendoSpanner}.")
170 (decrescendoText ,markup? "The text to print at start of
171 non-hairpin decrescendo, i.e., @samp{dim.}.")
172 (defaultBarType ,string? "Set the default type of bar line. See
173 @code{whichBar} for information on available bar types.
175 This variable is read by @internalsref{Timing_translator} at
176 @internalsref{Score} level.")
177 (doubleSlurs ,boolean? "If set, two slurs are created for every
178 slurred note, one above and one below the chord.")
179 (drumPitchTable ,hash-table? "A table mapping percussion
180 instruments (symbols) to pitches.")
181 (drumStyleTable ,hash-table? "A hash table which maps drums to
182 layout settings. Predefined values: @samp{drums-style},
183 @samp{timbales-style}, @samp{congas-style}, @samp{bongos-style}, and
184 @samp{percussion-style}.
186 The layout style is a hash table, containing the drum-pitches (e.g.,
187 the symbol @samp{hihat}) as keys, and a list
188 @code{(@var{notehead-style} @var{script} @var{vertical-position})} as
192 (explicitClefVisibility ,vector? "@samp{break-visibility}
193 function for clef changes.")
194 (explicitKeySignatureVisibility ,vector? "@samp{break-visibility}
195 function for explicit key changes. @samp{\\override} of the
196 @code{break-visibility} property will set the visibility for normal
197 (i.e., at the start of the line) key signatures.")
198 (extendersOverRests ,boolean? "Whether to continue extenders as
200 (extraNatural ,boolean? "Whether to typeset an extra natural sign
201 before accidentals changing from a non-natural to another
205 (figuredBassAlterationDirection ,ly:dir? "Where to put alterations
206 relative to the main figure.")
207 (figuredBassCenterContinuations ,boolean? "Whether to vertically
208 center pairs of extender lines. This does not work with three or more
210 (figuredBassFormatter ,procedure? "A routine generating a markup
212 (figuredBassPlusDirection ,ly:dir? "Where to put plus signs
213 relative to the main figure.")
214 (fingeringOrientations ,list? "A list of symbols, containing
215 @samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list
216 determines where fingerings are put relative to the chord being
218 (firstClef ,boolean? "If true, create a new clef when starting a
220 (followVoice ,boolean? "If set, note heads are tracked across
221 staff switches by a thin line.")
222 (fontSize ,number? "The relative size of all grobs in a context.")
223 (forbidBreak ,boolean? "If set to @code{##t}, prevent a line break
225 (forceClef ,boolean? "Show clef symbol, even if it has not
226 changed. Only active for the first clef after the property is set, not
227 for the full staff.")
230 (gridInterval ,ly:moment? "Interval for which to generate
234 (hairpinToBarline ,boolean? "If set, end a hairpin at the barline
235 before the ending note.")
236 (harmonicAccidentals ,boolean? "If set, harmonic notes in chords
238 (highStringOne ,boolean? "Whether the first string is the string
239 with highest pitch on the instrument. This used by the automatic
240 string selector for tablature notation.")
243 (ignoreBarChecks ,boolean? "Ignore bar checks.")
244 (ignoreFiguredBassRest ,boolean? "Don't swallow rest events.")
245 (ignoreMelismata ,boolean? "Ignore melismata for this
246 @internalsref{Lyrics} line.")
247 (implicitBassFigures ,list? "A list of bass figures that are not
248 printed as numbers, but only as extender lines.")
249 (implicitTimeSignatureVisibility ,vector? "break visibility for
250 the default time signature.")
251 (instrumentCueName ,markup? "The name to print if another
252 instrument is to be taken.")
253 (instrumentName ,markup? "The name to print left of a staff. The
254 @code{instrument} property labels the staff in the first system, and
255 the @code{instr} property labels following lines.")
256 (instrumentEqualizer ,procedure? "A function taking a string
257 (instrument name), and returning a @code{(@var{min} . @var{max})} pair
258 of numbers for the loudness range of the instrument.")
259 ;; the definition is reversed wrt traditional transposition
260 ;; otherwise \transpose { \transposition .. } won't work
261 (instrumentTransposition ,ly:pitch? "Define the transposition of
262 the instrument. Its value is the pitch that sounds like middle@tie{}C.
263 This is used to transpose the MIDI output, and @code{\\quote}s.")
264 (internalBarNumber ,integer? "Contains the current barnumber.
265 This property is used for internal timekeeping, among others by the
266 @code{Accidental_engraver}.")
269 (keepAliveInterfaces ,list? "A list of symbols, signifying grob
270 interfaces that are worth keeping a staff with @code{remove-empty} set
272 (keyAlterationOrder ,list? "An alist that defines in what order
273 alterations should be printed. The format is @code{(@var{step}
274 . @var{alter})}, where @var{step} is a number from 0 to@tie{}6 and
275 @var{alter} from -2 (sharp) to 2 (flat).")
276 (keySignature ,list? "The current key signature. This is an alist
277 containing @code{(@var{step} . @var{alter})} or @code{((@var{octave} .
278 @var{step}) . @var{alter})}, where @var{step} is a number in the range
279 0 to@tie{}6 and @var{alter} a fraction, denoting alteration. For
280 alterations, use symbols, e.g. @code{keySignature = #`((6 . ,FLAT))}.")
282 (lyricMelismaAlignment ,ly:dir? "Alignment to use for a melisma syllable.")
284 (majorSevenSymbol ,markup? "How should the major 7th be formatted
286 (markFormatter ,procedure? "A procedure taking as arguments the
287 context and the rehearsal mark. It should return the formatted mark as
289 (maximumFretStretch ,number? "Don't allocate frets further than
290 this from specified frets.")
291 (measureLength ,ly:moment? "Length of one measure in the current
293 (measurePosition ,ly:moment? "How much of the current measure have
294 we had. This can be set manually to create incomplete measures.")
295 (melismaBusyProperties ,list? "A list of properties (symbols) to
296 determine whether a melisma is playing. Setting this property will
297 influence how lyrics are aligned to notes. For example, if set to
298 @code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and
299 manual beams are considered. Possible values include
300 @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and
301 @code{beamMelismaBusy}.")
302 (metronomeMarkFormatter ,procedure? "How to produce a metronome
303 markup. Called with two arguments, event and context.")
304 (midiInstrument ,string? "Name of the MIDI instrument to use.")
305 (midiMaximumVolume ,number? "Analogous to
306 @code{midiMinimumVolume}.")
307 (midiMinimumVolume ,number? "Set the minimum loudness for MIDI.
308 Ranges from 0 to@tie{}1.")
309 (middleCClefPosition ,number? "The position of the middle C,
310 as determined only by the clef. This can be calculated by looking at
311 @code{clefPosition} and @code{clefGlyph}.")
312 (middleCOffset ,number? "The offset of
313 middle C from the position given by @code{middleCClefPosition} This
314 is used for ottava brackets.")
315 (middleCPosition ,number? "The place of the middle C, measured in
316 half staff-spaces. Usually determined by looking at
317 @code{middleCClefPosition} and @code{middleCOffset}.")
318 (minimumFret ,number? "The tablature auto string-selecting
319 mechanism selects the highest string with a fret at least
320 @code{minimumFret}.")
321 (minimumPageTurnLength ,ly:moment? "Minimum length of a rest for a
322 page turn to be allowed.")
323 (minimumRepeatLengthForPageTurn ,ly:moment? "Minimum length of a
324 repeated section for a page turn to be allowed within that section.")
327 (noteToFretFunction ,procedure? "How to produce a fret diagram.
328 Parameters: A list of note events and a list of tabstring events.")
331 (ottavation ,string? "If set, the text for an ottava spanner.
332 Changing this creates a new text spanner.")
333 (output ,ly:music-output? "The output produced by a score-level
334 translator during music interpretation.")
337 (pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
338 (pedalSostenutoStyle ,symbol? "See @code{pedalSustainStyle}.")
339 (pedalSustainStrings ,list? "A list of strings to print for
340 sustain-pedal. Format is @code{(@var{up} @var{updown} @var{down})},
341 where each of the three is the string to print when this is done with
343 (pedalSustainStyle ,symbol? "A symbol that indicates how to print
344 sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
345 (pedalUnaCordaStrings ,list? "See @code{pedalSustainStrings}.")
346 (pedalUnaCordaStyle ,symbol? "See @code{pedalSustainStyle}.")
347 (printKeyCancellation ,boolean? "Print restoration alterations
348 before a key signature change.")
349 (printOctaveNames ,boolean? "Print octave marks for the
350 @code{NoteNames} context.")
351 (printPartCombineTexts ,boolean? "Set @q{Solo} and @q{A due} texts
352 in the part combiner?")
353 (proportionalNotationDuration ,ly:moment? "Global override for
354 shortest-playing duration. This is used for switching on proportional
358 (recordEventSequence ,procedure? "When
359 @code{Recording_group_engraver} is in this context, then upon
360 termination of the context, this function is called with current
361 context and a list of music objects. The list of contains entries with
362 start times, music objects and whether they are processed in this
364 (rehearsalMark ,integer? "The last rehearsal mark printed.")
365 (repeatCommands ,list? "This property is read to find any command
366 of the form @code{(volta . @var{x})}, where @var{x} is a string or
368 (restNumberThreshold ,number? "If a multimeasure rest has more
369 measures than this, a number is printed.")
372 (shapeNoteStyles ,vector? "Vector of symbols, listing style for
373 each note head relative to the tonic (qv.) of the scale.")
374 (shortInstrumentName ,markup? "See @code{instrument}.")
375 (shortVocalName ,markup? "Name of a vocal line, short version.")
376 (skipBars ,boolean? "If set to true, then skip the empty bars
377 that are produced by multimeasure notes and rests. These bars will
378 not appear on the printed output. If not set (the default),
379 multimeasure notes and rests expand into their full length, printing
380 the appropriate number of empty bars so that synchronization with other
386 \\set Score.skipBars= ##t
390 (skipTypesetting ,boolean? "If true, no typesetting is done,
391 speeding up the interpretation phase. Useful for debugging large
393 (soloIIText ,string? "The text for the start of a solo for
394 voice @q{two} when part-combining.")
395 (soloText ,string? "The text for the start of a solo when
397 (squashedPosition ,integer? "Vertical position of squashing for
398 @internalsref{Pitch_squash_engraver}.")
399 (staffLineLayoutFunction ,procedure? "Layout of staff lines,
400 @code{traditional}, or @code{semitone}.")
401 (stanza ,markup? "Stanza @q{number} to print before the start of a
402 verse. Use in @code{Lyrics} context.")
403 (stemLeftBeamCount ,integer? "Specify the number of beams to draw
404 on the left side of the next note. Overrides automatic beaming. The
405 value is only used once, and then it is erased.")
406 (stemRightBeamCount ,integer? "See @code{stemLeftBeamCount}.")
407 (stringNumberOrientations ,list? "See
408 @code{fingeringOrientations}.")
409 (stringOneTopmost ,boolean? "Whether the first string is
410 printed on the top line of the tablature.")
411 (stringTunings ,list? "The tablature strings tuning. It is a list
412 of the pitch (in semitones) of each string (starting with the lower
414 (strokeFingerOrientations ,list? "See
415 @code{fingeringOrientations}.")
416 (subdivideBeams ,boolean? "If set, multiple beams will be
417 subdivided at beat positions by only drawing one beam over the beat.")
418 (suggestAccidentals ,boolean? "If set, accidentals are typeset as
419 cautionary suggestions over the note.")
420 (systemStartDelimiter ,symbol? "Which grob to make for the start
421 of the system/staff? Set to @code{SystemStartBrace},
422 @code{SystemStartBracket} or @code{SystemStartBar}.")
423 (systemStartDelimiterHierarchy ,pair? "A nested list, indicating
424 the nesting of a start delimiters.")
427 (tablatureFormat ,procedure? "A function formatting a tablature
428 note head; it takes a string number, a list of string tunings and a
429 @code{Pitch} object. It returns the text as a string.")
430 (tempoWholesPerMinute ,ly:moment? "The tempo in whole notes per
432 (tempoUnitCount ,number? "Count for specifying tempo.")
433 (tempoUnitDuration ,ly:duration? "Unit for specifying tempo.")
434 (tieWaitForNote ,boolean? "If true, tied notes do not have to
435 follow each other directly. This can be used for writing out
437 (timeSignatureFraction ,number-pair? "A pair of numbers,
438 signifying the time signature. For example, @code{#'(4 . 4)} is a
439 4/4 time signature.")
440 (timing ,boolean? "Keep administration of measure length,
441 position, bar number, etc.? Switch off for cadenzas.")
442 (tonic ,ly:pitch? "The tonic of the current scale.")
443 (trebleStaffProperties ,list? "An alist of property settings to
444 apply for the up staff of @code{PianoStaff}. Used by
445 @code{\\autochange}.")
446 (tremoloFlags ,integer? "The number of tremolo flags to add if no
447 number is specified.")
448 (tupletFullLength ,boolean? "If set, the tuplet is printed up to
449 the start of the next note.")
450 (tupletFullLengthNote ,boolean? "If set, end at the next note,
451 otherwise end on the matter (time signatures, etc.) before the note.")
452 (tupletSpannerDuration ,ly:moment? "Normally, a tuplet bracket is
453 as wide as the @code{\\times} expression that gave rise to it. By
454 setting this property, you can make brackets last shorter.
458 \\set tupletSpannerDuration = #(ly:make-moment 1 4)
459 \\times 2/3 @{ c8 c c c c c @}
464 (useBassFigureExtenders ,boolean? "Whether to use extender lines
465 for repeated bass figures.")
468 (verticallySpacedContexts ,list? "List of symbols, containing
469 context names whose vertical axis groups should be taken into account
470 for vertical spacing of systems.")
471 (vocalName ,markup? "Name of a vocal line.")
472 (voltaSpannerDuration ,ly:moment? "This specifies the maximum
473 duration to use for the brackets printed for @code{\\alternative}.
474 This can be used to shrink the length of brackets in the situation
475 where one alternative is very large.")
478 (whichBar ,string? "This property is read to determine what type
479 of bar line to create.
484 \\set Staff.whichBar = \"|:\"
488 This will create a start-repeat bar in this staff only. Valid values
489 are described in @internalsref{bar-line-interface}.")
493 (define-public all-internal-translation-properties
496 (set-object-property! (car x) 'internal-translation #t)
497 (apply translator-property-description x))
501 (associatedVoiceContext ,ly:context? "The context object of the
502 @code{Voice} that has the melody for this @code{Lyrics}.")
505 (barCheckLastFail ,ly:moment? "Where in the measure did the last
507 (beamMelismaBusy ,boolean? "Signal if a beam is present.")
508 (breakableSeparationItem ,ly:grob? "The breakable items in this
509 time step, for this staff.")
510 (busyGrobs ,list? "A queue of @code{(@var{end-moment} .
511 @var{GROB})} cons cells. This is for internal (C++) use only. This
512 property contains the grobs which are still busy (e.g. note heads,
516 (currentCommandColumn ,ly:grob? "Grob that is X-parent to all
517 current breakable (clef, key signature, etc.) items.")
518 (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
519 non-breakable items (note heads, lyrics, etc.).")
522 (dynamicAbsoluteVolumeFunction ,procedure? "[DOCUMENT-ME]")
525 (finalizations ,list? "A list of expressions to evaluate before
526 proceeding to next time step. This is an internal variable.")
529 (graceSettings ,list? "Overrides for grace notes. This property
530 should be manipulated through the @code{add-grace-property} function.")
533 (hasStaffSpacing ,boolean? "True if the current
534 @code{CommandColumn} contains items that will affect spacing.")
537 (instrumentSupport ,grob-list? "A list of grobs to attach the
538 instrument name to.")
541 (lastKeySignature ,list? "Last key signature before a key
543 (localKeySignature ,list? "The key signature at this point in the
544 measure. The format is the same as for @code{keySignature}, but can
545 also contain @code{((@var{octave} . @var{name}) . (@var{alter} .
546 @var{barnumber}))} pairs. It is reset at every bar line.")
549 (melismaBusy ,boolean? "Signifies whether a melisma is active.
550 This can be used to signal melismas on top of those automatically
554 (originalMiddleCPosition ,integer? "Used for temporary overriding
555 middle@tie{}C in octavation brackets.")
558 (quotedEventTypes ,list? "A list of symbols, representing the
559 event types that should be duplicated for @code{\\quote} commands.")
560 ; (quotes ,hash-table? "A hash table, mapping names to
561 ;@code{music-event} vectors.")
564 (rootSystem ,ly:grob? "The System object.")
567 (scriptDefinitions ,list? "The description of scripts. This is
568 used by the @code{Script_engraver} for typesetting note-superscripts
569 and subscripts. See @file{scm/script.scm} for more information.")
570 (slurMelismaBusy ,boolean? "Signal if a slur is present.")
571 (stavesFound ,grob-list? "A list of all staff-symbols found.")
574 (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
577 (define-public all-translation-properties
578 (append all-user-translation-properties
579 all-internal-translation-properties))
581 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
583 (define-public default-melisma-properties
584 '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))