6 * different staff sizes
9 * move some stuff to refman
10 * merge some stuff with refman entries
12 * add @ref{}s to lilypond-internals:
14 @reng{Name} to engraver
16 there's a very simple, very general noXXX mechanism; try
18 noop \property Staff.VoltaBrace = #'()
19 yes: \property Staff.VoltaBracket = #'((meta . ((interfaces . ()))))
31 * Manual beam settings:: Manual beam settings
32 * Slur attachments:: Slur attachments
33 * Text spanner:: Text spanner
34 * Engraver hacking:: Engraver hacking
35 * Part combiner:: Part combiner
36 * Markup text:: Markup text
37 * Apply hacking:: Apply hacking
38 * Output property:: Output property
39 * Embedded TeX:: Embedded TeX
40 * Embedded PostScript:: Embedded PostScript
41 @c * Index:: Checking Feature index
45 @node Manual beam settings
46 @section Manual beam settings
60 In some cases it may be necessary to override LilyPond's automatic
61 beaming algorithm. For example, the auto beamer will not beam over
62 rests, so if you want that, specify the begin and end point manually
63 using @code{[} and @code{]}:
66 @lilypond[fragment,relative,verbatim]
73 Similarly, for beams over bar lines:
76 @lilypond[fragment,relative,verbatim]
82 @cindex @code{stemLeftBeamCount}
84 If you have specific wishes for the number of beams, you can fully
85 control the number of beams through the properties
86 @code{Voice.stemLeftBeamCount};
89 @lilypond[fragment,relative,verbatim]
92 [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
96 @cindex @code{stemRightBeamCount}
98 and @code{Voice.stemRightBeamCount}:
101 @lilypond[fragment,relative,verbatim]
104 \property Voice.autoBeamSettings
105 \set #'(end * * * *) = #(make-moment 1 4)
109 \property Voice.stemRightBeamCount = #1 b
110 \property Voice.stemLeftBeamCount = #1 b
114 @cindex @code{no-stem-extend}
116 Conventionally, stems and beams extend to the middle staff line. This
117 extension can be controlled through @code{Voice.Stem}'s grob-property
118 @code{no-stem-extend}:
121 @lilypond[fragment,relative,verbatim]
123 \property Voice.Stem \set #'no-stem-extend = ##t
128 The beam symbol can be tweaked through @code{Voice.Beam}'s
129 grob-properties @code{height-hs} and @code{y-position-hs}.
131 Set @code{height-hs} to zero, to get horizontal beams:
134 @lilypond[fragment,relative,verbatim]
135 \property Voice.Beam \set #'direction = #1
136 \property Voice.Beam \set #'height-hs = #0
141 Both are in half spaces. Here's how you'd specify a weird looking beam
142 that instead of being horizontal, falls two staff spaces (ie, four half
146 @lilypond[fragment,relative,verbatim]
147 \property Voice.Beam \set #'y-position-hs = #4
148 \property Voice.Beam \set #'height-hs = #-4
152 @cindex @code{default-neutral-direction}
154 The direction of a perfectly centred beams can be
155 controlled through @code{Voice.Beam}'s grob-property
156 @code{default-neutral-direction}
159 @lilypond[fragment,relative,verbatim]
161 \property Voice.Beam \set #'default-neutral-direction = #-1
166 There are several ways to calculate the direction of a beam.
169 number count of up or down notes
171 mean center distance of all notes
173 mean centre distance weighted per note
176 You can spot the differences of these settings from these simple
180 @lilypond[fragment,relative,verbatim]
182 \property Voice.Beam \set #'dir-function = #beam-dir-mean
184 \property Voice.Beam \set #'dir-function = #beam-dir-median
190 @lilypond[fragment,relative,verbatim]
193 \property Voice.Beam \set #'dir-function = #beam-dir-mean
195 \property Voice.Beam \set #'dir-function = #beam-dir-median
200 These beam direction functions are defined in @file{scm/beam.scm}. If
201 your favourite algorithm isn't one of these, you can hook up your own.
205 @node Slur attachments
206 @section Slur attachments
208 The ending of a slur should whenever possible be attached to a note
209 head. Only in some instances where beams are involved, LilyPond may
210 attach a slur to a stem end. In some cases, you may want to override
211 LilyPond's decision, e.g., to attach the slur to the stem end. This can
212 be done through @code{Voice.Slur}'s grob-property @code{attachment}:
213 @c FIXME: make @ref{} to backend doco
216 @lilypond[fragment,relative,verbatim]
217 \property Voice.Slur \set #'direction = #1
218 \property Voice.Stem \set #'length = #5.5
220 \property Voice.Slur \set #'attachment = #'(stem . stem)
225 Similarly, slurs can be attached to note heads even when beams are
229 @lilypond[fragment,relative,verbatim]
230 \property Voice.Slur \set #'direction = #1
231 \property Voice.Slur \set #'attachment = #'(head . head)
232 g''16()g()g()g()d'()d()d()d
236 If a slur would strike through a stem or beam, LilyPond will move the
237 slur away vertically (upward or downward). In some cases, this may
238 cause ugly slurs that you may want to correct:
241 @lilypond[fragment,relative,verbatim]
242 \property Voice.Stem \set #'direction = #1
243 \property Voice.Slur \set #'direction = #1
245 \property Voice.Slur \set #'attachment = #'(stem . stem)
250 LilyPond will increase the curvature of a slur trying to stay free of
251 note heads and stems. However, if the curvature would increase too much,
252 the slur will be reverted to its default shape. This decision is based
253 on @code{Voice.Slur}'s grob-property @code{beautiful} value. In some
254 cases, you may find ugly slurs beautiful, and tell LilyPond so by
255 increasing the @code{beautiful} value:
257 [hoe gedefd?? wat betekent beautiful = X?]
262 \notes \context PianoStaff <
264 \context Staff=up { s1 * 6/4 }
265 \context Staff=down <
267 \autochange Staff \context Voice
269 d,8( a' d f a d f d a f d )a
277 Slur \override #'beautiful = #5.0
278 Slur \override #'direction = #1
279 Stem \override #'direction = #-1
280 autoBeamSettings \override #'(end * * * *)
285 VerticalAlignment \override #'threshold = #'(5 . 5)
294 @section Text spanner
298 Have crescendo set a text spanner instead of hairpin
300 @lilypond[fragment,relative,verbatim]
302 \property Voice.crescendoText = "cresc."
303 \property Voice.crescendoSpanner = #'dashed-line
310 @lilypond[fragment,relative,verbatim]
312 \property Voice.TextSpanner \set #'type = #'dotted-line
313 \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
314 \property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
315 \property Staff.centralCPosition = #-13
316 a\spanrequest \start "text" b c a \spanrequest \stop "text"
321 @node Engraver hacking
322 @section Engraver hacking
324 No time signature, no barlines...
327 \notes \relative c'' {
336 \remove "Time_signature_engraver";
342 No staff, no clef, squash pitches
345 \notes { c4 c4 c8 c8 }
350 \remove Staff_symbol_engraver;
351 \consists Pitch_squash_engraver;
352 \remove Clef_engraver;
360 @section Part combiner
364 \context Staff = flauti <
366 \context Voice=one \partcombine Voice
367 \context Thread=one \notes\relative c'' {
368 c4 d e f | b,4 d c d | r2 e4 f | c4 d e f |
369 c4 r e f | c4 r e f | c4 r a r | a a r a |
370 a2 \property Voice.soloADue = ##f a |
372 \context Thread=two \notes\relative c'' {
373 g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d
374 c r e r | r2 s2 | a,4 r a r | a r r a |
375 a2 \property Voice.soloADue = ##f a |
379 linewidth = 80 * \staffspace;
382 \consists Rest_engraver;
386 \remove Rest_engraver;
402 #(define text-flat '((font-relative-size . -2 ) (music "accidentals--1")))
404 \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
405 "2 Clarinetti" (rows " (B" ,text-flat ")")))
408 \property StaffCombineStaff.instrument = #'((kern . 0.5)
409 (lines "Violoncello" (rows " e") (rows "Contrabasso")))
418 [todo: hack this into C++, use \tempo]
421 #(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
422 #(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
423 #(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
426 \notes\relative c'' {
427 a1^#`(rows ,dotted-eight-note " = 64")
433 TextScript \override #'font-shape = #'upright
440 @node Output property
441 @section Output property
443 @lilypond[fragment,relative,verbatim]
444 \outputproperty #(make-type-checker 'note-head-interface)
445 #'extra-offset = #'(2 . 3)
449 Don't move the finger 2, only text "m.d." ...
451 #(define (make-text-checker text)
452 (lambda (grob) (equal? text (ly-get-elt-property grob 'text))))
455 \notes\relative c''' {
456 \property Voice.Stem \set #'direction = #1
457 \outputproperty #(make-text-checker "m.d.")
458 #'extra-offset = #'(-3.5 . -4.5)
461 \paper { linewidth = -1.; }
470 @section Apply hacking
473 music = \notes { c'4 d'4( e'4 f'4 }
475 #(define (reverse-music music)
476 (let* ((elements (ly-get-mus-property music 'elements))
477 (reversed (reverse elements))
478 (span-dir (ly-get-mus-property music 'span-direction)))
480 (ly-set-mus-property music 'elements reversed)
483 (ly-set-mus-property music 'span-direction (- span-dir)))
485 (map reverse-music reversed)
492 \apply #reverse-music \music
494 \paper { linewidth = -1.; }
499 @section Embedded TeX
500 @lilypond[fragment,relative,verbatim]
501 a''^"3 $\\times$ \\`a deux"
504 @node Embedded PostScript
505 @section Embedded PostScript
507 Arbitrary lines and curves not supported...
509 [TODO:] Make a direct postscript command?
513 \notes \relative c'' {
514 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
515 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
516 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
520 \paper { linewidth = 70 * \staffspace; }
526 @section Checking Feature index