]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/changing-defaults.itely
Clarifications and reorg.
[lilypond.git] / Documentation / user / changing-defaults.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @node Changing defaults
3 @chapter Changing defaults
4
5
6 The purpose of LilyPond's design is to provide the finest output
7 quality as a default.  Nevertheless, it may happen that you need to
8 change this default layout.  The layout is controlled through a large
9 number of proverbial ``knobs and switches.''  This chapter does not
10 list each and every knob.  Rather, it outlines what groups of controls
11 are available and explains how to lookup which knob to use for a
12 particular effect.
13
14
15 @cindex Program reference
16
17 The controls available for tuning are described in a separate
18 document, the
19 @iftex
20 Program reference manual.
21 @end iftex
22 @ifnottex
23 @ref{Top,Program reference,,lilypond-internals}.
24 @end ifnottex
25 That manual
26 lists all different variables, functions and options available in
27 LilyPond.  It is written as a HTML document, which is available
28 @uref{http://@/lilypond@/.org/@/doc/@/v2.8/@/Documentation/@/user/@/lilypond@/-internals/,on@/-line},
29 but is also included with the LilyPond documentation package.
30
31 There are four areas where the default settings may be changed:
32
33 @itemize @bullet
34 @item
35 Automatic notation: changing the automatic creation of notation
36 elements.  For example, changing the beaming rules.
37
38 @item
39 Output: changing the appearance of individual
40 objects.  For example, changing stem directions or the location of
41 subscripts.
42   
43 @item
44 Context: changing aspects of the translation from music events to
45 notation.  For example, giving each staff a separate time signature. 
46   
47 @item
48 Global layout: changing the appearance of the spacing, line
49 breaks, and page dimensions.  These modifications are discussed
50 in @ref{Global issues}.
51 @end itemize
52
53 Internally, LilyPond uses Scheme (a LISP dialect) to provide
54 infrastructure.  Overriding layout decisions in effect accesses the
55 program internals, which requires Scheme input.  Scheme elements are
56 introduced in a @code{.ly} file with the hash mark
57 @code{#}.@footnote{@ref{Scheme tutorial} contains a short tutorial
58 on entering numbers, lists, strings, and symbols in Scheme.}
59
60
61 @menu
62 * Automatic notation::          
63 * Interpretation contexts::     
64 * The \override command::       
65 @end menu
66
67  
68 @node Automatic notation
69 @section Automatic notation
70
71 This section describes how to change the way that accidentals and
72 beams are automatically displayed.
73
74 @menu
75 * Automatic accidentals::       
76 * Setting automatic beam behavior::  
77 @end menu
78
79 @node Automatic accidentals
80 @subsection Automatic accidentals
81 @cindex Automatic accidentals
82
83 Common rules for typesetting accidentals have been placed in a
84 function.  This function is called as follows
85
86 @cindex @code{set-accidental-style}
87 @example
88 #(set-accidental-style 'STYLE #('CONTEXT#))
89 @end example
90
91 The function can take two arguments: the name of the accidental style,
92 and an optional argument that denotes the context that should be
93 changed.  If no context name is supplied, @code{Staff} is the default,
94 but you may wish to apply the accidental style to a single @code{Voice}
95 instead.
96
97 The following accidental styles are supported
98 @table @code
99 @item default
100 This is the default typesetting behavior.  It corresponds
101 to 18th century common practice: Accidentals are
102 remembered to the end of the measure in which they occur and
103 only on their own octave.
104
105 @item voice
106 The normal behavior is to remember the accidentals on
107 Staff-level.  This variable, however, typesets accidentals
108 individually for each voice.  Apart from that, the rule is similar to
109 @code{default}.
110
111 As a result, accidentals from one voice do not get canceled in other
112 voices, which is often an unwanted result
113
114 @lilypond[quote,ragged-right,relative=1,fragment,verbatim]
115 \new Staff <<
116   #(set-accidental-style 'voice)
117   <<
118     { es g } \\
119     { c, e }
120 >> >>
121 @end lilypond
122
123 The @code{voice} option should be used if the voices
124 are to be read solely by individual musicians.  If the staff is to be
125 used by one musician (e.g., a conductor) then
126 @code{modern} or @code{modern-cautionary}
127 should be used instead.
128
129 @item modern
130 @cindex @code{modern} style accidentals
131 This rule corresponds to the common practice in the 20th century.  This rule
132 prints the same accidentals as @code{default}, but temporary
133 accidentals also are canceled in other octaves.  Furthermore,
134 in the same octave, they also get canceled in the following
135 measure
136
137 @lilypond[quote,ragged-right,fragment,verbatim]
138 #(set-accidental-style 'modern)
139 cis' c'' cis'2 | c'' c'
140 @end lilypond
141
142 @item @code{modern-cautionary}
143 @cindex @code{modern-cautionary}
144 This rule is similar to @code{modern}, but the ``extra'' accidentals
145 (the ones not typeset by @code{default}) are typeset as cautionary
146 accidentals.  They are printed in reduced size or with parentheses
147 @lilypond[quote,ragged-right,fragment,verbatim]
148 #(set-accidental-style 'modern-cautionary)
149 cis' c'' cis'2 | c'' c'
150 @end lilypond
151
152 @cindex @code{modern-voice}
153 @item modern-voice
154 This rule is used for multivoice accidentals to be read both by musicians
155 playing one voice and musicians playing all voices.  Accidentals are
156 typeset for each voice, but they @emph{are} canceled across voices in
157 the same @internalsref{Staff}.
158
159 @cindex @code{modern-voice-cautionary}
160 @item modern-voice-cautionary
161 This rule is the same as @code{modern-voice}, but with the extra
162 accidentals (the ones not typeset by @code{voice}) typeset
163 as cautionaries.  Even though all accidentals typeset by
164 @code{default} @emph{are} typeset by this variable,
165 some of them are typeset as cautionaries.
166
167 @item piano
168 @cindex @code{piano} accidentals
169 This rule reflects 20th century practice for piano notation.  Very similar to
170 @code{modern} but accidentals also get canceled
171 across the staves in the same @internalsref{GrandStaff} or
172 @internalsref{PianoStaff}.
173
174 @item piano-cautionary
175 @cindex @code{#(set-accidental-style 'piano-cautionary)}
176 Same as @code{#(set-accidental-style 'piano)} but with the extra
177 accidentals typeset as cautionaries.
178
179 @item no-reset
180 @cindex @code{no-reset} accidental style
181 This is the same as @code{default} but with accidentals lasting
182 ``forever'' and not only until the next measure
183 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
184 #(set-accidental-style 'no-reset)
185 c1 cis cis c
186 @end lilypond
187
188 @item forget
189 This is sort of the opposite of @code{no-reset}: Accidentals
190 are not remembered at all---and hence all accidentals are
191 typeset relative to the key signature, regardless of what was
192 before in the music
193
194 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
195 #(set-accidental-style 'forget)
196 \key d\major c4 c cis cis d d dis dis
197 @end lilypond
198 @end table
199
200
201 @seealso
202
203 Program reference: @internalsref{Accidental_engraver},
204 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
205
206
207 @refbugs
208
209 Simultaneous notes are considered to be entered in sequential
210 mode.  This means that in a chord the accidentals are typeset as if the
211 notes in the chord happen one at a time, in the order in which
212 they appear in the input file.  This is a problem when accidentals
213 in a chord depend on each other,
214 which does not happen for the default accidental style.  The problem
215 can be solved by manually inserting @code{!} and @code{?} for the
216 problematic notes.
217
218
219 @node Setting automatic beam behavior
220 @subsection Setting automatic beam behavior
221
222 @cindex @code{autoBeamSettings}
223 @cindex @code{(end * * * *)}
224 @cindex @code{(begin * * * *)}
225 @cindex automatic beams, tuning
226 @cindex tuning automatic beaming
227
228 @c [TODO: use \applyContext]
229
230 In normal time signatures, automatic beams can start on any note but can
231 only end in a few positions within the measure: beams can end on a beat,
232 or at durations specified by the properties in
233 @code{autoBeamSettings}.  The properties in @code{autoBeamSettings}
234 consist of a list of rules for where beams can begin and end.  The
235 default @code{autoBeamSettings} rules are defined in
236 @file{scm/@/auto@/-beam@/.scm}.
237
238 In order to add a rule to the list, use
239 @example
240 #(override-auto-beam-setting '(be p q n m) a b [context])
241 @end example
242
243 @itemize @bullet
244
245 @item @code{be} is either "begin" or "end".
246
247 @item @code{p/q} is the duration of the note for which you want
248 to add a rule.  A beam is considered to have the duration of its
249 shortest note.  Set @code{p} and @code{q} to @code{'*'} to
250 have this apply to any beam.
251
252 @item @code{n/m} is the time signature to which
253 this rule should apply.  Set @code{n} and @code{m} to @code{'*'}
254 to have this apply in any time signature.
255
256 @item @code{a/b} is the position in the bar at which the beam should begin/end.
257
258 @item @code{context} is optional, and it specifies the context at which
259 the change should be made.  The default is @code{'Voice}.
260 @code{#(score-override-auto-beam-setting '(A B C D) E F)} is equivalent to
261 @code{#(override-auto-beam-setting '(A B C D) E F 'Score)}.
262
263 @end itemize
264
265 For example, if automatic beams should always end on the first quarter
266 note, use
267
268 @example
269 #(override-auto-beam-setting '(end * * * *) 1 4)
270 @end example
271
272 You can force the beam settings to only take effect on beams whose shortest
273 note is a certain duration
274
275 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
276 \time 2/4
277 #(override-auto-beam-setting '(end 1 16 * *) 1 16)
278 a16 a a a a a a a |
279 a32 a a a a16 a a a a a |
280 #(override-auto-beam-setting '(end 1 32 * *) 1 16)
281 a32 a a a a16 a a a a a |
282 @end lilypond
283
284 You can force the beam settings to only take effect in certain time
285 signatures
286
287 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
288 \time 5/8
289 #(override-auto-beam-setting '(end * * 5 8) 2 8)
290 c8 c d d d
291 \time 4/4
292 e8 e f f e e d d
293 \time 5/8
294 c8 c d d d
295 @end lilypond
296
297 You can also remove a previously set beam-ending rule by using
298
299 @example
300 #(revert-auto-beam-setting '(be p q n m) a b [context])
301 @end example
302
303 @noindent
304 be, p, q, n, m, a, b and context are the same as above.  Note that the
305 default rules are specified in @file{scm/@/auto@/-beam@/.scm},
306 so you can revert rules that you did not explicitly create.
307
308 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
309 \time 4/4
310 a16 a a a a a a a a a a a a a a a
311 #(revert-auto-beam-setting '(end 1 16 4 4) 1 4)
312 a16 a a a a a a a a a a a a a a a
313 @end lilypond
314
315 The rule in a revert-auto-beam-setting statement must exactly match the
316 original rule.  That is, no wildcard expansion is taken into account.
317
318 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
319 \time 1/4
320 #(override-auto-beam-setting '(end 1 16 1 4) 1 8)
321 a16 a a a
322 #(revert-auto-beam-setting '(end 1 16 * *) 1 8) % this won't revert it!
323 a a a a
324 #(revert-auto-beam-setting '(end 1 16 1 4) 1 8) % this will
325 a a a a
326 @end lilypond
327
328
329
330 @c TODO:  old material -- not covered by above stuff, I think.
331 If automatic beams should end on every quarter in 5/4 time, specify
332 all endings
333 @example
334 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
335 #(override-auto-beam-setting '(end * * * *) 1 2 'Staff)
336 #(override-auto-beam-setting '(end * * * *) 3 4 'Staff)
337 #(override-auto-beam-setting '(end * * * *) 5 4 'Staff)
338 @dots{}
339 @end example
340
341 The same syntax can be used to specify beam starting points.  In this
342 example, automatic beams can only end on a dotted quarter note
343 @example
344 #(override-auto-beam-setting '(end * * * *) 3 8)
345 #(override-auto-beam-setting '(end * * * *) 1 2)
346 #(override-auto-beam-setting '(end * * * *) 7 8)
347 @end example
348 In 4/4 time signature, this means that automatic beams could end only on
349 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
350 3/8, has passed within the measure).
351
352 @cindex automatic beam generation
353 @cindex autobeam
354 @cindex @code{autoBeaming}
355 @cindex lyrics
356
357 If beams are used to indicate melismata in songs, then automatic
358 beaming should be switched off with @code{\autoBeamOff}.
359
360
361 @refcommands
362
363 @cindex @code{\autoBeamOff}
364 @code{\autoBeamOff},
365 @cindex @code{\autoBeamOn}
366 @code{\autoBeamOn}.
367
368
369 @refbugs
370
371 If a score ends while an automatic beam has not been ended and is
372 still accepting notes, this last beam will not be typeset at all.  The
373 same holds polyphonic voices, entered with @code{<< @dots{} \\ @dots{}
374 >>}.  If a polyphonic voice ends while an automatic beam is still
375 accepting notes, it is not typeset.
376
377
378 @node Interpretation contexts
379 @section Interpretation contexts
380
381 When music is printed, a lot of notational elements must be added to the
382 input.  For example, compare the input and output of the following example:
383
384 @lilypond[quote,verbatim,relative=2,fragment]
385 cis4 cis2. g4
386 @end lilypond
387
388 The input is rather sparse, but in the output, bar lines, accidentals,
389 clef, and time signature are added.  LilyPond @emph{interprets} the
390 input.  During this step, the musical information is inspected in time
391 order, similar to reading a score from left to right.  While reading
392 the input, the program remembers where measure boundaries are, and which
393 pitches require explicit accidentals.  This information can be presented on
394 several levels.  For example, the effect of an accidental is limited
395 to a single staff, while a bar line must be synchronized across the
396 entire score.
397
398 Within LilyPond, these rules and bits of information are grouped in
399 @emph{Contexts}.  Some examples of contexts are @context{Voice},
400 @context{Staff}, and @context{Score}.  They are hierarchical, for
401 example: a @context{Staff} can contain many @context{Voice}s, and a
402 @context{Score} can contain many @context{Staff} contexts.
403
404 Each context has the responsibility for enforcing some notation rules,
405 creating some notation objects and maintaining the associated
406 properties.  For example, the @context{Voice} context may introduce an
407 accidental and then the @context{Staff} context maintains the rule to
408 show or suppress the accidental for the remainder of the measure.  The
409 synchronization of bar lines is handled at @context{Score} context.
410
411 However, in some music we may not want the bar lines to be
412 synchronized -- consider a polymetric score in 4/4 and 3/4 time.  In
413 such cases, we must modify the default settings of the @context{Score}
414 and @context{Staff} contexts.
415
416 For very simple scores, contexts are created implicitly, and you need
417 not be aware of them.  For larger pieces, such as anything with more
418 than one staff, they must be
419 created explicitly to make sure that you get as many staves as you
420 need, and that they are in the correct order.  For typesetting pieces
421 with specialized notation, it can be useful to modify existing or
422 to define new contexts.
423
424
425 A complete description of all available contexts is in the program
426 reference, see
427 @ifhtml
428 @internalsref{Contexts}.
429 @end ifhtml
430 @ifnothtml 
431 Translation @arrow{} Context.
432 @end ifnothtml
433
434 @c [TODO: describe propagation]
435
436
437 @menu
438 * Creating contexts::           
439 * Changing context properties on the fly::  
440 * Modifying context plug-ins::  
441 * Layout tunings within contexts::  
442 * Changing context default settings::  
443 * Defining new contexts::       
444 @end menu
445
446 @node Creating contexts
447 @subsection Creating contexts
448
449 For scores with only one voice and one staff, contexts are
450 created automatically.  For more complex scores, it is necessary to
451 create them by hand.  There are three commands that do this.
452
453 @itemize @bullet
454
455 @item
456 The easiest command is @code{\new}, and it also the quickest to type.
457 It is prepended to a music expression, for example
458
459 @cindex @code{\new}
460 @cindex new contexts
461 @cindex Context, creating
462
463 @example
464 \new @var{type} @var{music expression}
465 @end example
466
467 @noindent
468 where @var{type} is a context name (like @code{Staff} or
469 @code{Voice}).  This command creates a new context, and starts
470 interpreting the @var{music expression} with that.
471
472 A practical application of @code{\new} is a score with many
473 staves.  Each part that should be on its own staff, is preceded with 
474 @code{\new Staff}.
475
476 @lilypond[quote,verbatim,relative=2,ragged-right,fragment]
477 <<
478   \new Staff { c4 c }
479   \new Staff { d4 d }
480 >>
481 @end lilypond
482
483 The @code{\new} command may also give a name to the context,
484
485 @example
486 \new @var{type} = @var{id} @var{music}
487 @end example
488 However, this user specified name is only used if there is no other
489 context already earlier with the same name.
490
491
492 @cindex @code{\context}
493 \item
494 Like @code{\new}, the @code{\context} command also directs a music
495 expression to a context object, but gives the context an explicit name.  The
496 syntax is
497
498 @example
499 \context @var{type} = @var{id} @var{music}
500 @end example
501
502 This form will search for an existing context of type @var{type}
503 called @var{id}.  If that context does not exist yet, a new
504 context with the specified name is created.  This is useful if
505 the context is referred to later on.  For example, when
506 setting lyrics the melody is in a named context
507
508 @example
509 \context Voice = "@b{tenor}" @var{music}
510 @end example
511
512 @noindent
513 so the texts can be properly aligned to its notes,
514
515 @example
516 \new Lyrics \lyricsto "@b{tenor}" @var{lyrics} 
517 @end example
518
519 @noindent
520
521 Another possible use of named contexts is funneling two different
522 music expressions into one context.  In the following example,
523 articulations and notes are entered separately,
524
525 @example
526 music = @{ c4 c4 @}
527 arts = @{ s4-. s4-> @}
528 @end example
529
530 They are combined by sending both to the same @context{Voice} context,
531
532 @example
533 <<
534   \new Staff \context Voice = "A" \music
535   \context Voice = "A" \arts
536 >>
537 @end example
538 @lilypond[quote,ragged-right]
539 music = { c4 c4 }
540 arts = { s4-. s4-> }
541 \relative c'' <<
542   \new Staff \context Voice = "A" \music
543   \context Voice = "A" \arts
544 >>
545 @end lilypond
546
547 With this mechanism, it is possible to define an Urtext (original
548 edition), with the option to put several distinct articulations on the
549 same notes.
550
551 @cindex creating contexts
552
553 @item
554 The third command for creating contexts is
555 @example
556 \context @var{type} @var{music}
557 @end example
558
559
560 @noindent
561 This is similar to @code{\context} with @code{= @var{id}}, but matches
562 any context of type @var{type}, regardless of its given name.
563
564 This variant is used with music expressions that can be interpreted at
565 several levels.  For example, the @code{\applyOutput} command (see
566 @ref{Running a function on all layout objects}).  Without an explicit
567 @code{\context}, it is usually applied to @context{Voice}
568
569 @example
570 \applyOutput #@var{function}   % apply to Voice
571 @end example
572
573 To have it interpreted at the @context{Score} or @context{Staff} level use
574 these forms
575
576 @example
577 \context Score \applyOutput #@var{function}
578 \context Staff \applyOutput #@var{function}
579 @end example
580
581 @end itemize
582
583
584 @node Changing context properties on the fly
585 @subsection Changing context properties on the fly
586
587 @cindex properties
588 @cindex @code{\set}
589 @cindex changing properties
590
591 Each context can have different @emph{properties}, variables contained
592 in that context.  They can be changed during the interpretation step.
593 This is achieved by inserting the @code{\set} command in the music,
594
595 @example
596 \set @var{context}.@var{prop} = #@var{value}
597 @end example
598
599 For example,
600 @lilypond[quote,verbatim,relative=2,fragment]
601 R1*2 
602 \set Score.skipBars = ##t
603 R1*2
604 @end lilypond
605
606 This command skips measures that have no notes.  The result is that
607 multi-rests are condensed.  The value assigned is a Scheme object.  In
608 this case, it is @code{#t}, the boolean True value.
609
610 If the @var{context} argument is left out, then the current bottom-most
611 context (typically @context{ChordNames}, @context{Voice}, or
612 @context{Lyrics}) is used.  In this example,
613
614 @lilypond[quote,verbatim,relative=2,fragment]
615 c8 c c c
616 \set autoBeaming = ##f
617 c8 c c c
618 @end lilypond
619
620 @noindent
621 the @var{context} argument to @code{\set} is left out, so automatic
622 beaming is switched off in the current @internalsref{Voice}.  Note that
623 the bottom-most context does not always contain the property that you
624 wish to change -- for example, attempting to set the @code{skipBars}
625 property (of the bottom-most context, in this case @code{Voice}) will
626 have no effect.
627
628 @lilypond[quote,verbatim,relative=2,fragment]
629 R1*2 
630 \set skipBars = ##t
631 R1*2
632 @end lilypond
633
634 Contexts are hierarchical, so if a bigger context was specified, for
635 example @context{Staff}, then the change would also apply to all
636 @context{Voice}s in the current stave.  The change is applied
637 `on-the-fly', during the music, so that the setting only affects the
638 second group of eighth notes.
639
640 @cindex @code{\unset} 
641
642 There is also an @code{\unset} command,
643 @example
644 \unset @var{context}.@var{prop}
645 @end example
646
647 @noindent
648 which removes the definition of @var{prop}.  This command removes
649 the definition only if it is set in @var{context}, so
650
651 @example
652 \set Staff.autoBeaming = ##f
653 @end example
654
655 @noindent
656 introduces a property setting at @code{Staff} level.  The setting also
657 applies to the current @code{Voice}.  However,
658
659 @example
660 \unset Voice.autoBeaming
661 @end example
662
663 @noindent
664 does not have any effect.  To cancel this setting, the @code{\unset}
665 must be specified on the same level as the original @code{\set}.  In
666 other words, undoing the effect of @code{Staff.autoBeaming = ##f}
667 requires
668 @example
669 \unset Staff.autoBeaming
670 @end example
671
672 Like @code{\set}, the @var{context} argument does not have to be
673 specified for a bottom context, so the two statements
674
675 @example
676 \set Voice.autoBeaming = ##t 
677 \set autoBeaming = ##t 
678 @end example 
679
680 @noindent
681 are equivalent.
682
683
684 @cindex \once
685 Settings that should only apply to a single time-step can be entered
686 with @code{\once}, for example in
687
688 @lilypond[quote,verbatim,relative=2,fragment]
689 c4
690 \once \set fontSize = #4.7
691 c4
692 c4
693 @end lilypond
694
695 the property @code{fontSize} is unset automatically after the second
696 note.
697
698 A full description of all available context properties is in the
699 program reference, see
700 @ifhtml
701 @internalsref{Tunable context properties}.
702 @end ifhtml
703 @ifnothtml
704 Translation @arrow{} Tunable context properties.
705 @end ifnothtml
706
707
708 @node Modifying context plug-ins
709 @subsection Modifying context plug-ins
710
711 Notation contexts (like Score and Staff) not only store properties,
712 they also contain plug-ins, called ``engravers'' that create notation
713 elements.  For example, the Voice context contains a
714 @code{Note_head_engraver} and the Staff context contains a
715 @code{Key_signature_engraver}.
716
717 For a full a description of each plug-in, see 
718 @ifhtml
719 @internalsref{Engravers}.
720 @end ifhtml
721 @ifnothtml
722 Program reference @arrow Translation @arrow{} Engravers.
723 @end ifnothtml
724 Every context described in
725 @ifhtml
726 @internalsref{Contexts}
727 @end ifhtml
728 @ifnothtml 
729 Program reference @arrow Translation @arrow{} Context.
730 @end ifnothtml
731 lists the engravers used for that context.
732
733
734 It can be useful to shuffle around these plug-ins.  This is done by
735 starting a new context, with @code{\new} or @code{\context}, and
736 modifying it like this, 
737
738 @cindex @code{\with}
739
740 @example
741 \new @var{context} \with @{
742   \consists @dots{}
743   \consists @dots{}
744   \remove @dots{}
745   \remove @dots{}
746   @emph{etc.}
747 @}
748 @emph{..music..}
749 @end example
750
751 @noindent
752 where the @dots{} should be the name of an engraver.  Here is a simple
753 example which removes @code{Time_signature_engraver} and
754 @code{Clef_engraver} from a @code{Staff} context,
755
756 @lilypond[quote,relative=1,verbatim,fragment]
757 <<
758   \new Staff {
759     f2 g
760   }
761   \new Staff \with {
762      \remove "Time_signature_engraver"
763      \remove "Clef_engraver"
764   } {
765     f2 g2
766   }
767 >>
768 @end lilypond
769
770 In the second staff there are no time signature or clef symbols.  This
771 is a rather crude method of making objects disappear since it will affect
772 the entire staff.  This method also influences the spacing, which may or
773 may not be desirable.  A more
774 sophisticated method of blanking objects is shown in @ref{Common tweaks}.
775
776 The next example shows a practical application.  Bar lines and time
777 signatures are normally synchronized across the score.  This is done
778 by the @code{Timing_translator} and @code{Default_bar_line_engraver}.
779 This plug-in keeps an administration of time signature, location
780 within the measure, etc.  By moving thes engraver from @code{Score} to
781 @code{Staff} context, we can have a score where each staff has its own
782 time signature.
783
784 @cindex polymetric scores
785 @cindex Time signatures, multiple
786
787 @lilypond[quote,relative=1,ragged-right,verbatim,fragment]
788 \new Score \with {
789   \remove "Timing_translator"
790   \remove "Default_bar_line_engraver"
791 } <<
792   \new Staff \with {
793     \consists "Timing_translator"
794     \consists "Default_bar_line_engraver"
795   } {
796       \time 3/4
797       c4 c c c c c
798   }
799   \new Staff \with {
800     \consists "Timing_translator"
801     \consists "Default_bar_line_engraver"
802   } {
803        \time 2/4
804        c4 c c c c c
805   }
806 >>
807 @end lilypond
808
809
810 @node Layout tunings within contexts
811 @subsection Layout tunings within contexts
812
813 Each context is responsible for creating certain types of graphical
814 objects.  The settings used for printing these objects are also stored by
815 context.  By changing these settings, the appearance of objects can be
816 altered.
817  
818 The syntax for this is
819
820 @example
821 \override @var{context}.@var{name} #'@var{property} = #@var{value}
822 @end example
823
824 Here @var{name} is the name of a graphical object, like @code{Stem} or
825 @code{NoteHead}, and @var{property} is an internal variable of the
826 formatting system (`grob property' or `layout property').  The latter is a
827 symbol, so it must be quoted.  The subsection @ref{Constructing a
828 tweak} explains what to fill in for @var{name}, @var{property}, and
829 @var{value}.  Here we only discuss the functionality of this command.
830
831 The command
832
833 @verbatim
834 \override Staff.Stem #'thickness = #4.0 
835 @end verbatim
836
837 @noindent
838 makes stems thicker (the default is 1.3, with staff line thickness as a
839 unit).  Since the command specifies @context{Staff} as context, it only
840 applies to the current staff.  Other staves will keep their normal
841 appearance.  Here we see the command in action:
842
843 @lilypond[quote,verbatim,relative=2,fragment]
844 c4
845 \override Staff.Stem #'thickness = #4.0 
846 c4
847 c4
848 c4
849 @end lilypond
850
851 The @code{\override} command changes the definition of the @code{Stem}
852 within the current @context{Staff}.  After the command is interpreted
853 all stems are thickened.
854
855 Analogous to @code{\set}, the @var{context} argument may be left out,
856 causing it to default to @context{Voice}, and adding @code{\once} applies
857 the change during one timestep only 
858
859 @lilypond[quote,fragment,verbatim,relative=2]
860 c4
861 \once \override Stem #'thickness = #4.0 
862 c4
863 c4 
864 @end lilypond
865
866 The @code{\override} must be done before the object is
867 started.  Therefore, when altering @emph{Spanner} objects, like slurs or
868 beams, the @code{\override} command must be executed at the moment when
869 the object is created.  In this example,
870
871
872 @lilypond[quote,fragment,verbatim,relative=2]
873 \override Slur #'thickness = #3.0
874 c8[( c
875 \override Beam #'thickness = #0.6
876 c8 c]) 
877 @end lilypond
878
879 @noindent
880 the slur is fatter but the beam is not.  This is because the command for
881 @code{Beam} comes after the Beam is started.  Therefore it has no effect.
882
883 Analogous to @code{\unset}, the @code{\revert} command for a context
884 undoes an @code{\override} command; like with @code{\unset}, it only
885 affects settings that were made in the same context.  In other words, the
886 @code{\revert} in the next example does not do anything.
887
888 @example
889 \override Voice.Stem #'thickness = #4.0
890 \revert Staff.Stem #'thickness
891 @end example
892
893 Some tweakable options are called ``subproperties'' and reside inside
894 properties.  To tweak those, use
895
896 @example
897 \override Stem #'details #'beamed-lengths = #'(4 4 3) 
898 @end example
899
900
901 @seealso
902
903 Internals: @internalsref{OverrideProperty}, @internalsref{RevertProperty},
904 @internalsref{PropertySet}, @internalsref{Backend}, and
905 @internalsref{All layout objects}.
906
907
908 @refbugs
909
910 The back-end is not very strict in type-checking object properties.
911 Cyclic references in Scheme values for properties can cause hangs
912 or crashes, or both.
913
914
915 @node Changing context default settings
916 @subsection Changing context default settings
917
918 The adjustments of the previous subsections (@ref{Changing context
919 properties on the fly}, @ref{Modifying context plug-ins}, and
920 @ref{Layout tunings within contexts}) can also be entered separately
921 from the music, in the @code{\layout} block,
922
923 @example
924 \layout @{
925   @dots{}
926   \context @{
927     \Staff
928
929     \set fontSize = #-2
930     \override Stem #'thickness = #4.0
931     \remove "Time_signature_engraver"
932   @}
933 @}
934 @end example
935
936 Here
937 @example
938 \Staff
939 @end example
940
941 @noindent
942 takes the existing definition for context @context{Staff} from the
943 identifier @code{\Staff}. 
944
945 The statements
946 @example
947 \set fontSize = #-2
948 \override Stem #'thickness = #4.0
949 \remove "Time_signature_engraver"
950 @end example
951
952 @noindent
953 affect all staves in the score.
954
955 Other contexts can be modified analogously.
956
957 The @code{\set} keyword is optional within the @code{\layout} block, so
958
959 @example
960 \context @{
961   @dots{}
962   fontSize = #-2
963 @}
964 @end example
965
966 @noindent
967 will also work.
968
969
970
971 @refbugs
972
973 It is not possible to collect context changes in a variable, and apply
974 them to one @code{\context} definition by referring to that variable.
975
976 The @code{\RemoveEmptyStaffContext} will override your current
977 @code{\Staff} variable.  If you wish to change the defaults for a
978 staff that uses @code{\RemoveEmptyStaffContext}, you must do so
979 after calling @code{\RemoveemptyStaffContext}, ie
980
981 @example
982 \layout @{
983   \context @{
984     \RemoveEmptyStaffContext
985
986     \override Stem #'thickness = #4.0
987   @}
988 @}
989 @end example
990
991
992 @node Defining new contexts
993 @subsection Defining new contexts
994
995 Specific contexts, like @context{Staff} and @code{Voice}, are made of
996 simple building blocks, and it is possible to compose engraver
997 plug-ins in different combinations, thereby creating new types of
998 contexts.
999
1000 The next example shows how to build a different type of
1001 @context{Voice} context from scratch.  It will be similar to
1002 @code{Voice}, but prints centered slash noteheads only.  It can be used
1003 to indicate improvisation in Jazz pieces,
1004
1005 @lilypond[quote,ragged-right]
1006 \layout { \context {
1007   \name ImproVoice
1008   \type "Engraver_group"
1009   \consists "Note_heads_engraver"
1010   \consists "Text_engraver"
1011   \consists Pitch_squash_engraver
1012   squashedPosition = #0
1013   \override NoteHead #'style = #'slash
1014   \override Stem #'transparent = ##t
1015   \alias Voice
1016 }
1017 \context { \Staff
1018   \accepts "ImproVoice"
1019 }}
1020
1021 \relative c'' {
1022   a4 d8 bes8 \new ImproVoice { c4^"ad lib" c 
1023    c4 c^"undress" c_"while playing :)" c } 
1024   a1 
1025 }
1026 @end lilypond
1027
1028
1029 These settings are again done within a @code{\context} block inside a
1030 @code{\layout} block,
1031
1032 @example
1033 \layout @{
1034   \context @{
1035     @dots{}
1036   @}
1037 @}
1038 @end example
1039
1040 In the following discussion, the example input shown should go on the
1041 @dots{} in the previous fragment.
1042
1043 First, the context gets a name.  Instead of @context{Voice} it
1044 will be called @context{ImproVoice},
1045
1046 @example
1047 \name ImproVoice
1048 @end example
1049
1050 Since it is similar to the @context{Voice}, we want commands that work
1051 on (existing) @context{Voice}s to remain working.  This is achieved by
1052 giving the new context an alias @context{Voice},
1053
1054 @example
1055 \alias Voice
1056 @end example
1057
1058 The context will print notes, and instructive texts
1059
1060 @example
1061 \consists Note_heads_engraver
1062 \consists Text_engraver
1063 @end example
1064
1065 but only on the center line,
1066
1067 @example
1068 \consists Pitch_squash_engraver
1069 squashedPosition = #0
1070 @end example
1071
1072 The @internalsref{Pitch_squash_engraver} modifies note heads (created
1073 by @internalsref{Note_heads_engraver}) and sets their vertical
1074 position to the value of @code{squashedPosition}, in this case@tie{}@code{0},
1075 the center line.
1076
1077 The notes look like a slash, without a stem,
1078
1079 @example
1080 \override NoteHead #'style = #'slash
1081 \override Stem #'transparent = ##t
1082 @end example
1083
1084
1085 All these plug-ins have to cooperate, and this is achieved with a
1086 special plug-in, which must be marked with the keyword @code{\type}.
1087 This should always be @internalsref{Engraver_group},
1088
1089 @example
1090 \type "Engraver_group"
1091 @end example
1092
1093 Put together, we get
1094
1095 @example
1096 \context @{
1097   \name ImproVoice
1098   \type "Engraver_group"
1099   \consists "Note_heads_engraver"
1100   \consists "Text_engraver"
1101   \consists Pitch_squash_engraver
1102   squashedPosition = #0
1103   \override NoteHead #'style = #'slash
1104   \override Stem #'transparent = ##t
1105   \alias Voice
1106 @}
1107 @end example
1108
1109 Contexts form hierarchies.  We want to hang the @context{ImproVoice}
1110 under @context{Staff}, just like normal @code{Voice}s.  Therefore, we
1111 modify the @code{Staff} definition with the @code{\accepts}
1112 command,@footnote{The opposite of @code{\accepts} is @code{\denies},
1113 which is sometimes needed when reusing existing context definitions.}
1114
1115
1116
1117 @example
1118 \context @{
1119   \Staff
1120   \accepts ImproVoice    
1121 @}
1122 @end example
1123
1124 Putting both into a @code{\layout} block, like
1125
1126 @example
1127 \layout @{
1128   \context @{
1129     \name ImproVoice
1130     @dots{}
1131   @}
1132   \context @{
1133     \Staff
1134     \accepts "ImproVoice"
1135   @}
1136 @}
1137 @end example
1138
1139 Then the output at the start of this subsection can be entered as
1140
1141 @example
1142 \relative c'' @{
1143   a4 d8 bes8
1144   \new ImproVoice @{
1145     c4^"ad lib" c 
1146     c4 c^"undress"
1147     c c_"while playing :)"
1148   @}
1149   a1
1150 @}
1151 @end example
1152   
1153
1154     
1155
1156 @node The \override command
1157 @section The \override command
1158
1159 In the previous section, we have already touched on a command that
1160 changes layout details: the @code{\override} command.  In this section,
1161 we will look in more detail at how to use the command in practice.
1162 First, we will give a few versatile commands that are sufficient
1163 for many situations.  The next section will discuss the general use of
1164 @code{\override}.
1165
1166
1167 @menu
1168 * Constructing a tweak::        
1169 * Navigating the program reference::  
1170 * Layout interfaces::           
1171 * Determining the grob property::  
1172 * Objects connected to the input::  
1173 * Difficult tweaks::            
1174 @end menu
1175
1176
1177
1178 @node Constructing a tweak
1179 @subsection Constructing a tweak
1180
1181 The general procedure of changing output, that is, entering
1182 a command like
1183
1184 @example
1185 \override Voice.Stem #'thickness = #3.0
1186 @end example
1187
1188 @noindent
1189 means that we have to determine these bits of information:
1190
1191 @itemize
1192 @item the context: here @context{Voice}.
1193 @item the layout object: here @code{Stem}.
1194 @item the layout property: here @code{thickness}
1195 @item a sensible value: here @code{3.0}
1196 @end itemize  
1197
1198 Some tweakable options are called ``subproperties'' and reside inside
1199 properties.  To tweak those, use
1200
1201 @example
1202 \override Stem #'details #'beamed-lengths = #'(4 4 3)
1203 @end example
1204
1205 @cindex internal documentation
1206 @cindex finding graphical objects
1207 @cindex graphical object descriptions 
1208 @cindex tweaking
1209 @cindex @code{\override}
1210 @cindex internal documentation
1211
1212 We demonstrate how to glean this information from the notation manual
1213 and the program reference.
1214
1215 @node Navigating the program reference
1216 @subsection Navigating the program reference
1217
1218 Suppose we want to move the fingering indication in the fragment
1219 below:
1220
1221 @lilypond[quote,fragment,relative=2,verbatim]
1222 c-2
1223 \stemUp
1224 f
1225 @end lilypond
1226
1227 If you visit the documentation on fingering instructions (in
1228 @ref{Fingering instructions}), you will notice that there is written:
1229
1230 @quotation
1231 @seealso
1232
1233 Program reference: @internalsref{FingerEvent} and @internalsref{Fingering}.
1234
1235 @end quotation
1236
1237
1238
1239 This fragment points to two parts of the program reference: a page
1240 on @code{FingerEvent} and one on @code{Fingering}.
1241
1242 The page on @code{FingerEvent} describes the properties of the music
1243 expression for the input @code{-2}.  The page contains many links
1244 forward.  For example, it says
1245
1246 @quotation
1247 Accepted by: @internalsref{Fingering_engraver},
1248 @end quotation 
1249
1250 @noindent
1251 That link brings us to the documentation for the Engraver, the
1252 plug-in, which says
1253
1254 @quotation
1255 This engraver creates the following layout objects: @internalsref{Fingering}.
1256 @end quotation
1257
1258 In other words, once the @code{FingerEvent}s are interpreted, the
1259 @code{Fingering_engraver} plug-in will process them.
1260
1261 @ignore
1262 @c  I can't figure out what this is supposed to mean.  -gp
1263
1264 The @code{Fingering_engraver} is also listed to create
1265 @internalsref{Fingering} objects,
1266
1267 @c  old info?  it doesn't make any sense to me with our current docs.
1268 This is also the
1269 second bit of information listed under @b{See also} in the Notation
1270 manual.
1271 @end ignore
1272
1273 By clicking around in the program reference, we can follow the
1274 flow of information within the program, either forward (like we did
1275 here), or backwards, following links like this:
1276
1277 @itemize @bullet
1278
1279 @item @internalsref{Fingering}:
1280 @internalsref{Fingering} objects are created by:
1281 @b{@internalsref{Fingering_engraver}}
1282
1283 @item @internalsref{Fingering_engraver}:
1284 Music types accepted: @b{@internalsref{fingering-event}}
1285
1286 @item @internalsref{fingering-event}:
1287 Music event type @code{fingering-event} is in Music expressions named
1288 @b{@internalsref{FingerEvent}}
1289 @end itemize
1290
1291 This path goes against the flow of information in the program: it
1292 starts from the output, and ends at the input event.
1293
1294 The program reference can also be browsed like a normal document.  It
1295 contains a chapter on
1296 @ifhtml
1297 @internalsref{Music definitions},
1298 @end ifhtml
1299 @ifnothtml
1300 @code{Music definitions}
1301 @end ifnothtml
1302 on @internalsref{Translation}, and the @internalsref{Backend}.  Every
1303 chapter lists all the definitions used, and all properties that may be
1304 tuned.
1305
1306  
1307 @node Layout interfaces
1308 @subsection Layout interfaces
1309
1310 @cindex interface, layout
1311 @cindex layout interface
1312 @cindex grob
1313
1314 The HTML page that we found in the previous section, describes the
1315 layout object called @internalsref{Fingering}.  Such an object is a
1316 symbol within the score.  It has properties that store numbers (like
1317 thicknesses and directions), but also pointers to related objects.  A
1318 layout object is also called a @emph{Grob}, which is short for Graphical
1319 Object.  For more details about Grobs, see @internalsref{grob-interface}.
1320
1321 The page for @code{Fingering} lists the definitions for the
1322 @code{Fingering} object.  For example, the page says
1323
1324 @quotation
1325 @code{padding} (dimension, in staff space):
1326   
1327 @code{0.6}
1328 @end quotation
1329
1330 @noindent
1331 which means that the number will be kept at a distance of at least 0.6
1332 of the note head.
1333
1334
1335 Each layout object may have several functions as a notational or
1336 typographical element.  For example, the Fingering object
1337 has the following aspects
1338
1339 @itemize @bullet
1340 @item
1341 Its size is independent of the horizontal spacing, unlike slurs or beams.
1342
1343 @item
1344 It is a piece of text.  Granted, it is usually a very short text.
1345
1346 @item
1347 That piece of text is typeset with a font, unlike slurs or beams.
1348
1349 @item
1350 Horizontally, the center of the symbol should be aligned to the
1351 center of the notehead.
1352
1353 @item
1354 Vertically, the symbol is placed next to the note and the staff.
1355
1356 @item
1357 The vertical position is also coordinated with other super- and subscript
1358 symbols.
1359 @end itemize
1360
1361 Each of these aspects is captured in so-called @emph{interface}s,
1362 which are listed on the @internalsref{Fingering} page at the bottom
1363
1364 @quotation
1365 This object supports the following interfaces:
1366 @internalsref{item-interface},
1367 @internalsref{self-alignment-interface},
1368 @internalsref{side-position-interface}, @internalsref{text-interface},
1369 @internalsref{text-script-interface}, @internalsref{font-interface},
1370 @internalsref{finger-interface}, and @internalsref{grob-interface}.
1371 @end quotation
1372
1373 Clicking any of the links will take you to the page of the respective
1374 object interface.  Each interface has a number of properties.  Some of
1375 them are not user-serviceable (``Internal properties''), but others
1376 are.
1377
1378 We have been talking of @emph{the} @code{Fingering} object, but actually it
1379 does not amount to much.  The initialization file
1380 @file{scm/@/define@/-grobs@/.scm} shows the soul of the `object',
1381
1382 @example
1383 (Fingering
1384   . ((padding . 0.5)
1385      (avoid-slur . around)
1386      (slur-padding . 0.2)
1387      (staff-padding . 0.5)
1388      (self-alignment-X . 0)
1389      (self-alignment-Y . 0)
1390      (script-priority . 100)
1391      (stencil . ,ly:text-interface::print)
1392      (direction . ,ly:script-interface::calc-direction)
1393      (font-encoding . fetaNumber)
1394      (font-size . -5)           ; don't overlap when next to heads.
1395      (meta . ((class . Item)
1396      (interfaces . (finger-interface
1397                     font-interface
1398                     text-script-interface
1399                     text-interface
1400                     side-position-interface
1401                     self-alignment-interface
1402                     item-interface))))))
1403 @end example
1404
1405 @noindent
1406 As you can see, the @code{Fingering} object is nothing more than a
1407 bunch of variable settings, and the webpage in the Program Reference
1408 is directly generated from this definition.
1409
1410 @node Determining the grob property
1411 @subsection Determining the grob property
1412
1413
1414 Recall that we wanted to change the position of the @b{2} in 
1415
1416 @lilypond[quote,fragment,relative=2,verbatim]
1417 c-2
1418 \stemUp
1419 f
1420 @end lilypond
1421
1422 Since the @b{2} is vertically positioned next to its note, we have to
1423 meddle with the interface associated with this positioning.  This is
1424 done using @code{side-position-interface}.  The page for this interface 
1425 says
1426
1427 @quotation
1428 @code{side-position-interface}
1429
1430 Position a victim object (this one) next to other objects (the
1431 support).  The property @code{direction} signifies where to put the
1432 victim object relative to the support (left or right, up or down?)
1433 @end quotation
1434
1435 @cindex padding
1436 @noindent
1437 below this description, the variable @code{padding} is described as
1438
1439 @quotation
1440 @table @code
1441 @item padding
1442 (dimension, in staff space)
1443
1444 Add this much extra space between objects that are next to each other. 
1445 @end table
1446 @end quotation
1447
1448 By increasing the value of @code{padding}, we can move away the
1449 fingering.  The following command inserts 3 staff spaces of white
1450 between the note and the fingering:
1451 @example
1452 \once \override Voice.Fingering #'padding = #3
1453 @end example
1454
1455 Inserting this command before the Fingering object is created,
1456 i.e., before @code{c2}, yields the following result:
1457
1458 @lilypond[quote,relative=2,fragment,verbatim]
1459 \once \override Voice.Fingering #'padding = #3
1460 c-2
1461 \stemUp
1462 f
1463 @end lilypond
1464
1465
1466 In this case, the context for this tweak is @context{Voice}.  This
1467 fact can also be deduced from the program reference, for the page for
1468 the @internalsref{Fingering_engraver} plug-in says
1469
1470 @quotation
1471 Fingering_engraver is part of contexts: @dots{} @b{@internalsref{Voice}}
1472 @end quotation
1473
1474 @node Objects connected to the input
1475 @subsection Objects connected to the input
1476
1477 In some cases, it is possible to take a short-cut for tuning graphical
1478 objects. For objects that result directly from a piece of the input,
1479 you can use the @code{\tweak} function, for example
1480
1481 @lilypond[relative=2,fragment,verbatim,ragged-right]
1482 <
1483   c
1484   \tweak #'color #red d
1485   g
1486   \tweak #'duration-log #1  a
1487 >4-\tweak #'padding #10 -. 
1488 @end lilypond
1489
1490 As you can see, properties are set directly in the objects directly,
1491 without mentioning the grob name or context where this should be
1492 applied.
1493
1494 This technique only works for objects that are directly connected to
1495 an @internalsref{event} from the input, for example
1496
1497 @itemize @bullet
1498 @item note heads, caused by chord-pitch.
1499 @item articulation signs, caused by articulation instructions
1500 @end itemize
1501
1502 It notably does not work for stems and accidentals (these are caused
1503 by note heads, not by music events) or clefs (these are not caused by
1504 music inputs, but rather by the change of a property value).
1505  
1506
1507 @node Difficult tweaks
1508 @subsection Difficult tweaks
1509
1510 There are a few classes of difficult adjustments.  
1511
1512 @itemize @bullet
1513
1514
1515 @item
1516 One type of difficult adjustment is the appearance of spanner objects,
1517 such as slur and tie.  Initially, only one of these objects is created,
1518 and they can be adjusted with the normal mechanism.  However, in some
1519 cases the spanners cross line breaks.  If this happens, these objects
1520 are cloned.  A separate object is created for every system that it is
1521 in.  These are clones of the original object and inherit all
1522 properties, including @code{\override}s.
1523
1524
1525 In other words, an @code{\override} always affects all pieces of a
1526 broken spanner.  To change only one part of a spanner at a line break,
1527 it is necessary to hook into the formatting process.  The
1528 @code{after-line-breaking} callback contains the Scheme procedure that
1529 is called after the line breaks have been determined, and layout
1530 objects have been split over different systems.
1531
1532 In the following example, we define a procedure
1533 @code{my-callback}.  This procedure
1534  
1535 @itemize @bullet
1536 @item
1537 determines if we have been split across line breaks
1538 @item
1539 if yes, retrieves all the split objects
1540 @item
1541 checks if we are the last of the split objects
1542 @item
1543 if yes, it sets @code{extra-offset}.
1544 @end itemize
1545
1546 This procedure is installed into @internalsref{Tie}, so the last part
1547 of the broken tie is translated up.
1548
1549 @lilypond[quote,verbatim,ragged-right]
1550 #(define (my-callback grob)
1551   (let* (
1552          ; have we been split? 
1553          (orig (ly:grob-original grob))
1554
1555          ; if yes, get the split pieces (our siblings)
1556          (siblings (if (ly:grob? orig)
1557                      (ly:spanner-broken-into orig) '() )))
1558
1559    (if (and (>= (length siblings) 2)
1560              (eq? (car (last-pair siblings)) grob))
1561      (ly:grob-set-property! grob 'extra-offset '(-2 . 5)))))
1562
1563 \relative c'' { 
1564   \override Tie #'after-line-breaking =
1565   #my-callback
1566   c1 ~ \break c2 ~ c
1567 }
1568 @end lilypond
1569
1570 @noindent
1571 When applying this trick, the new @code{after-line-breaking} callback
1572 should also call the old one @code{after-line-breaking}, if there is
1573 one.  For example, if using this with @code{Hairpin},
1574 @code{ly:hairpin::after-line-breaking} should also be called.
1575
1576
1577 @item Some objects cannot be changed with @code{\override} for
1578 technical reasons. Examples of those are @code{NonMusicalPaperColumn}
1579 and @code{PaperColumn}.  They can be changed with the
1580 @code{\outputProperty} function, which works similar to @code{\once
1581 \override}, but uses a different syntax,
1582
1583 @example 
1584 \outputProperty
1585 #"Score.NonMusicalPaperColumn"  % Grob name
1586 #'line-break-system-details     % Property name  
1587 #'((next-padding . 20))         % Value
1588 @end example
1589
1590 @end itemize