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@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))
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 (associatedVoice ,string? "Name of the
42 @code{Voice} that has the melody for this @code{Lyrics} line.")
43 (autoBeamSettings ,list? "Specifies
44 when automatically generated beams should begin and end.
45 See @usermanref{Setting automatic beam behavior} for more information.
47 (autoAccidentals ,list? "List of
48 different ways to typeset an accidental.
50 For determining when to print an accidental, several different rules
51 are tried. The rule that gives the highest number of accidentals is
52 used. Each rule consists of
57 In which context is the rule applied. For example, if
58 @var{context} is @internalsref{Score} then all staves share
59 accidentals, and if @var{context} is @internalsref{Staff} then all
60 voices in the same staff share accidentals, but staves do not.
63 Whether the accidental changes all octaves or only the current
64 octave. Valid choices are
68 This is the default algorithm. Accidentals are typeset if the note changes
69 the accidental of that note in that octave. Accidentals lasts to the end of the measure
70 and then as many measures as specified in the value. I.e. 1 means to the end
71 of next measure, -1 means to the end of previous measure (that is: no duration at all), etc. #t means forever.
73 Accidentals are typeset if the note is different from
74 the previous note on the same pitch in any octave. The value has same meaning as in
80 Over how many bar lines the accidental lasts.
81 If @var{laziness} is @code{-1} then the accidental is forgotten
82 immediately, and if @var{laziness} is @code{#t} then the accidental
86 (autoBeamCheck ,procedure? "Procedure taking three
87 arguments, CONTEXT, DIR start/stop (-1 or 1) and TEST shortest
88 note in the beam. A non-#f return value starts or stops the auto beam.")
89 (autoBeaming ,boolean? "If set to true then beams are generated
92 (autoCautionaries ,list? "List similar to
93 @code{autoAccidentals}, but it controls cautionary accidentals rather than
94 normal ones. Both lists are tried, and the one giving the most accidentals
95 wins. In case of draw, a normal accidental is typeset.
97 (automaticBars ,boolean? " If set to true then bar lines will not be
98 printed automatically; they must be explicitly created with
99 @code{\\bar} command. Unlike the @code{\\cadenza} keyword, measures
100 are still counted. Bar generation will resume according to that count
101 if this property is unset.
104 (barAlways ,boolean? "If set to true a bar line is drawn after each
107 (barCheckSynchronize ,boolean? "If true then reset @code{measurePosition}
108 when finding a barcheck.")
110 (barNumberVisibility ,procedure? "Procedure that takes an int and
111 returns whether the corresponding bar number should be printed")
112 (bassStaffProperties ,list? "Alist of property settings to apply
113 for the down staff of PianoStaff. Used by @code{\\autochange}")
114 (trebleStaffProperties ,list? "Alist of property settings to apply
115 for the up staff of PianoStaff. Used by @code{\\autochange}")
117 (figuredBassFormatter ,procedure? "Routine generating a markup
119 (bassFigureFormatFunction ,procedure? "Procedure that is called
120 to produce the formatting for a @code{BassFigure} grob. It takes a
121 list of @code{BassFigureEvent}s, a context, and the grob to format.")
123 (beatLength ,ly:moment? "The length of one beat in this time signature.")
125 "List of beatgroups, e.g., in 5/8 time @code{'(2
130 (middleCPosition ,number? "Place of the middle C, measured in half
131 staff-spaces. Usually determined by looking at @code{clefPosition} and
134 (chordNameFunction ,procedure?
135 "The function that converts lists of pitches to chord names.")
136 (chordNoteNamer ,procedure?
137 "Function that converts from a pitch object to a text markup. Used for single pitches.")
138 (chordRootNamer ,procedure?
139 "Function that converts from a pitch object to a text markup. Used for chords.")
140 (chordNameExceptions ,list?
141 "An alist of chord exceptions.
142 Contains (@var{chord} . @var{markup}) entries.")
143 (chordNameExceptionsFull ,list?
144 "An alist of chord exceptions.
145 Contains (@var{chord} . @var{markup}) entries.")
146 (chordNameExceptionsPartial
148 "An alist of partial chord exceptions. Contains (@var{chord} . (@var{prefix-markup} @var{suffix-markup})) entries.")
150 (chordNameSeparator ,markup?
151 "The markup object used to separate
152 parts of a chord name.")
153 (chordPrefixSpacer ,number?
154 "The space added between the root symbol and the prefix
156 (chordChanges ,boolean? "Only show changes in chords scheme?")
157 (clefGlyph ,string? "Name of the symbol within the music font.")
158 (clefOctavation ,integer? "Add
159 this much extra octavation. Values of 7 and -7 are common.")
161 (clefPosition ,number? "Where should the center of the clef
162 symbol go, measured in half staff spaces from the center of the staff.")
164 (connectArpeggios ,boolean? " If set, connect arpeggios across
166 (countPercentRepeats ,boolean? "If set, produce counters for
168 (createKeyOnClefChange ,boolean? "Print a key signature whenever the clef is changed.")
169 (createSpacing ,boolean? "Create @code{StaffSpacing} objects?
170 Should be set for staves.")
171 (crescendoText ,markup? "Text to print at start of non-hairpin crescendo, i.e.: @samp{cresc.}")
172 (crescendoSpanner ,symbol? "Type of spanner to be used for crescendi.
173 One of: @samp{hairpin}, @samp{line}, @samp{dashed-line},
174 @samp{dotted-line}. If unset, hairpin type is used.")
175 (decrescendoText ,markup? "Text to print at start of non-hairpin decrescendo, i.e.: @samp{dim.}")
177 (drumPitchTable ,hash-table? "A table mapping percussion
178 instruments (symbols) to pitches.")
180 (drumStyleTable ,hash-table? "A hash table containing mapping
181 drums to layout settings. Predefined values: @samp{drums-style},
182 @samp{timbales-style}, @samp{congas-style}, @samp{bongos-style} and
183 @samp{percussion-style}.
185 The layout style is a hash table, containing the drum-pitches (e.g. the
186 symbol @samp{hihat}) as key, and a list (@var{notehead-style}
187 @var{script} @var{vertical-position}) as values.
189 (currentBarNumber ,integer? "Contains the current barnumber. This property is incremented at every bar line. ")
190 (defaultBarType ,string? "Sets the default type of bar line.
191 See @code{whichBar} for information on available bar types.
193 This variable is read by @internalsref{Timing_translator} at
194 @internalsref{Score} level.
197 (decrescendoSpanner ,symbol? "See @code{crescendoSpanner}.")
198 (doubleSlurs ,boolean?
199 "When set, two slurs are created for every slurred
200 note, one above and one below the chord.")
201 (explicitClefVisibility ,vector? "@samp{break-visibility} function for clef changes.")
203 (explicitKeySignatureVisibility ,vector?
204 "@samp{break-visibility} function for explicit key
205 changes. @samp{\\override} of the @code{break-visibility} property will set the
206 visibility for normal (i.e. at the start of the line) key signatures.")
208 (extraNatural ,boolean? "Whether to typeset an
209 extra natural sign before accidentals changing from a non-natural to
210 another non-natural.")
212 (figuredBassCenterContinuations ,boolean? "Whether to vertically center pairs of extender lines. This does not work with three or more lines")
213 (figuredBassPlusDirection ,ly:dir? "Where to put plus signs relative to the the main figure.")
215 (figuredBassAlterationDirection ,ly:dir? "Where to put
216 alterations relative to the main figure.")
217 (followVoice ,boolean? "If set, note heads are tracked across staff
218 switches by a thin line")
221 "The relative size of all grobs in a context. ")
223 (forbidBreak ,boolean? "If set to ##t, prevent a line break at this point.")
225 (fingeringOrientations ,list?
226 "List of symbols, containing
227 @samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list
228 determines where fingerings are put relative to the chord being
231 (firstClef ,boolean? "If true, create a new clef when starting a
233 (forceClef ,boolean? "Show clef symbol, even if it has not
234 changed. Only active for the first clef after the property is set, not
235 for the full staff.")
236 (gridInterval ,ly:moment?
237 "Interval for which to generate @ref{GridPoint}s")
239 (hairpinToBarline ,boolean? "If set, end a hairpin at the barline before the ending note.")
241 (harmonicAccidentals ,boolean? "If set, harmonic notes in chords
243 (highStringOne ,boolean? "Whether the 1st string is the string with
244 highest pitch on the instrument. This used by the automatic string
245 selector for tab notation.")
247 (ignoreFiguredBassRest ,boolean? "Don't swallow rest events.")
248 (ignoreBarChecks ,boolean? "Ignore bar checks")
249 (ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics} line.")
251 (implicitTimeSignatureVisibility ,vector? "break visibility for the default timesignature.")
253 (implicitBassFigures ,list? "List of bass figures that are not
254 printed as numbers, but only as extender lines.")
257 (instrumentCueName ,markup? "Name to print if another instrument is to be taken.")
258 (instrumentName ,markup? "The name to print left of a staff. The
259 @code{instrument} property labels the staff in the first system, and
260 the @code{instr} property labels following lines.")
261 (instrumentEqualizer ,procedure? "
262 Function taking a string (instrument name), and returning a (@var{min} . @var{max}) pair of numbers for the loudness range of the instrument.
265 ;; the definition is reversed wrt traditional transposition
266 ;; this because \transpose { \transposition .. } won't work
268 (instrumentTransposition ,ly:pitch? "Defines the transposition of
269 the instrument. Its value is the pitch that sounds like middle C. This
270 is used to transpose the MIDI output, and @code{\\quote}s.")
272 (internalBarNumber ,integer? "Contains the current barnumber. This property is used for internal timekeeping, among others by the @code{Accidental_engraver}.")
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{step} . @var{alter}) or ((@var{octave} . @var{step})
284 . @var{alter}). where @var{step} is from 0.. 6 and @var{alter} a fraction, denoting
285 alteration. For alterations, use symbols, eg.
286 @code{keySignature = #`((6 . ,FLAT))}
288 (majorSevenSymbol ,markup? "How should
289 the major 7th be formatted in a chord name?")
290 (markFormatter ,procedure? "Procedure
291 taking as arguments context and rehearsal mark. It should return the
292 formatted mark as a markup object.")
294 (measureLength ,ly:moment? "Length of one
295 measure in the current time signature.")
297 (measurePosition ,ly:moment? "How much of the current measure
298 have we had. This can be set manually to create incomplete
301 (melismaBusyProperties ,list? "List of properties (symbols) to
302 determine whether a melisma is playing. Setting this property will
303 influence how lyrics are aligned to notes. For example, if set to
304 @code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and
305 manual beams are considered. Possible values include
306 @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and
307 @code{beamMelismaBusy}")
310 (metronomeMarkFormatter ,procedure? "How to produce a metronome
311 markup. Called with 2 arguments, event and context.")
312 (midiInstrument ,string? "Name of the MIDI instrument to use ")
313 (midiMinimumVolume ,number? "Sets the minimum loudness for MIDI. Ranges from 0 to 1.")
314 (midiMaximumVolume ,number? "Analogous to @code{midiMinimumVolume}.")
315 (minimumFret ,number? "The tablature auto string-selecting mechanism
316 selects the highest string with a fret at least @code{minimumFret}")
317 (maximumFretStretch ,number? "Don't allocate frets further than this from specified frets.")
318 (minimumPageTurnLength ,ly:moment? "Minimum length of a rest for a page turn to be allowed")
319 (minimumRepeatLengthForPageTurn ,ly:moment? "Minimum length of a repeated section for a page
320 turn to be allowed within that section")
321 (output ,ly:music-output? "The output produced by a score-level translator during music interpretation")
322 (ottavation ,string? "If set, the text for an ottava spanner. Changing
323 this creates a new text spanner. ")
324 (noteToFretFunction ,procedure? "How to produce a fret diagram. Parameters: list of note events and list of tabstring events.")
325 (pedalSustainStrings ,list? "List of string to print for
326 sustain-pedal. Format is (@var{up} @var{updown} @var{down}), where
327 each of the three is the string to print when this is done with the
329 (pedalUnaCordaStrings ,list? "See @code{pedalSustainStrings}.")
330 (pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
331 (pedalSustainStyle ,symbol? "A symbol that indicates how to print
332 sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
333 (pedalUnaCordaStyle ,symbol? "see @code{pedalSustainStyle}.")
334 (pedalSostenutoStyle ,symbol? "see @code{pedalSustainStyle}.")
335 (printKeyCancellation ,boolean? "Print restoration alterations before a key signature change. ")
336 (printPartCombineTexts ,boolean? "set Solo/A due texts in the part combiner?")
337 (printOctaveNames ,boolean? "Print octave marks for the NoteNames context.")
339 (proportionalNotationDuration ,ly:moment? "Global override for
340 shortest-playing duration. This is used for switching on proportional
342 (recordEventSequence ,procedure? "When Recording_group_engraver
343 is in this context, then upon termination of the context, this
344 function is called with current context and a list of music objects.
345 The list of contains entries with start times, music objects and
346 whether they are processed in this context.")
348 (rehearsalMark ,integer? "The last rehearsal mark printed.")
349 (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}")
350 (restNumberThreshold ,number?
351 "If a multimeasure rest has more measures
352 than this, a number is printed. ")
353 (shapeNoteStyles ,vector? "Vector of symbols, listing style for each note
354 head relative to the tonic (qv.) of the scale.")
355 (shortInstrumentName ,markup? "See @code{instrument}")
356 (shortVocalName ,markup? "Name of a vocal line, short version.")
357 (skipBars ,boolean? "If set to true, then
358 skip the empty bars that are produced by multimeasure notes and rests.
359 These bars will not appear on the printed output. If not set (the
360 default) multimeasure notes and rests expand into their full length,
361 printing the appropriate number of empty bars so that synchronization
362 with other voices is preserved.
368 \\set Score.skipBars= ##t
373 (skipTypesetting ,boolean?
374 "When true, all no typesetting is done, speeding
375 up the interpretation phase. This speeds up debugging large scores.")
376 (soloIIText ,string? "text for begin of solo for voice ``two'' when part-combining.")
377 (soloText ,string? "text for begin of solo when part-combining.")
378 (squashedPosition ,integer? " Vertical position of
379 squashing for @internalsref{Pitch_squash_engraver}.")
381 (stringNumberOrientations ,list? "See @code{fingeringOrientations}")
382 (strokeFingerOrientations ,list? "See @code{fingeringOrientations}")
383 (stringOneTopmost ,boolean? "Whether the 1st string is printed on the
384 top line of the tablature.")
386 (stanza ,markup? "Stanza `number' to print before the start of a
387 verse. Use in Lyrics context.")
389 (stemLeftBeamCount ,integer? " Specify the number of beams to draw on
390 the left side of the next note. Overrides automatic beaming. The
391 value is only used once, and then it is erased.")
393 (stemRightBeamCount ,integer? "See @code{stemLeftBeamCount}.")
395 (stringTunings ,list? "The tablature strings tuning. It is a list
396 of the pitch (in semitones) of each string (starting with the lower
399 (subdivideBeams ,boolean? "If set, multiple beams will be subdivided
400 at beat positions by only drawing one beam over the beat.")
401 (suggestAccidentals ,boolean? "If set, accidentals are typeset as cautionary suggestions over the note.")
403 (systemStartDelimiterHierarchy ,pair? "A nested list, indicating the nesting of a start delimiters.")
405 (systemStartDelimiter ,symbol? "Which grob to make for the start of
406 the system/staff? Set to @code{SystemStartBrace},
407 @code{SystemStartBracket} or @code{SystemStartBar}.")
409 (tablatureFormat ,procedure? "Function formatting a tab note head; it
410 takes a string number, a list of string tunings and Pitch object. It
411 returns the text as a string.")
413 (tieWaitForNote ,boolean? "If true, tied notes do not have to follow each other directly.
414 This can be used for writing out arpeggios")
415 (timeSignatureFraction ,number-pair?
416 "pair of numbers, signifying the time
417 signature. For example @code{#'(4 . 4)} is a 4/4 time signature.")
419 (timing ,boolean? " Keep administration of measure length, position, bar number, etc?
420 Switch off for cadenzas.")
422 "The tonic of the current scale")
424 (tremoloFlags ,integer? "Number of tremolo flags to add if no
425 number is specified.")
427 (tupletFullLength ,boolean? "If set, the tuplet is printed up to
428 the start of the next note.")
429 (tupletFullLengthNote ,boolean? "If set, end at the next note, otherwise end on the matter (time sigs, etc.) before the note.")
430 (tupletSpannerDuration ,ly:moment? "
431 Normally a tuplet bracket is as wide as the
432 @code{\\times} expression that gave rise to it. By setting this
433 property, you can make brackets last shorter. Example
437 \\set tupletSpannerDuration = #(ly:make-moment 1 4)
438 \\times 2/3 @{ c8 c c c c c @}
443 (useBassFigureExtenders ,boolean? "Whether to use extender lines
444 for repeated bass figures")
446 (verticallySpacedContexts ,list? "List of symbols, containing
447 context names whose vertical axis groups should be taken into account for
448 vertical spacing of systems.")
450 (vocalName ,markup? "Name of a vocal line.")
452 (voltaOnThisStaff ,boolean?
453 "Normally, volta brackets are put only on the
454 topmost staff. This variable overrides this behavior, when set to
455 @code{#t} or @code{#f}.")
457 (voltaSpannerDuration ,ly:moment? "This specifies the maximum duration
458 to use for the brackets printed for @code{\\alternative}. This can be
459 used to shrink the length of brackets in the situation where one
460 alternative is very large.")
464 "This property is read to determine what type of bar line to create.
468 \\set Staff.whichBar = \"|:\"
471 This will create a start-repeat bar in this staff only.
472 Valid values are described in @internalsref{bar-line-interface}.
474 (tempoWholesPerMinute ,ly:moment? "The tempo in whole notes per minute.")
475 (tempoUnitDuration ,ly:duration? "Unit for specifying tempo.")
476 (tempoUnitCount ,number? "Count for specifying tempo.")
480 (define-public all-internal-translation-properties
483 (set-object-property! (car x) 'internal-translation #t)
484 (apply translator-property-description x)
488 `((slurMelismaBusy ,boolean? "Signal if a slur is present.")
489 (originalMiddleCPosition
491 "Used for temporary overriding middle C in octavation brackets. ")
492 (melismaBusy ,boolean? "Signifies
493 whether a melisma is active. This can be used to signal melismas on
494 top of those automatically detected. ")
495 (graceSettings ,list?
496 "Overrides for grace notes. This property should
497 be manipulated through the @code{add-grace-property} function.")
498 (currentCommandColumn ,ly:grob? "Grob that is X-parent to all
499 current breakable (clef, key signature, etc.) items.")
500 (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
501 non-breakable items (note heads, lyrics, etc.).")
502 (breakableSeparationItem ,ly:grob?
503 "The breakable items in this time step,
506 (localKeySignature ,list? "the key signature at this point in the
507 measure. The format is the same as for keySignature, but can also
508 contain ((@var{octave} . @var{name}) . (@var{alter} . @var{barnumber}))
509 pairs. It is reset at every bar line.")
511 (finalizations ,list? "List of expressions to evaluate before proceeding to next time step. Internal variable.")
512 (busyGrobs ,list? "a queue of (@var{end-moment} . @var{GROB})
513 conses. This is for internal (C++) use only. This property contains
514 the grobs which are still busy (e.g. note heads, spanners, etc.)
516 (barCheckLastFail ,ly:moment? "Where in the measure did the last barcheck fail?")
517 (associatedVoiceContext ,ly:context? "The context object of the Voice that has the melody for this Lyrics.")
518 (beamMelismaBusy ,boolean? "Signal if a beam is present.")
519 (dynamicAbsoluteVolumeFunction ,procedure? "[DOCUMENT-ME]")
521 (lastKeySignature ,list? "Last key signature before a key
523 (rootSystem ,ly:grob? "The System object")
524 (scriptDefinitions ,list? "Description of scripts. This is used by
525 Script_engraver for typesetting note-super/subscripts. See
526 @file{scm/script.scm} for more information
528 (quotedEventTypes ,list? "List of symbols, representing the
529 event types that should be duplicated for @code{\\quote} commands.")
531 ; (quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
532 (stavesFound ,grob-list? "list of all staff-symbols found.")
533 (instrumentSupport ,grob-list? "list of grobs to attach instrument name
535 (tieMelismaBusy ,boolean? "Signal whether a tie is present.")
538 (define-public all-translation-properties
539 (append all-user-translation-properties
540 all-internal-translation-properties))
542 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
544 (define-public default-melisma-properties '(melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy))