]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/properties.itely
release: 1.3.18
[lilypond.git] / Documentation / user / properties.itely
1 @node Properties, , , Reference Manual
2
3 Properties are Scheme values, so they have a type.  The type of a
4 property is listed in parentheses after the property name.
5
6 @macro propertytype{t}
7  (\t\)
8 @end macro
9
10 @table @samp
11   @item @code{Generic_property_list} Defines names and types for
12 generic properties. These are properties than can be plugged into the
13 backend directly. See the init file @file{generic-property.scm} for
14 details.  For internal use only.
15
16 @cindex properties!Lyrics
17
18 @table @samp
19   @item @code{textStyle}@indexcode{textStyle} @propertytype{string}
20     Set the font for lyrics.  The available font choices are
21     @code{roman}, @code{italic}, @code{bold}, @code{large}, @code{Large},
22     @code{typewriter}, and @code{finger}.  The @code{finger} font can
23     only display numbers.  Note also that you must be careful when
24     using @code{\property} in Lyrics mode, because of the way strings
25     are parsed.  Either put quotes around the arguments to
26     @code{\property} or be sure to leave a space on both sides of the
27     dot.
28 @end table
29
30
31 @cindex properties!Thread
32
33 @table @samp
34   @item @code{noteheadStyle}@indexcode{noteheadStyle} @propertytype{string}
35     Selects type of note head.  Choices are @code{cross},
36     @code{diamond}, @code{harmonic}, @code{transparent}, and @code{""}. 
37     They are shown in that order below.
38
39     @mudela[center,verbatim]
40       \score {
41         \notes { 
42           \property Staff.barNonAuto = 1
43           \property Voice.noteHeadStyle = cross 
44           a'
45           \property Voice.noteHeadStyle = diamond
46           a'
47           \property Voice.noteHeadStyle = harmonic
48           a'
49           \property Voice.noteHeadStyle = transparent
50           a' 
51           \property Voice.noteHeadStyle = ""
52           a'
53         }
54         \paper {
55           linewidth = -1.;
56         }
57       }
58     
59 @end mudela
60 @end table
61
62 @subsubheading Grace properties
63
64 @cindex properties!Grace
65
66  
67 @table @samp  
68   @item @code{stemStyle}@indexcode{flagStyle} @propertytype{string}
69     By default set to @code{"grace"} meaning that all unbeamed 
70     notes with flags are typeset with a slash through the flag. 
71     Setting to @code{""} gives standard flags.
72
73 @mudela[verbatim]
74 c'8 \property Voice.flagStyle = "grace" c'8
75 @end mudela
76 @end table
77
78
79 @subsubheading Voice properties
80
81 @cindex properties!Voice
82
83 @table @samp  
84   @item @code{abbrev}@indexcode{abbrev} @propertytype{integer}
85     Set length for tremolo to be used if no length is explicitly
86     specified. 
87
88   @item @code{articulationScriptPadding}@indexcode{articulationScriptPadding}
89     Determines the extra space added between articulation marks, such
90     as staccato, tenuto, trill, up/down bow or fermata, and the
91     closest staff line or note.
92
93   @item @code{articulationScriptVerticalDirection} @propertytype{direction}
94     @indexcode{articulationScriptVerticalDirection}  
95     Determines the location of articulation marks.  Set to @code{\up}
96     to print marks above the staff; set to @code{\down} to print marks
97     below the staff.  This property does not override explicit
98     directions marked with `@code{^}' or `@code{_}' in the mudela file.
99     
100   @item @code{noAutoBeaming}@indexcode{beamAuto}  @propertytype{boolean}
101     If set to 1 then beams are not generated automatically.
102
103   @item @code{beamAutoEnd}@indexcode{beamAutoEnd}  @propertytype{?}
104     Specifies when automatically generated beams can end.  See
105     section XREF-autobeam [FIXME].
106
107   @item @code{beamAutoBegin}@indexcode{beamAutoBegin}  @propertytype{?}
108     Specifies when automatically generated beams can start.  See
109     section XREF-autobeam [FIXME].
110
111
112 [outdated FIXME]
113   @item @code{beamQuantisation}@indexcode{beamQuantisation} @propertytype{symbol}
114     Set to @code{\none} for no quantization.  Set to @code{\normal} to
115     quantize position and slope.  Set to @code{\traditional} to avoid
116     wedges.  These three settings are available via
117     @code{\beamposfree}@keyindex{beamposfree},
118     @code{\beamposnormal}@keyindex{beamposnormal}, and
119     @code{\beampostraditional}@keyindex{beampostraditional}.
120
121   @item @code{beamSlopeDamping}@indexcode{beamSlopeDamping} @propertytype{number}
122     Set to @code{\none} for undamped beams.  Set to @code{\normal} for
123     damped beams.  Set to @code{\infinity} for beams with zero slope. 
124     The identifiers
125     @code{\beamslopeproportional}@keyindex{beamslopeproportional},
126     @code{\beamslopedamped}@keyindex{beamslopedamped}, and
127     @code{\beamslopezero}@keyindex{beamslopezero} each set the
128     corresponding value.
129
130   @item @code{dynamicDirection}@indexcode{dynamicDirection} @propertytype{direction}
131     Determines location of dynamic marks.  Set to @code{\up} to print
132     marks above the staff; set to @code{\down} to print marks below
133     the staff.
134
135   @item @code{dynamicStyle}@indexcode{dynamicStyle} @propertytype{string}
136     Set the text style for dynamics.
137
138   @item @code{fontSize}@indexcode{fontSize} @propertytype{number}
139     Can be used to select smaller font sizes for music.  The normal
140     font size is 0, and the two smaller sizes are -1
141     and -2.
142
143 @mudela[verbatim]
144 c''16 \property Staff.fontSize = -2 c''16
145 @end mudela
146
147    @item @code{forceHorizontalShift}@indexcode{forceHorizontalShift}  
148     Force horizontal shift for collision resolution.  It overrides
149     automatic collision resolution.  The value is the shift amount
150     expressed in @code{note_width}, as set in the paper section.
151
152 @mudelafile[verbatim]{force-hshift.sly}
153
154
155 [FIXME: this should be moved]
156
157 Lilypond always arranges note heads on alternate sides of a stem (that
158 is, within a single voice) as necessary to prevent collisions (note head
159 overlaps).  For up stems, the upper note of a colliding pair is placed
160 on the right side of the stem, the lower on the left. For down stems,
161 the algorithm works in reverse.
162   
163 Lily also attempts to prevent collisions of note heads in different
164 voices. A situation where chords of two or more voices are played
165 simultaneously within one staff.
166
167 By default, if only two voices (and both have opposite stem directions)
168 are in this 'collision group', the notes both are shifted by @code{0.5
169 \quartwidth} if there are unisons or seconds between the voices.
170
171 If there are more than two voices in a collision group, shifting is
172 inactive by default, since in this case, there are multiple chords with
173 the same stem direction. By  distinguish between those chords, LilyPond
174 can do collision resolution in these cases as well.  
175
176 Distinguishing between voices with the same stem direction, is done by
177 setting the property @code{Voice.horizontalNoteShift}.  It must be set
178 to a different integer for each voice. Then, all note heads in collision
179 groups (not just unisons and seconds) will be offset, one voice relative
180 another.  The following fragment of sheet music shows how shifting is
181 done, with values of @code{horizontalNoteShift} printed over and under
182 the notes. In this case the chords are just simple notes.
183
184 @c URG : mudela book bug.
185 @mudela[singleline,verbatim]
186 \score {
187         \notes \context Staff <
188                 \context Voice  = VA { \stemup f''4^"0" }
189                 \context Voice  = VB {\stemup
190                 \property Voice.horizontalNoteShift = 1 d''4^" 1" }
191                 \context Voice  = VC { \stemup \property
192 Voice.horizontalNoteShift = 2 b'4^"  2" }
193                 \context Voice  = VD { \stemdown \property
194 Voice.horizontalNoteShift = 1 g'4_"1 " }
195                 \context Voice  = VE { \stemdown e'4_"0" }
196         >
197 }
198 @end mudela
199
200 If you are not satisfied with the collision resolution of LilyPond, you
201 can override the horizontal shift value of the chord of one Voice, by
202 setting @code{forceHorizontalShift}.  This sets the amount shift,
203 measured in black note head widths.
204
205 To take complete control of note position shifts in complex passages,
206 you have set things up for normal collisions and override all shifts by
207 setting @code{forceHorizontalShift} to zero everywhere
208 @example
209 \property Voice.horizontalNoteShift = <n>
210 \property Voice.forceHorizontalShift = "0.0"
211 @end example
212
213 Then you can set the force property to a suitable value before each note
214 that really needs it (unisons and seconds), and reset it to 0.0 after
215 the note.  
216
217   @item @code{horizontalNoteShift}@indexcode{horizontalNoteShift}  @property{integer}
218     Enable LilyPond to shift notes horizontally if they collide with
219     other notes.  This is useful when typesetting many voices on one
220     staff.  The identifier @code{\shift}@keyindex{shift} is defined to
221     enable this.  Traditionally, the outer chords (the upmost and
222     downmost voices), should have no @code{horizontalNoteShift}.
223
224   @item @code{markScriptPadding}@indexcode{markScriptPadding}  @propertytype{number}
225     Determines the extra space added between the mark and the closest
226     staff line or note.
227
228   @item @code{markDirection}@indexcode{markDirection} @propertytype{direction}
229     Determines if marks should be printed above or below the staff.
230     Set to @code{\up} to print marks above the staff; set to
231     @code{\down} to print marks below the staff.
232
233   @item @code{midiInstrument}@indexcode{midiInstrument} @propertytype{string}
234     Sets the instrument for MIDI output.  If this property is not set
235     then LilyPond will use the @code{instrument} property.  This must
236     be set to one of the strings on the list of MIDI instruments that
237     appears in section XREF-midilist [FIXME].  If you use a string which
238     is not listed, LilyPond will silently substitute piano.
239
240   @item @code{restStyle}@indexcode{restStyle} @propertytype{string}
241     Change the layout of rests shorter than quarter notes. 
242     Currently, the standard layout @code{""} and mensural notation
243     @code{"mensural"} are available. Mensural rests of duration
244     32 or shorter are not available.
245 @mudela[verbatim]
246 r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 
247 \property Staff.restStyle = "mensural"
248 r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 
249 @end mudela
250
251   @item @code{scriptHorizontal}@indexcode{scriptHorizontal} @propertytype{boolean}
252     Put scripts left or right of note heads.  Support for this is
253     limited.  Accidentals will collide with scripts.
254     
255   @item @code{slurVerticalDirection}@indexcode{slurVerticalDirection} @propertytype{direction}
256     Set to @code{\free} for free choice of slur direction, set to
257     @code{\up} to force slurs up, set to @code{\down} to force slurs
258     down.  The shorthands @code{\slurup}@keyindex{slurup},
259     @code{\slurdown}@keyindex{slurdown}, and
260     @code{\slurboth}@keyindex{slurboth} are available.
261
262   @item @code{slurDash}@indexcode{slurDash} @propertytype{number}
263     Set to NIL for normal slurs, 1 for dotted slurs, and a
264     larger value for dashed slurs.  Identifiers
265     @code{\slurnormal}@keyindex{slurnormal} and
266     @code{\slurdotted}@keyindex{slurdotted} are predefined to set the
267     first two settings.
268
269 @mudela[verbatim]
270                 c4( )d
271                 \property Voice.slurDash = 3
272                 c ( )e
273 @end mudela             
274
275 @item @code{stemLength}@indexcode{stemLength}  
276     Set length of stems.  Unit is `@code{interline}/2', so
277     @code{stemLength} defaults to 7.
278 @mudela[verbatim]
279 g''4 \property Voice.stemLength = #14  g4 \property Voice.stemLength = #3 g4  g,,4  
280 @end mudela
281
282   @item @code{stemLeftBeamCount}@indexcode{stemLeftBeamCount} @propertytype{integer}
283     Specify the number of beams to draw on the left side of the next
284     note.  Overrides automatic beaming.  The value is only used once,
285     and then it is erased.
286
287   @item @code{stemRightBeamCount}@indexcode{stemRightBeamCount} @propertytype{integer}
288     Specify the number of beams to draw on the right side of the next
289     note.  Overrides automatic beaming.  The value is only used once,
290     and then it is erased.
291
292   @item @code{tieVerticalDirection}@indexcode{tieVerticalDirection} @propertytype{direction}
293     Set to @code{\free} for free choice of tie direction, set to
294     @code{\up} to force ties up, set to @code{\down} to force ties
295     down.
296
297   @item @code{transposing}@indexcode{transposing} @propertytype{integer}
298     Transpose the MIDI output.  Set this property to the number of
299     half-steps to transpose by.
300
301   @item @code{textEmptyDimension}@indexcode{textEmptyDimension} @propertytype{boolean}
302     If set to true then text placed above or below the staff is
303     assumed to have zero width.  @code{fatText} and @code{emptyText}
304 are predefined settings.
305
306 @mudela[verbatim]
307 c4^"foo"  \emptyText c4^"foo" c4
308 @end mudela
309
310   @item @code{textStyle}@indexcode{textStyle} @propertytype{string}
311     Set the text style for superscripts and subscripts.  See above
312     for list of text styles.
313
314   @item @code{textScriptPadding}@indexcode{textScriptPadding}  @propertytype{number}
315     Determines the extra space added between superscripted resp.
316     subscripted text and the closest staff line or note.
317
318   @item @code{verticalDirection}@indexcode{verticalDirection} @propertytype{direction}
319     Determines the direction of stems, subscripts, beams, slurs, and
320     ties.  Set to @code{\down} to force them down, @code{\up} to force
321     them up, or @code{\free} to let LilyPond decide.  This can be used
322     to distinguish between voices on the same staff.  The
323     @code{\stemdown}@keyindex{stemdown}, @code{\stemup}@keyindex{stemup},
324     and @code{\stemboth}@keyindex{stemboth} identifiers set this
325     property.
326     
327
328   @item @code{tupletDirection}@indexcode{tupletDirection} @propertytype{direction}
329     Determines the direction of triplets and other tuplets.  Set to
330     @code{\down} to force them below the staff, @code{\up} to force
331     them above, or @code{\free} to let LilyPond decide.
332
333   @item @code{tupletVisibility}@indexcode{tupletVisibility} @propertytype{number}
334     [deprecate this, FIXME]
335     Determines whether tuplets of notes are labeled.  Setting
336     to 0 shows nothing; setting to 1 shows a number;
337     setting to 2 shows a number and a bracket if there is no
338     beam; setting to 3 shows a number, and if there is no beam
339     it adds a bracket; setting to 4 shows both a number and a
340     bracket unconditionally.
341
342 @end table
343
344 @subsubheading Staff properties
345
346 @cindex properties!Staff
347
348 @table @samp
349  
350   @item @code{barNonAuto}@indexcode{barNonAuto} @propertytype{boolean}
351     If set to true then bar lines will not be printed
352     automatically; they must be explicitly created with @code{\bar}
353     keywords.  Unlike with the @code{\cadenza} keyword, measures are
354     still counted.  Bar generation will resume according to that
355     count if this property is set to zero.
356
357   @item @code{barNumberDirection}@indexcode{barNumberDirection} @propertytype{direction}
358     Set to @code{\up} or @code{\down} to put bar numbers above or below
359     the staff.
360
361   @item @code{barNumberScriptPadding}@indexcode{barNumberScriptPadding}  
362     Sets extra space between the bar number and the bar it labels.
363
364   @item @code{barSize}@indexcode{barSize}  
365     Specify the height of the bar lines if it should be different
366     than the staff height.
367 @mudela[verbatim]
368 c1 c1 \property Staff.barSize = 20 c1 c1 
369 @end mudela
370
371   @item @code{barAtLineStart}@indexcode{barAtLineStart} @propertytype{boolean}
372     Set to true to produce a bar line after the clef at the start
373     of each line (but not at the beginning of the music).
374
375         [BROKEN]
376
377   @item @code{clefStyle}@indexcode{clefStyle} @propertytype{string}
378     Determines how clefs are typeset.  If set to @code{transparent},
379     the clefs are not printed at all, if set to
380     @code{fullSizeChanges}, clef changes in the middle of a line are
381     typeset with a full size clef.  By default, clef changes are
382     typeset in smaller size.
383
384   @item @code{supportedClefTypes}@indexcode{supportedClefTypes} @propertytype{alist}
385
386         Clef settings supported. The value is an association list clef
387 descriptions indexed by clef name (alto, baritone, etc.).  A clef
388 description is a list with the glyph name, and the staff position
389 where it should go. For internal use.
390
391   @item @code{clefPitches}@indexcode{clefPitches} @propertytype{alist}
392     Settings for the position of the central C, relative to this clef
393     symbol.  For internal use.
394    
395   @item @code{defaultClef}@indexcode{defaultClef} @propertytype{string}
396         Clef setting to use when this context is created.  If unset,
397 no clef is printed upon creation.
398
399   @item @code{marginDirection}@indexcode{marginDirection} @propertytype{direction}
400     Set to @code{\left} or @code{\right} to specify location of
401     marginal scripts.
402
403   @item @code{marginScriptPadding}@indexcode{marginScriptPadding}  
404     Specify extra space for marginal scripts.
405
406   @item @code{forgetAccidentals}@indexcode{forgetAccidentals} @propertytype{boolean}
407     Causes accidentals to be printed at every note instead of
408     remembered for the duration of a measure.
409
410   @item @code{noResetKey}@indexcode{noResetKey} @propertytype{boolean}
411     Do not reset the key at the start of a measure.  Accidentals will
412     be printed only once and are in effect until overridden, possibly
413     many measures later.
414
415   @item @code{staffSpace}@indexcode{staffLineLeading}   @propertytype{number}   
416     Specifies the distance (in points) between lines of the staff.
417
418   @item @code{numberOfStaffLines}@indexcode{numberOfStaffLines} @propertytype{integer}
419     Specifies the number of staff lines.  The default is 5.
420
421   @item @code{postBreakPadding}@indexcode{postBreakPadding}   @propertytype{number}
422     Extra space in points to be added after the clef, time signature
423     and key signature on the staff.  Deprecated, do not use.
424
425   @item @code{noVoltaBraces}@indexcode{noVoltaBraces} @propertytype{boolean}
426     Set to true to suppress the printing of brackets over alternate
427     endings specified by the command @code{\alternative}.
428
429  
430   @item @code{barAlways}@indexcode{barAlways} @propertytype{boolean}
431     If set to true a bar line is drawn after each note.
432
433   @item @code{defaultBarType}@indexcode{defaultBarType} @propertytype{string}
434     Sets the default type of bar line. See Section XREF-barlines [FIXME] 
435     for a list of available bar types.
436
437   @item @code{instrument}, @code{instr} @propertytype{string}
438     @indexcode{instrument}@indexcode{instr}  
439     If @code{Staff_margin_engraver}
440 @cindex Staff_margin_engraver
441  is
442     added to the Staff translator, then the @code{instrument} property
443     is used to label the first line of the staff and the @code{instr}
444     property is used to label subsequent lines.  If the
445     @code{midiInstrument} property is not set, then @code{instrument}
446     is used to determine the instrument for MIDI output.
447
448   @item @code{keyOctaviation}@indexcode{keyOctaviation} @propertytype{boolean}
449     If set to TRUE, then keys are the same in all octaves.  If set
450     to FALSE then the key signature for different octaves can be
451     different and is specified independently:
452
453     @example
454       \keysignature bes fis'
455     @end example
456
457     The default value is 1.  Can be set to zero with
458     @code{\specialkey} or reset to 1 with @code{\normalkey}.
459
460   @item @code{timeSignatureStyle}@indexcode{timeSignatureStyle} @propertytype{string}
461     Changes the default two-digit layout for time signatures.  The
462     following values are recognized:
463
464     @table @samp
465       @item @code{C}@indexcode{C}  
466         4/4 and 2/2 are typeset as C and struck C, respectively.  All
467         other time signatures are written with two digits.
468
469       @item @code{old}@indexcode{old}  
470         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
471         typeset with old-style mensuration marks.  All other time
472         signatures are written with two digits.
473
474       @item @code{1}@indexcode{1}  
475         All time signatures are typeset with a single
476         digit, e.g. 3/2 is written as 3.
477
478       @item @indexcode{CM/N}@code{C}@var{M}@code{/}@var{N}, 
479       @indexcode{oldM/N}@code{old}@var{M}@code{/}@var{N} or
480       @code{old6/8alt}@indexcode{old6/8alt}  
481         Tells LilyPond to use a specific symbol as time signature.
482     @end table
483
484     The different time signature characters are shown below with its
485     names:
486
487     @mudela[center,verbatim]
488
489       \score {
490         \notes\relative c'' {
491           \property Voice.textStyle = typewriter
492           \property Staff.timeSignatureStyle = "C2/2"
493           \time 2/2; a2^"C2/2" a2 
494           \property Staff.timeSignatureStyle = "C4/4"
495           \time 2/2; a2^"C4/4" a2 
496           \property Staff.timeSignatureStyle = "old2/2"
497           \time 2/2; a2^"old2/2" a2 
498           \property Staff.timeSignatureStyle = "old3/2"
499           \time 2/2; a2^"old3/2" a2 
500           \property Staff.timeSignatureStyle = "old2/4"
501           \time 2/2; a2^"old2/4" a2 
502           \property Staff.timeSignatureStyle = "old4/4"
503           \time 2/2; a2^"old4/4" a2 
504           \property Staff.timeSignatureStyle = "old6/4"
505           \time 2/2; a2^"old6/4" a2 
506           \property Staff.timeSignatureStyle = "old9/4"
507           \time 2/2; a2^"old9/4" a2 
508           \property Staff.timeSignatureStyle = "old4/8"
509           \time 2/2; a2^"old4/8" a2 
510           \property Staff.timeSignatureStyle = "old6/8"
511           \time 2/2; a2^"old6/8" a2 
512           \property Staff.timeSignatureStyle = "old6/8alt"
513           \time 2/2; a2^"old6/8alt" a2 
514           \property Staff.timeSignatureStyle = "old9/8"
515           \time 2/2; a2^"old9/8" a2 
516         }
517         \paper {
518           linewidth = 4.5 \in;
519         }
520       }
521     
522 @end mudela
523
524   @item @code{voltaSpannerDuration}@indexcode{voltaSpannerDuration} @propertytype{moment}
525     Set to an integer to control the size of the brackets printed by
526     @code{\alternative}.  The integer specifies the number of whole
527     notes duration to use for the brackets.  It is rounded to the
528     nearest measure.  This can be used to shrink the length of
529     brackets in the situation where one alternative is very large. 
530     It may have odd effects if the specified duration is longer than
531     the music given in an @code{\alternative}.
532 @end table
533    
534
535 @cindex properties!GrandStaff
536
537 @table @samp 
538   @item @code{alignmentReference}@indexcode{alignmentReference}
539 @propertytype{direction}
540     Set to @code{\center} for vertical alignment reference point to be
541     in the center of the vertical group.  Set to @code{\up} to put the
542     reference point at the top of the group.
543
544   @item @code{maxVerticalAlign}@indexcode{maxVerticalAlign}  @propertytype{number}
545     Set the maximum vertical distance between staffs.
546
547   @item @code{minVerticalAlign}@indexcode{minVerticalAlign}  @propertytype{number}
548     Set the minimum vertical distance between staffs.  
549 @end table
550
551
552 @cindex properties!Score
553
554 @table @samp
555   @item @code{skipBars}@indexcode{skipBars} @propertytype{boolean}
556     Set to 1 to skip the empty bars that are produced by
557     multimeasure notes and rests.  These bars will not appear on the
558     printed output.  Set to zero (the default) to expand multimeasure
559     notes and rests into their full length, printing the appropriate
560     number of empty bars so that synchronization with other voices is
561     preserved.
562
563     @quotation
564
565 @mudela[fragment,verbatim,center]
566 r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
567
568 @end mudela
569     @end quotation
570
571 @end table
572
573
574 @cindex properties!ChordNamesVoice
575
576 @table @samp
577   @item @code{chordInversion}@indexcode{chordInversion} @propertytype{boolean}
578     Determines whether LilyPond should look for chord inversions when
579     translating from notes to chord names.  Set to 1 to find
580     inversions.  The default is 0 which does not look for
581     inversions.
582 @end table
583