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