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 ,markup? "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 @rinternals{Score} then all staves share accidentals, and if
57 @var{context} is @rinternals{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 (completionBusy ,boolean? "Whether a completion-note head is playing.")
152 (connectArpeggios ,boolean? "If set, connect arpeggios across
154 (countPercentRepeats ,boolean? "If set, produce counters for
156 (createKeyOnClefChange ,boolean? "Print a key signature whenever
157 the clef is changed.")
158 (createSpacing ,boolean? "Create @code{StaffSpacing} objects?
159 Should be set for staves.")
160 (crescendoText ,markup? "The text to print at start of non-hairpin
161 crescendo, i.e., @samp{cresc.}.")
162 (crescendoSpanner ,symbol? "The type of spanner to be used for
163 crescendi. Available values are @samp{hairpin}, @samp{line},
164 @samp{dashed-line}, @samp{dotted-line}. If unset, a hairpin crescendo
166 (currentBarNumber ,integer? "Contains the current barnumber.
167 This property is incremented at every bar line.")
170 (decrescendoSpanner ,symbol? "See @code{crescendoSpanner}.")
171 (decrescendoText ,markup? "The text to print at start of
172 non-hairpin decrescendo, i.e., @samp{dim.}.")
173 (defaultBarType ,string? "Set the default type of bar line. See
174 @code{whichBar} for information on available bar types.
176 This variable is read by @rinternals{Timing_translator} at
177 @rinternals{Score} level.")
178 (doubleSlurs ,boolean? "If set, two slurs are created for every
179 slurred note, one above and one below the chord.")
180 (drumPitchTable ,hash-table? "A table mapping percussion
181 instruments (symbols) to pitches.")
182 (drumStyleTable ,hash-table? "A hash table which maps drums to
183 layout settings. Predefined values: @samp{drums-style},
184 @samp{timbales-style}, @samp{congas-style}, @samp{bongos-style}, and
185 @samp{percussion-style}.
187 The layout style is a hash table, containing the drum-pitches (e.g.,
188 the symbol @samp{hihat}) as keys, and a list
189 @code{(@var{notehead-style} @var{script} @var{vertical-position})} as
193 (explicitClefVisibility ,vector? "@samp{break-visibility}
194 function for clef changes.")
195 (explicitKeySignatureVisibility ,vector? "@samp{break-visibility}
196 function for explicit key changes. @samp{\\override} of the
197 @code{break-visibility} property will set the visibility for normal
198 (i.e., at the start of the line) key signatures.")
199 (extendersOverRests ,boolean? "Whether to continue extenders as
201 (extraNatural ,boolean? "Whether to typeset an extra natural sign
202 before accidentals changing from a non-natural to another
206 (figuredBassAlterationDirection ,ly:dir? "Where to put alterations
207 relative to the main figure.")
208 (figuredBassCenterContinuations ,boolean? "Whether to vertically
209 center pairs of extender lines. This does not work with three or more
211 (figuredBassFormatter ,procedure? "A routine generating a markup
213 (figuredBassPlusDirection ,ly:dir? "Where to put plus signs
214 relative to the main figure.")
215 (fingeringOrientations ,list? "A list of symbols, containing
216 @samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list
217 determines where fingerings are put relative to the chord being
219 (firstClef ,boolean? "If true, create a new clef when starting a
221 (followVoice ,boolean? "If set, note heads are tracked across
222 staff switches by a thin line.")
223 (fontSize ,number? "The relative size of all grobs in a context.")
224 (forbidBreak ,boolean? "If set to @code{##t}, prevent a line break
226 (forceClef ,boolean? "Show clef symbol, even if it has not
227 changed. Only active for the first clef after the property is set, not
228 for the full staff.")
231 (gridInterval ,ly:moment? "Interval for which to generate
235 (harmonicAccidentals ,boolean? "If set, harmonic notes in chords
237 (harmonicDots ,boolean? "If set, harmonic notes in dotted chords get
239 (highStringOne ,boolean? "Whether the first string is the string
240 with highest pitch on the instrument. This used by the automatic
241 string selector for tablature notation.")
244 (ignoreBarChecks ,boolean? "Ignore bar checks.")
245 (ignoreFiguredBassRest ,boolean? "Don't swallow rest events.")
246 (ignoreMelismata ,boolean? "Ignore melismata for this
247 @rinternals{Lyrics} line.")
248 (implicitBassFigures ,list? "A list of bass figures that are not
249 printed as numbers, but only as extender lines.")
250 (implicitTimeSignatureVisibility ,vector? "break visibility for
251 the default time signature.")
252 (instrumentCueName ,markup? "The name to print if another
253 instrument is to be taken.")
254 (instrumentName ,markup? "The name to print left of a staff. The
255 @code{instrument} property labels the staff in the first system, and
256 the @code{instr} property labels following lines.")
257 (instrumentEqualizer ,procedure? "A function taking a string
258 (instrument name), and returning a @code{(@var{min} . @var{max})} pair
259 of numbers for the loudness range of the instrument.")
260 ;; the definition is reversed wrt traditional transposition
261 ;; otherwise \transpose { \transposition .. } won't work
262 (instrumentTransposition ,ly:pitch? "Define the transposition of
263 the instrument. Its value is the pitch that sounds like middle@tie{}C.
264 This is used to transpose the MIDI output, and @code{\\quote}s.")
265 (internalBarNumber ,integer? "Contains the current barnumber.
266 This property is used for internal timekeeping, among others by the
267 @code{Accidental_engraver}.")
270 (keepAliveInterfaces ,list? "A list of symbols, signifying grob
271 interfaces that are worth keeping a staff with @code{remove-empty} set
273 (keyAlterationOrder ,list? "An alist that defines in what order
274 alterations should be printed. The format is @code{(@var{step}
275 . @var{alter})}, where @var{step} is a number from 0 to@tie{}6 and
276 @var{alter} from -2 (sharp) to 2 (flat).")
277 (keySignature ,list? "The current key signature. This is an alist
278 containing @code{(@var{step} . @var{alter})} or @code{((@var{octave} .
279 @var{step}) . @var{alter})}, where @var{step} is a number in the range
280 0 to@tie{}6 and @var{alter} a fraction, denoting alteration. For
281 alterations, use symbols, e.g. @code{keySignature = #`((6 . ,FLAT))}.")
284 (lyricMelismaAlignment ,ly:dir? "Alignment to use for a melisma syllable.")
287 (majorSevenSymbol ,markup? "How should the major 7th be formatted
289 (markFormatter ,procedure? "A procedure taking as arguments the
290 context and the rehearsal mark. It should return the formatted mark as
292 (maximumFretStretch ,number? "Don't allocate frets further than
293 this from specified frets.")
294 (measureLength ,ly:moment? "Length of one measure in the current
296 (measurePosition ,ly:moment? "How much of the current measure have
297 we had. This can be set manually to create incomplete measures.")
298 (melismaBusyProperties ,list? "A list of properties (symbols) to
299 determine whether a melisma is playing. Setting this property will
300 influence how lyrics are aligned to notes. For example, if set to
301 @code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and
302 manual beams are considered. Possible values include
303 @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and
304 @code{beamMelismaBusy}.")
305 (metronomeMarkFormatter ,procedure? "How to produce a metronome
306 markup. Called with four arguments: text, duration, count and context.")
307 (midiInstrument ,string? "Name of the MIDI instrument to use.")
308 (midiMaximumVolume ,number? "Analogous to
309 @code{midiMinimumVolume}.")
310 (midiMinimumVolume ,number? "Set the minimum loudness for MIDI.
311 Ranges from 0 to@tie{}1.")
312 (middleCClefPosition ,number? "The position of the middle C,
313 as determined only by the clef. This can be calculated by looking at
314 @code{clefPosition} and @code{clefGlyph}.")
315 (middleCOffset ,number? "The offset of
316 middle C from the position given by @code{middleCClefPosition} This
317 is used for ottava brackets.")
318 (middleCPosition ,number? "The place of the middle C, measured in
319 half staff-spaces. Usually determined by looking at
320 @code{middleCClefPosition} and @code{middleCOffset}.")
321 (minimumFret ,number? "The tablature auto string-selecting
322 mechanism selects the highest string with a fret at least
323 @code{minimumFret}.")
324 (minimumPageTurnLength ,ly:moment? "Minimum length of a rest for a
325 page turn to be allowed.")
326 (minimumRepeatLengthForPageTurn ,ly:moment? "Minimum length of a
327 repeated section for a page turn to be allowed within that section.")
330 (noteToFretFunction ,procedure? "How to produce a fret diagram.
331 Parameters: A list of note events and a list of tabstring events.")
334 (ottavation ,markup? "If set, the text for an ottava spanner.
335 Changing this creates a new text spanner.")
336 (output ,ly:music-output? "The output produced by a score-level
337 translator during music interpretation.")
340 (pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
341 (pedalSostenutoStyle ,symbol? "See @code{pedalSustainStyle}.")
342 (pedalSustainStrings ,list? "A list of strings to print for
343 sustain-pedal. Format is @code{(@var{up} @var{updown} @var{down})},
344 where each of the three is the string to print when this is done with
346 (pedalSustainStyle ,symbol? "A symbol that indicates how to print
347 sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
348 (pedalUnaCordaStrings ,list? "See @code{pedalSustainStrings}.")
349 (pedalUnaCordaStyle ,symbol? "See @code{pedalSustainStyle}.")
350 (predefinedDiagramTable ,hash-table? "The hash table of predefined
351 fret diagrams to use in FretBoards.")
352 (printKeyCancellation ,boolean? "Print restoration alterations
353 before a key signature change.")
354 (printOctaveNames ,boolean? "Print octave marks for the
355 @code{NoteNames} context.")
356 (printPartCombineTexts ,boolean? "Set @q{Solo} and @q{A due} texts
357 in the part combiner?")
358 (proportionalNotationDuration ,ly:moment? "Global override for
359 shortest-playing duration. This is used for switching on proportional
363 (recordEventSequence ,procedure? "When
364 @code{Recording_group_engraver} is in this context, then upon
365 termination of the context, this function is called with current
366 context and a list of music objects. The list of contains entries with
367 start times, music objects and whether they are processed in this
369 (rehearsalMark ,integer? "The last rehearsal mark printed.")
370 (repeatCommands ,list? "This property is a list of commands
371 of the form @code{(list 'volta @var{x})}, where @var{x} is a string or
372 @code{#f}. @code{'end-repeat} is also accepted as a command.")
373 (restNumberThreshold ,number? "If a multimeasure rest has more
374 measures than this, a number is printed.")
377 (shapeNoteStyles ,vector? "Vector of symbols, listing style for
378 each note head relative to the tonic (qv.) of the scale.")
379 (shortInstrumentName ,markup? "See @code{instrument}.")
380 (shortVocalName ,markup? "Name of a vocal line, short version.")
381 (skipBars ,boolean? "If set to true, then skip the empty bars
382 that are produced by multimeasure notes and rests. These bars will
383 not appear on the printed output. If not set (the default),
384 multimeasure notes and rests expand into their full length, printing
385 the appropriate number of empty bars so that synchronization with other
391 \\set Score.skipBars= ##t
395 (skipTypesetting ,boolean? "If true, no typesetting is done,
396 speeding up the interpretation phase. Useful for debugging large
398 (soloIIText ,markup? "The text for the start of a solo for
399 voice @q{two} when part-combining.")
400 (soloText ,markup? "The text for the start of a solo when
402 (squashedPosition ,integer? "Vertical position of squashing for
403 @rinternals{Pitch_squash_engraver}.")
404 (staffLineLayoutFunction ,procedure? "Layout of staff lines,
405 @code{traditional}, or @code{semitone}.")
406 (stanza ,markup? "Stanza @q{number} to print before the start of a
407 verse. Use in @code{Lyrics} context.")
408 (stemLeftBeamCount ,integer? "Specify the number of beams to draw
409 on the left side of the next note. Overrides automatic beaming. The
410 value is only used once, and then it is erased.")
411 (stemRightBeamCount ,integer? "See @code{stemLeftBeamCount}.")
412 (stringNumberOrientations ,list? "See
413 @code{fingeringOrientations}.")
414 (stringOneTopmost ,boolean? "Whether the first string is
415 printed on the top line of the tablature.")
416 (stringTunings ,list? "The tablature strings tuning. It is a list
417 of the pitch (in semitones) of each string (starting with the lower
419 (strokeFingerOrientations ,list? "See
420 @code{fingeringOrientations}.")
421 (subdivideBeams ,boolean? "If set, multiple beams will be
422 subdivided at beat positions by only drawing one beam over the beat.")
423 (suggestAccidentals ,boolean? "If set, accidentals are typeset as
424 cautionary suggestions over the note.")
425 (systemStartDelimiter ,symbol? "Which grob to make for the start
426 of the system/staff? Set to @code{SystemStartBrace},
427 @code{SystemStartBracket} or @code{SystemStartBar}.")
428 (systemStartDelimiterHierarchy ,pair? "A nested list, indicating
429 the nesting of a start delimiters.")
432 (tablatureFormat ,procedure? "A function formatting a tablature
433 note head. Called with three arguments: string number, context and event.
434 It returns the text as a string.")
435 (tempoWholesPerMinute ,ly:moment? "The tempo in whole notes per
437 (tempoUnitCount ,number? "Count for specifying tempo.")
438 (tempoUnitDuration ,ly:duration? "Unit for specifying tempo.")
439 (tempoText ,markup? "Text for tempo marks.")
440 (tempoHideNote ,boolean? "Hide the note=count in tempo marks.")
441 (tieWaitForNote ,boolean? "If true, tied notes do not have to
442 follow each other directly. This can be used for writing out
444 (timeSignatureFraction ,number-pair? "A pair of numbers,
445 signifying the time signature. For example, @code{#'(4 . 4)} is a
446 4/4 time signature.")
447 (timing ,boolean? "Keep administration of measure length,
448 position, bar number, etc.? Switch off for cadenzas.")
449 (tonic ,ly:pitch? "The tonic of the current scale.")
450 (trebleStaffProperties ,list? "An alist of property settings to
451 apply for the up staff of @code{PianoStaff}. Used by
452 @code{\\autochange}.")
453 (tremoloFlags ,integer? "The number of tremolo flags to add if no
454 number is specified.")
455 (tupletFullLength ,boolean? "If set, the tuplet is printed up to
456 the start of the next note.")
457 (tupletFullLengthNote ,boolean? "If set, end at the next note,
458 otherwise end on the matter (time signatures, etc.) before the note.")
459 (tupletSpannerDuration ,ly:moment? "Normally, a tuplet bracket is
460 as wide as the @code{\\times} expression that gave rise to it. By
461 setting this property, you can make brackets last shorter.
465 \\set tupletSpannerDuration = #(ly:make-moment 1 4)
466 \\times 2/3 @{ c8 c c c c c @}
471 (useBassFigureExtenders ,boolean? "Whether to use extender lines
472 for repeated bass figures.")
474 (verticallySpacedContexts ,list? "List of symbols, containing
475 context names whose vertical axis groups should be taken into account
476 for vertical spacing of systems.")
477 (vocalName ,markup? "Name of a vocal line.")
478 (voltaSpannerDuration ,ly:moment? "This specifies the maximum
479 duration to use for the brackets printed for @code{\\alternative}.
480 This can be used to shrink the length of brackets in the situation
481 where one alternative is very large.")
484 (whichBar ,string? "This property is read to determine what type
485 of bar line to create.
490 \\set Staff.whichBar = \"|:\"
494 This will create a start-repeat bar in this staff only. Valid values
495 are described in @rinternals{bar-line-interface}.")
499 (define-public all-internal-translation-properties
502 (set-object-property! (car x) 'internal-translation #t)
503 (apply translator-property-description x))
507 (associatedVoiceContext ,ly:context? "The context object of the
508 @code{Voice} that has the melody for this @code{Lyrics}.")
511 (barCheckLastFail ,ly:moment? "Where in the measure did the last
513 (beamMelismaBusy ,boolean? "Signal if a beam is present.")
514 (breakableSeparationItem ,ly:grob? "The breakable items in this
515 time step, for this staff.")
516 (busyGrobs ,list? "A queue of @code{(@var{end-moment} .
517 @var{GROB})} cons cells. This is for internal (C++) use only. This
518 property contains the grobs which are still busy (e.g. note heads,
522 (currentCommandColumn ,ly:grob? "Grob that is X-parent to all
523 current breakable (clef, key signature, etc.) items.")
524 (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
525 non-breakable items (note heads, lyrics, etc.).")
528 (dynamicAbsoluteVolumeFunction ,procedure? "[DOCUMENT-ME]")
531 (finalizations ,list? "A list of expressions to evaluate before
532 proceeding to next time step. This is an internal variable.")
535 (graceSettings ,list? "Overrides for grace notes. This property
536 should be manipulated through the @code{add-grace-property} function.")
539 (hasStaffSpacing ,boolean? "True if the current
540 @code{CommandColumn} contains items that will affect spacing.")
543 (instrumentSupport ,grob-list? "A list of grobs to attach the
544 instrument name to.")
547 (lastKeySignature ,list? "Last key signature before a key
549 (localKeySignature ,list? "The key signature at this point in the
550 measure. The format is the same as for @code{keySignature}, but can
551 also contain @code{((@var{octave} . @var{name}) . (@var{alter} .
552 @var{barnumber}))} pairs.")
555 (melismaBusy ,boolean? "Signifies whether a melisma is active.
556 This can be used to signal melismas on top of those automatically
560 (originalMiddleCPosition ,integer? "Used for temporary overriding
561 middle@tie{}C in octavation brackets.")
564 (quotedEventTypes ,list? "A list of symbols, representing the
565 event types that should be duplicated for @code{\\quote} commands.")
566 ; (quotes ,hash-table? "A hash table, mapping names to
567 ;@code{music-event} vectors.")
570 (rootSystem ,ly:grob? "The System object.")
573 (scriptDefinitions ,list? "The description of scripts. This is
574 used by the @code{Script_engraver} for typesetting note-superscripts
575 and subscripts. See @file{scm/script.scm} for more information.")
576 (slurMelismaBusy ,boolean? "Signal if a slur is present.")
577 (stavesFound ,grob-list? "A list of all staff-symbols found.")
580 (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
583 (define-public all-translation-properties
584 (append all-user-translation-properties
585 all-internal-translation-properties))
587 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
589 (define-public default-melisma-properties
590 '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy completionBusy))