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