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