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