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