4 @c A menu is needed before every deeper *section nesting of @nodes
5 @c Run M-x texinfo-all-menus-update
6 @c to automagically fill in these menus
7 @c before saving changes
13 * different staff sizes
16 * move some stuff to refman
17 * merge some stuff with refman entries
19 * add @ref{}s to lilypond-internals:
21 @reng{Name} to engraver
23 there's a very simple, very general noXXX mechanism; try
25 noop \property Staff.VoltaBrace = #'()
26 yes: \property Staff.VoltaBracket = #'((meta . ((interfaces . ()))))
38 * Manual beam settings:: Manual beam settings
39 * Slur attachments:: Slur attachments
40 * Engraver hacking:: Engraver hacking
41 * Part combiner:: Part combiner
42 * Markup text:: Markup text
43 * Output property:: Output property
44 * Apply hacking:: Apply hacking
45 * Embedded TeX:: Embedded TeX
46 * Embedded PostScript:: Embedded PostScript
47 @c * Index:: Checking Feature index
48 * Index:: Checking Feature index
52 @node Manual beam settings
53 @section Manual beam settings
67 In some cases it may be necessary to override LilyPond's automatic
68 beaming algorithm. For example, the auto beamer will not beam over
69 rests, so if you want that, specify the begin and end point manually
70 using @code{[} and @code{]}:
73 @lilypond[fragment,relative,verbatim]
80 Similarly, for beams over bar lines:
83 @lilypond[fragment,relative,verbatim]
89 @cindex @code{stemLeftBeamCount}
91 If you have specific wishes for the number of beams, you can fully
92 control the number of beams through the properties
93 @code{Voice.stemLeftBeamCount};
96 @lilypond[fragment,relative,verbatim]
99 [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
103 @cindex @code{stemRightBeamCount}
105 and @code{Voice.stemRightBeamCount}:
108 @lilypond[fragment,relative,verbatim]
111 \property Voice.autoBeamSettings
112 \set #'(end * * * *) = #(make-moment 1 4)
116 \property Voice.stemRightBeamCount = #1 b
117 \property Voice.stemLeftBeamCount = #1 b
121 @cindex @code{no-stem-extend}
123 Conventionally, stems and beams extend to the middle staff line. This
124 extension can be controlled through @code{Voice.Stem}'s grob-property
125 @code{no-stem-extend}:
128 @lilypond[fragment,relative,verbatim]
130 \property Voice.Stem \set #'no-stem-extend = ##t
135 The beam symbol can be tweaked through @code{Voice.Beam}'s
136 grob-properties @code{height-hs} and @code{y-position-hs}.
138 Set @code{height-hs} to zero, to get horizontal beams:
141 @lilypond[fragment,relative,verbatim]
142 \property Voice.Beam \set #'direction = #1
143 \property Voice.Beam \set #'height-hs = #0
148 Both are in half spaces. Here's how you'd specify a weird looking beam
149 that instead of being horizontal, falls two staff spaces (ie, four half
153 @lilypond[fragment,relative,verbatim]
154 \property Voice.Beam \set #'y-position-hs = #4
155 \property Voice.Beam \set #'height-hs = #-4
159 @cindex @code{default-neutral-direction}
161 The direction of a perfectly centred beams can be
162 controlled through @code{Voice.Beam}'s grob-property
163 @code{default-neutral-direction}
166 @lilypond[fragment,relative,verbatim]
168 \property Voice.Beam \set #'default-neutral-direction = #-1
173 There are several ways to calculate the direction of a beam.
176 number count of up or down notes
178 mean center distance of all notes
180 mean centre distance weighted per note
183 You can spot the differences of these settings from these simple
187 @lilypond[fragment,relative,verbatim]
189 \property Voice.Beam \set #'dir-function = #beam-dir-mean
191 \property Voice.Beam \set #'dir-function = #beam-dir-median
197 @lilypond[fragment,relative,verbatim]
200 \property Voice.Beam \set #'dir-function = #beam-dir-mean
202 \property Voice.Beam \set #'dir-function = #beam-dir-median
207 These beam direction functions are defined in @file{scm/beam.scm}. If
208 your favourite algorithm isn't one of these, you can hook up your own.
212 @node Slur attachments
213 @section Slur attachments
215 The ending of a slur should whenever possible be attached to a note
216 head. Only in some instances where beams are involved, LilyPond may
217 attach a slur to a stem end. In some cases, you may want to override
218 LilyPond's decision, e.g., to attach the slur to the stem end. This can
219 be done through @code{Voice.Slur}'s grob-property @code{attachment}:
220 @c FIXME: make @ref{} to backend doco
223 @lilypond[fragment,relative,verbatim]
224 \property Voice.Slur \set #'direction = #1
225 \property Voice.Stem \set #'length = #5.5
227 \property Voice.Slur \set #'attachment = #'(stem . stem)
232 Similarly, slurs can be attached to note heads even when beams are
236 @lilypond[fragment,relative,verbatim]
237 \property Voice.Slur \set #'direction = #1
238 \property Voice.Slur \set #'attachment = #'(head . head)
239 g''16()g()g()g()d'()d()d()d
243 If a slur would strike through a stem or beam, LilyPond will move the
244 slur away vertically (upward or downward). In some cases, this may
245 cause ugly slurs that you may want to correct:
248 @lilypond[fragment,relative,verbatim]
249 \property Voice.Stem \set #'direction = #1
250 \property Voice.Slur \set #'direction = #1
252 \property Voice.Slur \set #'attachment = #'(stem . stem)
257 LilyPond will increase the curvature of a slur trying to stay free of
258 note heads and stems. However, if the curvature would increase too much,
259 the slur will be reverted to its default shape. This decision is based
260 on @code{Voice.Slur}'s grob-property @code{beautiful} value. In some
261 cases, you may find ugly slurs beautiful, and tell LilyPond so by
262 increasing the @code{beautiful} value:
264 [hoe gedefd?? wat betekent beautiful = X?]
269 \notes \context PianoStaff <
271 \context Staff=up { s1 * 6/4 }
272 \context Staff=down <
274 \autochange Staff \context Voice
276 d,8( a' d f a d f d a f d )a
284 Slur \override #'beautiful = #5.0
285 Slur \override #'direction = #1
286 Stem \override #'direction = #-1
287 autoBeamSettings \override #'(end * * * *)
292 VerticalAlignment \override #'threshold = #'(5 . 5)
300 @node Engraver hacking
301 @section Engraver hacking
303 No time signature, no barlines...
306 \notes \relative c'' {
315 \remove "Time_signature_engraver";
321 No staff, no clef, squash pitches
324 \notes { c4 c4 c8 c8 }
329 \remove Staff_symbol_engraver;
330 \consists Pitch_squash_engraver;
331 \remove Clef_engraver;
339 @section Part combiner
343 \context Staff = flauti <
345 \context Voice=one \partcombine Voice
346 \context Thread=one \notes\relative c'' {
347 c4 d e f | b,4 d c d | r2 e4 f | c4 d e f |
348 c4 r e f | c4 r e f | c4 r a r | a a r a |
349 a2 \property Voice.soloADue = ##f a |
351 \context Thread=two \notes\relative c'' {
352 g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d
353 c r e r | r2 s2 | a,4 r a r | a r r a |
354 a2 \property Voice.soloADue = ##f a |
358 linewidth = 80 * \staffspace;
361 \consists Rest_engraver;
365 \remove Rest_engraver;
381 #(define text-flat '((font-relative-size . -2 ) (music "accidentals--1")))
383 \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
384 "2 Clarinetti" (rows " (B" ,text-flat ")")))
387 \property StaffCombineStaff.instrument = #'((kern . 0.5)
388 (lines "Violoncello" (rows " e") (rows "Contrabasso")))
397 [todo: hack this into C++, use \tempo]
400 #(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
401 #(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
402 #(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
405 \notes\relative c'' {
406 a1^#`(rows ,dotted-eight-note " = 64")
412 TextScript \override #'font-shape = #'upright
419 @node Output property
420 @section Output property
422 @lilypond[fragment,relative,verbatim]
423 \outputproperty #(make-type-checker 'note-head-interface)
424 #'extra-offset = #'(2 . 3)
428 Don't move the finger 2, only text "m.d." ...
430 #(define (make-text-checker text)
431 (lambda (grob) (equal? text (ly-get-elt-property grob 'text))))
434 \notes\relative c''' {
435 \property Voice.Stem \set #'direction = #1
436 \outputproperty #(make-text-checker "m.d.")
437 #'extra-offset = #'(-3.5 . -4.5)
440 \paper { linewidth = -1.; }
449 @section Apply hacking
452 music = \notes { c'4 d'4( e'4 f'4 }
454 #(define (reverse-music music)
455 (let* ((elements (ly-get-mus-property music 'elements))
456 (reversed (reverse elements))
457 (span-dir (ly-get-mus-property music 'span-direction)))
459 (ly-set-mus-property music 'elements reversed)
462 (ly-set-mus-property music 'span-direction (- span-dir)))
464 (map reverse-music reversed)
471 \apply #reverse-music \music
473 \paper { linewidth = -1.; }
478 @section Embedded TeX
479 @lilypond[fragment,relative,verbatim]
480 a''^"3 $\\times$ \\`a deux"
483 @node Embedded PostScript
484 @section Embedded PostScript
486 Arbitrary lines and curves not supported...
488 [TODO:] Make a direct postscript command?
492 \notes \relative c'' {
493 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
494 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
495 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
499 \paper { linewidth = 70 * \staffspace; }
505 @section Checking Feature index