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 * Markup text:: Markup text
41 * Apply hacking:: Apply hacking
42 * Embedded TeX:: Embedded TeX
43 * Embedded PostScript:: Embedded PostScript
47 @node Manual beam settings
48 @section Manual beam settings
57 @cindex @code{no-stem-extend}
59 Conventionally, stems and beams extend to the middle staff line. This
60 extension can be controlled through @code{Voice.Stem}'s grob-property
61 @code{no-stem-extend}:
64 @lilypond[fragment,relative,verbatim]
66 \property Voice.Stem \set #'no-stem-extend = ##t
71 The beam symbol can be tweaked through @code{Voice.Beam}'s
72 grob-properties @code{height} and @code{staff-position},
75 Set @code{height} to zero, to get horizontal beams:
78 @lilypond[fragment,relative,verbatim]
79 \property Voice.Beam \set #'direction = #1
80 \property Voice.Beam \set #'height = #0
85 Here's how you'd specify a weird looking beam that instead of being
86 horizontal, falls two staff spaces:
89 @lilypond[fragment,relative,verbatim]
90 \property Voice.Beam \set #'staff-position = #2
91 \property Voice.Beam \set #'height = #-2
95 @cindex @code{default-neutral-direction}
97 The direction of a perfectly centred beams can be
98 controlled through @code{Voice.Beam}'s grob-property
99 @code{default-neutral-direction}
102 @lilypond[fragment,relative,verbatim]
104 \property Voice.Beam \set #'default-neutral-direction = #-1
109 There are several ways to calculate the direction of a beam.
112 number count of up or down notes
114 mean center distance of all notes
116 mean centre distance weighted per note
119 You can spot the differences of these settings from these simple
123 @lilypond[fragment,relative,verbatim]
125 \property Voice.Beam \set #'dir-function = #beam-dir-mean
127 \property Voice.Beam \set #'dir-function = #beam-dir-median
133 @lilypond[fragment,relative,verbatim]
136 \property Voice.Beam \set #'dir-function = #beam-dir-mean
138 \property Voice.Beam \set #'dir-function = #beam-dir-median
143 These beam direction functions are defined in @file{scm/beam.scm}. If
144 your favourite algorithm isn't one of these, you can hook up your own.
148 @node Engraver hacking
149 @section Engraver hacking
151 No time signature, no barlines...
154 \notes \relative c'' {
163 \remove "Time_signature_engraver";
169 No staff, no clef, squash pitches
172 \notes { c4 c4 c8 c8 }
177 \remove Staff_symbol_engraver;
178 \consists Pitch_squash_engraver;
179 \remove Clef_engraver;
194 #(define text-flat '((font-relative-size . -2 ) (music "accidentals--1")))
196 \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
197 "2 Clarinetti" (rows " (B" ,text-flat ")")))
200 \property StaffCombineStaff.instrument = #'((kern . 0.5)
201 (lines "Violoncello" (rows " e") (rows "Contrabasso")))
210 [todo: hack this into C++, use \tempo]
213 #(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
214 #(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
215 #(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
218 \notes\relative c'' {
219 a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
225 TextScript \override #'font-shape = #'upright
236 @section Apply hacking
238 [Add Parenthesed note head example?]
240 [Add Smart transpose example?]
244 music = \notes { c'4 d'4( e'4 f'4 }
246 #(define (reverse-music music)
247 (let* ((elements (ly-get-mus-property music 'elements))
248 (reversed (reverse elements))
249 (span-dir (ly-get-mus-property music 'span-direction)))
251 (ly-set-mus-property music 'elements reversed)
254 (ly-set-mus-property music 'span-direction (- span-dir)))
256 (map reverse-music reversed)
263 \apply #reverse-music \music
265 \paper { linewidth = -1.; }
270 @section Embedded TeX
271 @lilypond[fragment,relative,verbatim]
272 a''^"3 $\\times$ \\`a deux"
275 @node Embedded PostScript
276 @section Embedded PostScript
278 Arbitrary lines and curves not supported...
280 [TODO:] Make a direct postscript command?
284 \notes \relative c'' {
285 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
286 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
287 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
291 \paper { linewidth = 70 * \staffspace; }