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 * Engraver hacking:: Engraver hacking
40 * Part combiner:: Part combiner
41 * Markup text:: Markup text
42 * Apply hacking:: Apply hacking
43 * Embedded TeX:: Embedded TeX
44 * Embedded PostScript:: Embedded PostScript
48 @node Manual beam settings
49 @section Manual beam settings
58 @cindex @code{no-stem-extend}
60 Conventionally, stems and beams extend to the middle staff line. This
61 extension can be controlled through @code{Voice.Stem}'s grob-property
62 @code{no-stem-extend}:
65 @lilypond[fragment,relative,verbatim]
67 \property Voice.Stem \set #'no-stem-extend = ##t
72 The beam symbol can be tweaked through @code{Voice.Beam}'s
73 grob-properties @code{height} and @code{staff-position},
76 Set @code{height} to zero, to get horizontal beams:
79 @lilypond[fragment,relative,verbatim]
80 \property Voice.Beam \set #'direction = #1
81 \property Voice.Beam \set #'height = #0
86 Here's how you'd specify a weird looking beam that instead of being
87 horizontal, falls two staff spaces:
90 @lilypond[fragment,relative,verbatim]
91 \property Voice.Beam \set #'staff-position = #2
92 \property Voice.Beam \set #'height = #-2
96 @cindex @code{default-neutral-direction}
98 The direction of a perfectly centred beams can be
99 controlled through @code{Voice.Beam}'s grob-property
100 @code{default-neutral-direction}
103 @lilypond[fragment,relative,verbatim]
105 \property Voice.Beam \set #'default-neutral-direction = #-1
110 There are several ways to calculate the direction of a beam.
113 number count of up or down notes
115 mean center distance of all notes
117 mean centre distance weighted per note
120 You can spot the differences of these settings from these simple
124 @lilypond[fragment,relative,verbatim]
126 \property Voice.Beam \set #'dir-function = #beam-dir-mean
128 \property Voice.Beam \set #'dir-function = #beam-dir-median
134 @lilypond[fragment,relative,verbatim]
137 \property Voice.Beam \set #'dir-function = #beam-dir-mean
139 \property Voice.Beam \set #'dir-function = #beam-dir-median
144 These beam direction functions are defined in @file{scm/beam.scm}. If
145 your favourite algorithm isn't one of these, you can hook up your own.
149 @node Engraver hacking
150 @section Engraver hacking
152 No time signature, no barlines...
155 \notes \relative c'' {
164 \remove "Time_signature_engraver";
170 No staff, no clef, squash pitches
173 \notes { c4 c4 c8 c8 }
178 \remove Staff_symbol_engraver;
179 \consists Pitch_squash_engraver;
180 \remove Clef_engraver;
195 #(define text-flat '((font-relative-size . -2 ) (music "accidentals--1")))
197 \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
198 "2 Clarinetti" (rows " (B" ,text-flat ")")))
201 \property StaffCombineStaff.instrument = #'((kern . 0.5)
202 (lines "Violoncello" (rows " e") (rows "Contrabasso")))
211 [todo: hack this into C++, use \tempo]
214 #(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
215 #(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
216 #(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
219 \notes\relative c'' {
220 a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
226 TextScript \override #'font-shape = #'upright
237 @section Apply hacking
239 [Add Parenthesed note head example?]
241 [Add Smart transpose example?]
245 music = \notes { c'4 d'4( e'4 f'4 }
247 #(define (reverse-music music)
248 (let* ((elements (ly-get-mus-property music 'elements))
249 (reversed (reverse elements))
250 (span-dir (ly-get-mus-property music 'span-direction)))
252 (ly-set-mus-property music 'elements reversed)
255 (ly-set-mus-property music 'span-direction (- span-dir)))
257 (map reverse-music reversed)
264 \apply #reverse-music \music
266 \paper { linewidth = -1.; }
271 @section Embedded TeX
272 @lilypond[fragment,relative,verbatim]
273 a''^"3 $\\times$ \\`a deux"
276 @node Embedded PostScript
277 @section Embedded PostScript
279 Arbitrary lines and curves not supported...
281 [TODO:] Make a direct postscript command?
285 \notes \relative c'' {
286 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
287 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
288 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
292 \paper { linewidth = 70 * \staffspace; }