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