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