1 ;;;; define-context-properties.scm -- part of backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2006 Han-Wen Nienhuys <hanwen@cs.uu.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))
27 (define-public all-user-translation-properties
30 (apply translator-property-description x))
35 (aDueText ,string? "Text to print at a unisono passage.")
36 (alignBelowContext ,string? "Where to insert newly created context in vertiical alignment.")
37 (alignAboveContext ,string? "Where to insert newly created context in vertiical alignment.")
38 (alignBassFigureAccidentals ,boolean?
39 "If true, then the accidentals are aligned in bass figure context.")
41 (allowBeamBreak ,boolean? "If true allow line breaks for beams over bar lines.")
42 (allowPageTurn ,pair? "In the form (moment-start . penalty). Allow a page turn
43 at the most recent breakpoint if it was after moment-start.")
44 (associatedVoice ,string? "Name of the
45 @code{Voice} that has the melody for this @code{Lyrics} line.")
46 (autoBeamSettings ,list? "Specifies
47 when automatically generated beams should begin and end.
48 See @usermanref{Setting automatic beam behavior} for more information.
50 (autoAccidentals ,list? "List of
51 different ways to typeset an accidental.
53 For determining when to print an accidental, several different rules
54 are tried. The rule that gives the highest number of accidentals is
55 used. Each rule consists of
60 In which context is the rule applied. For example, if
61 @var{context} is @internalsref{Score} then all staves share
62 accidentals, and if @var{context} is @internalsref{Staff} then all
63 voices in the same staff share accidentals, but staves do not.
66 Whether the accidental changes all octaves or only the current
67 octave. Valid choices are
71 This is the default algorithm. Accidentals are typeset if the note changes
72 the accidental of that note in that octave. Accidentals lasts to the end of the measure
73 and then as many measures as specified in the value. I.e. 1 means to the end
74 of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever.
76 Accidentals are typeset if the note is different from
77 the previous note on the same pitch in any octave. The value has same meaning as in
83 Over how many bar lines the accidental lasts.
84 If @var{laziness} is @code{-1} then the accidental is forgotten
85 immediately, and if @var{laziness} is @code{#t} then the accidental
89 (autoBeamCheck ,procedure? "Procedure taking three
90 arguments, CONTEXT, DIR start/stop (-1 or 1) and TEST shortest
91 note in the beam. A non-#f return value starts or stops the auto beam.")
92 (autoBeaming ,boolean? "If set to true then beams are generated
95 (autoCautionaries ,list? "List similar to
96 @code{autoAccidentals}, but it controls cautionary accidentals rather than
97 normal ones. Both lists are tried, and the one giving the most accidentals
98 wins. In case of draw, a normal accidental is typeset.
100 (automaticBars ,boolean? " If set to true then bar lines will not be
101 printed automatically; they must be explicitly created with
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 each
110 (barCheckSynchronize ,boolean? "If true then reset @code{measurePosition}
111 when finding a barcheck.")
113 (barNumberVisibility ,procedure? "Procedure that takes an int and
114 returns whether the corresponding bar number should be printed")
115 (bassStaffProperties ,list? "Alist of property settings to apply
116 for the down staff of PianoStaff. Used by @code{\\autochange}")
117 (trebleStaffProperties ,list? "Alist of property settings to apply
118 for the up staff of PianoStaff. Used by @code{\\autochange}")
120 (figuredBassFormatter ,procedure? "Routine generating a markup
122 (bassFigureFormatFunction ,procedure? "Procedure that is called
123 to produce the formatting for a @code{BassFigure} grob. It takes a
124 list of @code{BassFigureEvent}s, a context, and the grob to format.")
126 (beatLength ,ly:moment? "The length of one beat in this time signature.")
128 "List of beatgroups, e.g., in 5/8 time @code{'(2
133 (middleCPosition ,number? "Place of the middle C, measured in half
134 staff-spaces. Usually determined by looking at @code{clefPosition} and
137 (chordNameFunction ,procedure?
138 "The function that converts lists of pitches to chord names.")
139 (chordNoteNamer ,procedure?
140 "Function that converts from a pitch object to a text markup. Used for single pitches.")
141 (chordRootNamer ,procedure?
142 "Function that converts from a pitch object to a text markup. Used for chords.")
143 (chordNameExceptions ,list?
144 "An alist of chord exceptions.
145 Contains (@var{chord} . @var{markup}) entries.")
146 (chordNameExceptionsFull ,list?
147 "An alist of chord exceptions.
148 Contains (@var{chord} . @var{markup}) entries.")
149 (chordNameExceptionsPartial
151 "An alist of partial chord exceptions. Contains (@var{chord} . (@var{prefix-markup} @var{suffix-markup})) entries.")
153 (chordNameSeparator ,markup?
154 "The markup object used to separate
155 parts of a chord name.")
156 (chordPrefixSpacer ,number?
157 "The space added between the root symbol and the prefix
159 (chordChanges ,boolean? "Only show changes in chords scheme?")
160 (clefGlyph ,string? "Name of the symbol within the music font.")
161 (clefOctavation ,integer? "Add
162 this much extra octavation. Values of 7 and -7 are common.")
164 (clefPosition ,number? "Where should the center of the clef
165 symbol go, measured in half staff spaces from the center of the staff.")
167 (connectArpeggios ,boolean? " If set, connect arpeggios across
169 (countPercentRepeats ,boolean? "If set, produce counters for
171 (createKeyOnClefChange ,boolean? "Print a key signature whenever the clef is changed.")
172 (createSpacing ,boolean? "Create @code{StaffSpacing} objects?
173 Should be set for staves.")
174 (crescendoText ,markup? "Text to print at start of non-hairpin crescendo, i.e.: @samp{cresc.}")
175 (crescendoSpanner ,symbol? "Type of spanner to be used for crescendi.
176 One of: @samp{hairpin}, @samp{line}, @samp{dashed-line},
177 @samp{dotted-line}. If unset, hairpin type is used.")
178 (decrescendoText ,markup? "Text to print at start of non-hairpin decrescendo, i.e.: @samp{dim.}")
180 (drumPitchTable ,hash-table? "A table mapping percussion
181 instruments (symbols) to pitches.")
183 (drumStyleTable ,hash-table? "A hash table containing mapping
184 drums to layout settings. Predefined values: @samp{drums-style},
185 @samp{timbales-style}, @samp{congas-style}, @samp{bongos-style} and
186 @samp{percussion-style}.
188 The layout style is a hash table, containing the drum-pitches (e.g. the
189 symbol @samp{hihat}) as key, and a list (@var{notehead-style}
190 @var{script} @var{vertical-position}) as values.
192 (currentBarNumber ,integer? "Contains the current barnumber. This property is incremented at
195 (defaultBarType ,string? "Sets the default type of bar line.
196 See @code{whichBar} for information on available bar types.
198 This variable is read by @internalsref{Timing_translator} at
199 @internalsref{Score} level.
202 (decrescendoSpanner ,symbol? "See @code{crescendoSpanner}.")
203 (doubleSlurs ,boolean?
204 "When set, two slurs are created for every slurred
205 note, one above and one below the chord.")
206 (explicitClefVisibility ,vector? "@samp{break-visibility} function for clef changes.")
208 (explicitKeySignatureVisibility ,vector?
209 "@samp{break-visibility} function for explicit key
210 changes. @samp{\\override} of the @code{break-visibility} property will set the
211 visibility for normal (i.e. at the start of the line) key signatures.")
213 (extraNatural ,boolean? "Whether to typeset an
214 extra natural sign before accidentals changing from a non-natural to
215 another non-natural.")
217 (extraVerticalExtent ,number-pair?
218 "extra vertical extent, same format as @var{minimumVerticalExtent}")
221 (figuredBassCenterContinuations ,boolean? "Whether to vertically center pairs of extender lines.")
222 (figuredBassPlusDirection ,ly:dir? "Where to put plus signs relative to the the main figure.")
224 (figuredBassAlterationDirection ,ly:dir? "Where to put
225 alterations relative to the main figure.")
226 (followVoice ,boolean? "If set, note heads are tracked across staff
227 switches by a thin line")
230 "The relative size of all grobs in a context. ")
232 (forbidBreak ,boolean? "If set to ##t, prevent a line break at this point.")
234 (fingeringOrientations ,list?
235 "List of symbols, containing
236 @samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list
237 determines where fingerings are put relative to the chord being
240 (firstClef ,boolean? "If true, create a new clef when starting a
242 (forceClef ,boolean? "Show clef symbol, even if it has not
243 changed. Only active for the first clef after the property is set, not
244 for the full staff.")
245 (gridInterval ,ly:moment?
246 "Interval for which to generate @ref{GridPoint}s")
248 (hairpinToBarline ,boolean? "If set, end a hairpin at the barline before the ending note.")
250 (harmonicAccidentals ,boolean? "If set, harmonic notes in chords
252 (highStringOne ,boolean? "Whether the 1st string is the string with
253 highest pitch on the instrument. This used by the automatic string
254 selector for tab notation.")
256 (ignoreBarChecks ,boolean? "Ignore bar checks")
257 (ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics} line.")
259 (implicitBassFigures ,list? "List of bass figures that are not
260 printed as numbers, but only as extender lines.")
263 (instrumentCueName ,markup? "Name to print if another instrument is to be taken.")
264 (instrumentName ,markup? "The name to print left of a staff. The
265 @code{instrument} property labels the staff in the first system, and
266 the @code{instr} property labels following lines.")
267 (instrumentEqualizer ,procedure? "
268 Function taking a string (instrument name), and returning a (@var{min} . @var{max}) pair of numbers for the loudness range of the instrument.
270 (instrumentTransposition ,ly:pitch? "Defines the transposition of
271 the instrument. Its value is the pitch that sounds like middle C. This
272 is used to transpose the MIDI output, and @code{\\quote}s.")
274 (keepAliveInterfaces ,list? "List of symbols, signifying grob interfaces that
275 are worth keeping an staff with @code{remove-empty} set around for.")
276 (keyAlterationOrder ,list? " Alist that defines in what order
277 alterations should be printed. The format is (@var{step}
278 . @var{alter}), where @var{step} is from 0 .. 6 and @var{alter} from
279 -2 (sharp) and 2 (flat).
282 (keySignature ,list? "The current key signature. This is an alist
283 containing (@var{name} . @var{alter}) or ((@var{octave} . @var{name}) . @var{alter}).
284 where @var{name} is from 0.. 6 and
285 @var{alter} from -4 (double flat) to 4 (double sharp).
287 (majorSevenSymbol ,markup? "How should
288 the major 7th be formatted in a chord name?")
289 (markFormatter ,procedure? "Procedure
290 taking as arguments context and rehearsal mark. It should return the
291 formatted mark as a markup object.")
293 (measureLength ,ly:moment? "Length of one
294 measure in the current time signature.")
296 (measurePosition ,ly:moment? "How much of the current measure
297 have we had. This can be set manually to create incomplete
300 (melismaBusyProperties ,list? "List of properties (symbols) to
301 determine whether a melisma is playing. Setting this property will
302 influence how lyrics are aligned to notes. For example, if set to
303 @code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and
304 manual beams are considered. Possible values include
305 @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and
306 @code{beamMelismaBusy}")
309 (metronomeMarkFormatter ,procedure? "How to produce a metronome
310 markup. Called with 2 arguments, event and context.")
311 (midiInstrument ,string? "Name of the MIDI instrument to use ")
312 (midiMinimumVolume ,number? "Sets the minimum loudness for MIDI. Ranges from 0 to 1.")
313 (midiMaximumVolume ,number? "Analogous to @code{midiMinimumVolume}.")
314 (minimumFret ,number? "The tablature auto string-selecting mechanism
315 selects the highest string with a fret at least @code{minimumFret}")
316 (minimumVerticalExtent ,number-pair? "minimum vertical extent, same
317 format as @var{verticalExtent}")
318 (output ,ly:music-output? "The output produced by a score-level translator during music interpretation")
319 (ottavation ,string? "If set, the text for an ottava spanner. Changing
320 this creates a new text spanner. ")
321 (pedalSustainStrings ,list? "List of string to print for
322 sustain-pedal. Format is (@var{up} @var{updown} @var{down}), where
323 each of the three is the string to print when this is done with the
325 (pedalUnaCordaStrings ,list? "See @code{pedalSustainStrings}.")
326 (pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
327 (pedalSustainStyle ,symbol? "A symbol that indicates how to print
328 sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
329 (pedalUnaCordaStyle ,symbol? "see @code{pedalSustainStyle}.")
330 (pedalSostenutoStyle ,symbol? "see @code{pedalSustainStyle}.")
331 (printKeyCancellation ,boolean? "Print restoration alterations before a key signature change. ")
332 (printPartCombineTexts ,boolean? "set Solo/A due texts in the part combiner?")
333 (printOctaveNames ,boolean? "Print octave marks for the NoteNames context.")
335 (proportionalNotationDuration ,ly:moment? "Global override for
336 shortest-playing duration. This is used for switching on proportional
338 (recordEventSequence ,procedure? "When Recording_group_engraver
339 is in this context, then upon termination of the context, this
340 function is called with current context and a list of music objects.
341 The list of contains entries with start times, music objects and
342 whether they are processed in this context.")
344 (rehearsalMark ,integer? "The last rehearsal mark printed.")
345 (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}")
346 (restNumberThreshold ,number?
347 "If a multimeasure rest has more measures
348 than this, a number is printed. ")
349 (revokePageTurns ,pair? "Signals to the paper-column-engraver to revoke (or increase the penalties for) all the page turns within a time interval. Used to disable page turns that occur within an unturnable volta repeat.")
350 (shapeNoteStyles ,vector? "Vector of symbols, listing style for each note
351 head relative to the tonic (qv.) of the scale.")
352 (shortInstrumentName ,markup? "See @code{instrument}")
353 (shortVocalName ,markup? "Name of a vocal line, short version.")
354 (skipBars ,boolean? "If set to true, then
355 skip the empty bars that are produced by multimeasure notes and rests.
356 These bars will not appear on the printed output. If not set (the
357 default) multimeasure notes and rests expand into their full length,
358 printing the appropriate number of empty bars so that synchronization
359 with other voices is preserved.
365 \\set Score.skipBars= ##t
370 (skipTypesetting ,boolean?
371 "When true, all no typesetting is done, speeding
372 up the interpretation phase. This speeds up debugging large scores.")
373 (soloIIText ,string? "text for begin of solo for voice ``two'' when part-combining.")
374 (soloText ,string? "text for begin of solo when part-combining.")
375 (squashedPosition ,integer? " Vertical position of
376 squashing for @internalsref{Pitch_squash_engraver}.")
378 (stringNumberOrientations ,list? "See @code{fingeringOrientations}")
379 (stringOneTopmost ,boolean? "Whether the 1st string is printed on the
380 top line of the tablature.")
382 (stanza ,markup? "Stanza `number' to print before the start of a
383 verse. Use in Lyrics context.")
385 (stemLeftBeamCount ,integer? " Specify the number of beams to draw on
386 the left side of the next note. Overrides automatic beaming. The
387 value is only used once, and then it is erased.")
389 (stemRightBeamCount ,integer? "See @code{stemLeftBeamCount}.")
391 (stringTunings ,list? "The tablature strings tuning. It is a list
392 of the pitch (in semitones) of each string (starting with the lower
395 (subdivideBeams ,boolean? "If set, multiple beams will be subdivided
396 at beat positions by only drawing one beam over the beat.")
397 (suggestAccidentals ,boolean? "If set, accidentals are typeset as cautionary suggestions over the note.")
399 (systemStartDelimiterHierarchy ,pair? "A nested list, indicating the nesting of a start delimiters.")
401 (systemStartDelimiter ,symbol? "Which grob to make for the start of
402 the system/staff? Set to @code{SystemStartBrace},
403 @code{SystemStartBracket} or @code{SystemStartBar}.")
405 (tablatureFormat ,procedure? "Function formatting a tab note head; it
406 takes a string number, a list of string tunings and Pitch object. It
407 returns the text as a string.")
409 (tieWaitForNote ,boolean? "If true, tied notes do not have to follow each other directly.
410 This can be used for writing out arpeggios")
411 (timeSignatureFraction ,number-pair?
412 "pair of numbers, signifying the time
413 signature. For example @code{#'(4 . 4)} is a 4/4 time signature.")
415 (timing ,boolean? " Keep administration of measure length, position, bar number, etc?
416 Switch off for cadenzas.")
418 "The tonic of the current scale")
420 (tremoloFlags ,integer? "Number of tremolo flags to add if no
421 number is specified.")
423 (tupletFullLength ,boolean? "If set, the tuplet is printed up to
424 the start of the next note.")
425 (tupletFullLengthNote ,boolean? "If set, end at the next note, otherwise end on the matter (time sigs, etc.) before the note.")
426 (tupletSpannerDuration ,ly:moment? "
427 Normally a tuplet bracket is as wide as the
428 @code{\\times} expression that gave rise to it. By setting this
429 property, you can make brackets last shorter. Example
433 \\set tupletSpannerDuration = #(ly:make-moment 1 4)
434 \\times 2/3 @{ c8 c c c c c @}
439 (useBassFigureExtenders ,boolean? "Whether to use extender lines
440 for repeated bass figures")
442 (verticalExtent ,number-pair? "Hard coded vertical extent. The format
443 is a pair of dimensions, for example, this sets the sizes of a staff
444 to 10 (5+5) staff-spaces high.
447 \\set Staff.verticalExtent = #'(-5.0 . 5.0)
451 This does not work for Voice or any other context that doesn't form a
454 (verticallySpacedContexts ,list? "List of symbols, containing
455 context names whose vertical axis groups should be taken into account for
456 vertical spacing of systems.")
458 (vocalName ,markup? "Name of a vocal line.")
460 (voltaOnThisStaff ,boolean?
461 "Normally, volta brackets are put only on the
462 topmost staff. This variable overrides this behavior, when set to
463 @code{#t} or @code{#f}.")
465 (voltaSpannerDuration ,ly:moment? "This specifies the maximum duration
466 to use for the brackets printed for @code{\\alternative}. This can be
467 used to shrink the length of brackets in the situation where one
468 alternative is very large.")
472 "This property is read to determine what type of bar line to create.
476 \\set Staff.whichBar = \"|:\"
479 This will create a start-repeat bar in this staff only.
480 Valid values are described in @internalsref{bar-line-interface}.
482 (tempoWholesPerMinute ,ly:moment? "The tempo in whole notes per minute.")
483 (tempoUnitDuration ,ly:duration? "Unit for specifying tempo.")
484 (tempoUnitCount ,number? "Count for specifying tempo.")
488 (define-public all-internal-translation-properties
491 (set-object-property! (car x) 'internal-translation #t)
492 (apply translator-property-description x)
496 `((slurMelismaBusy ,boolean? "Signal if a slur is present.")
497 (originalCentralCPosition
499 "Used for temporary overriding middle C in octavation brackets. ")
500 (melismaBusy ,boolean? "Signifies
501 whether a melisma is active. This can be used to signal melismas on
502 top of those automatically detected. ")
503 (graceSettings ,list?
504 "Overrides for grace notes. This property should
505 be manipulated through the @code{add-grace-property} function.")
506 (currentCommandColumn ,ly:grob? "Grob that is X-parent to all
507 current breakable (clef, key signature, etc.) items.")
508 (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
509 non-breakable items (note heads, lyrics, etc.).")
510 (breakableSeparationItem ,ly:grob?
511 "The breakable items in this time step,
514 (localKeySignature ,list? "the key signature at this point in the
515 measure. The format is the same as for keySignature, but can also
516 contain ((@var{octave} . @var{name}) . (@var{alter} . @var{barnumber}))
517 pairs. It is reset at every bar line.")
520 (localKeySignatureChanges ,list? "Experimental. [DOCME]")
522 (finalizations ,list? "List of expressions to evaluate before proceeding to next time step. Internal variable.")
523 (busyGrobs ,list? "a queue of (@var{end-moment} . @var{GROB})
524 conses. This is for internal (C++) use only. This property contains
525 the grobs which are still busy (e.g. note heads, spanners, etc.)
527 (barCheckLastFail ,ly:moment? "Where in the measure did the last barcheck fail?")
528 (associatedVoiceContext ,ly:context? "The context object of the Voice that has the melody for this Lyrics.")
529 (beamMelismaBusy ,boolean? "Signal if a beam is present.")
530 (dynamicAbsoluteVolumeFunction ,procedure? "[DOCUMENT-ME]")
532 (lastKeySignature ,list? "Last key signature before a key
534 (rootSystem ,ly:grob? "The System object")
535 (scriptDefinitions ,list? "Description of scripts. This is used by
536 Script_engraver for typesetting note-super/subscripts. See
537 @file{scm/script.scm} for more information
539 (quotedEventTypes ,list? "List of symbols, representing the
540 event types that should be duplicated for @code{\\quote} commands.")
542 ; (quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
543 (stavesFound ,grob-list? "list of all staff-symbols found.")
544 (instrumentSupport ,grob-list? "list of grobs to attach instrument name
546 (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
549 (define-public all-translation-properties
550 (append all-user-translation-properties
551 all-internal-translation-properties))
553 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
555 (define-public default-melisma-properties '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))