Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(147)

Delta Between Two Patch Sets: Documentation/learning/tweaks.itely

Issue 6635050: Make arguments like Context.GrobName accessible as symbol lists (Closed) Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Left Patch Set: unquote \accidentalStyle parameters, make and use symbol-list-or-symbol?, some amendments Created 12 years, 5 months ago
Right Patch Set: Allow \override Accidental.color = #red (dot between grob and property) Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Documentation/learning/fundamental.itely ('k') | Documentation/ly-examples/aucun-snippet.ly » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 @c -*- coding: utf-8; mode: texinfo; -*- 1 @c -*- coding: utf-8; mode: texinfo; -*-
2 2
3 @ignore 3 @ignore
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH 4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 5
6 When revising a translation, copy the HEAD committish of the 6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. For details, see the Contributors' 7 version that you are working on. For details, see the Contributors'
8 Guide, node Updating translation committishes.. 8 Guide, node Updating translation committishes..
9 @end ignore 9 @end ignore
10 10
11 @c \version "2.16.0" 11 @c \version "2.17.6"
12 12
13 @node Tweaking output 13 @node Tweaking output
14 @chapter Tweaking output 14 @chapter Tweaking output
15 15
16 This chapter discusses how to modify output. LilyPond is extremely 16 This chapter discusses how to modify output. LilyPond is extremely
17 configurable; virtually every fragment of output may be changed. 17 configurable; virtually every fragment of output may be changed.
18 18
19 19
20 @menu 20 @menu
21 * Tweaking basics:: 21 * Tweaking basics::
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 most common command used in tweaking, and most of the rest of 224 most common command used in tweaking, and most of the rest of
225 this chapter will be directed to presenting examples of how it is 225 this chapter will be directed to presenting examples of how it is
226 used. Here is a simple example to change the color of the 226 used. Here is a simple example to change the color of the
227 note head: 227 note head:
228 228
229 @cindex color property, example 229 @cindex color property, example
230 @cindex NoteHead, example of overriding 230 @cindex NoteHead, example of overriding
231 231
232 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 232 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
233 c4 d 233 c4 d
234 \override NoteHead #'color = #red 234 \override NoteHead.color = #red
235 e4 f | 235 e4 f |
236 \override NoteHead #'color = #green 236 \override NoteHead.color = #green
237 g4 a b c | 237 g4 a b c |
238 @end lilypond 238 @end lilypond
239 239
240 @strong{\revert command} 240 @strong{\revert command}
241 241
242 @cindex revert command 242 @cindex revert command
243 243
244 @funindex \revert 244 @funindex \revert
245 @funindex revert 245 @funindex revert
246 246
(...skipping 11 matching lines...) Expand all
258 Again, just like @var{Context} in the @code{\override} command, 258 Again, just like @var{Context} in the @code{\override} command,
259 @var{Context} is often not needed. It will be omitted 259 @var{Context} is often not needed. It will be omitted
260 in many of the following examples. Here we revert the color 260 in many of the following examples. Here we revert the color
261 of the note head to the default value for the final two notes: 261 of the note head to the default value for the final two notes:
262 262
263 @cindex color property, example 263 @cindex color property, example
264 @cindex NoteHead, example of overriding 264 @cindex NoteHead, example of overriding
265 265
266 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 266 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
267 c4 d 267 c4 d
268 \override NoteHead #'color = #red 268 \override NoteHead.color = #red
269 e4 f | 269 e4 f |
270 \override NoteHead #'color = #green 270 \override NoteHead.color = #green
271 g4 a 271 g4 a
272 \revert NoteHead #'color 272 \revert NoteHead.color
273 b4 c | 273 b4 c |
274 @end lilypond 274 @end lilypond
275 275
276 @strong{\once prefix} 276 @strong{\once prefix}
277 277
278 @funindex \once 278 @funindex \once
279 @funindex once 279 @funindex once
280 280
281 Both the @code{\override} and the @code{\set} commands may be prefixed 281 Both the @code{\override} and the @code{\set} commands may be prefixed
282 by @code{\once}. This causes the following @code{\override} or 282 by @code{\once}. This causes the following @code{\override} or
283 @code{\set} command to be effective only during the current musical 283 @code{\set} command to be effective only during the current musical
284 moment before the property reverts back to its previous value (this can 284 moment before the property reverts back to its previous value (this can
285 be different from the default if another @code{\override} is still in 285 be different from the default if another @code{\override} is still in
286 effect). Using the same example, we can change the color of a single 286 effect). Using the same example, we can change the color of a single
287 note like this: 287 note like this:
288 288
289 @cindex color property, example 289 @cindex color property, example
290 @cindex NoteHead, example of overriding 290 @cindex NoteHead, example of overriding
291 291
292 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 292 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
293 c4 d 293 c4 d
294 \override NoteHead #'color = #red 294 \override NoteHead.color = #red
295 e4 f | 295 e4 f |
296 \once \override NoteHead #'color = #green 296 \once \override NoteHead.color = #green
297 g4 a 297 g4 a
298 \revert NoteHead #'color 298 \revert NoteHead.color
299 b c | 299 b c |
300 @end lilypond 300 @end lilypond
301 301
302 @strong{\overrideProperty command} 302 @strong{\overrideProperty command}
303 303
304 @cindex overrideProperty command 304 @cindex overrideProperty command
305 305
306 @funindex \overrideProperty 306 @funindex \overrideProperty
307 @funindex overrideProperty 307 @funindex overrideProperty
308 308
(...skipping 19 matching lines...) Expand all
328 328
329 Here's an example. Suppose we wish to change the size of the 329 Here's an example. Suppose we wish to change the size of the
330 middle note head (the E) in a C major chord. Let's first see what 330 middle note head (the E) in a C major chord. Let's first see what
331 @code{\once \override} would do: 331 @code{\once \override} would do:
332 332
333 @cindex font-size property, example 333 @cindex font-size property, example
334 @cindex NoteHead, example of overriding 334 @cindex NoteHead, example of overriding
335 335
336 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 336 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
337 <c e g>4 337 <c e g>4
338 \once \override NoteHead #'font-size = #-3 338 \once \override NoteHead.font-size = #-3
339 <c e g>4 339 <c e g>4
340 <c e g>4 340 <c e g>4
341 @end lilypond 341 @end lilypond
342 342
343 We see the override affects @emph{all} the note heads in the chord. 343 We see the override affects @emph{all} the note heads in the chord.
344 This is because all the notes of a chord occur at the same 344 This is because all the notes of a chord occur at the same
345 @emph{musical moment}, and the action of @code{\once} is to 345 @emph{musical moment}, and the action of @code{\once} is to
346 apply the override to all layout objects of the type specified 346 apply the override to all layout objects of the type specified
347 which occur at the same musical moment as the @code{\override} 347 which occur at the same musical moment as the @code{\override}
348 command itself. 348 command itself.
349 349
350 The @code{\tweak} command operates in a different way. It acts on 350 The @code{\tweak} command operates in a different way. It acts on
351 the immediately following item in the input stream. In its simplest 351 the immediately following item in the input stream. In its simplest
352 form, it is effective only on objects which are created directly 352 form, it is effective only on objects which are created directly
353 from the following item, essentially note heads and articulations. 353 from the following item, essentially note heads and articulations.
354 354
355 So to return to our example, the size of the middle note of 355 So to return to our example, the size of the middle note of
356 a chord would be changed in this way: 356 a chord would be changed in this way:
357 357
358 @cindex font-size property, example 358 @cindex font-size property, example
359 @cindex @code{\tweak}, example 359 @cindex @code{\tweak}, example
360 360
361 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 361 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
362 <c e g>4 362 <c e g>4
363 <c \tweak #'font-size #-3 e g>4 363 <c \tweak font-size #-3 e g>4
364 @end lilypond 364 @end lilypond
365 365
366 Note that the syntax of @code{\tweak} is different from that of the 366 Note that the syntax of @code{\tweak} is different from that of the
367 @code{\override} command. The context should not be specified; in 367 @code{\override} command. The context should not be specified; in
368 fact, it would generate an error to do so. Both context and layout 368 fact, it would generate an error to do so. Both context and layout
369 object are implied by the following item in the input stream. Note 369 object are implied by the following item in the input stream. Note
370 also that an equals sign should not be present. So the simple form 370 also that an equals sign should not be present. So the simple form
371 of the @code{\tweak} command is 371 of the @code{\tweak} command is
372 372
373 @example 373 @example
374 \tweak #'@var{layout-property} #@var{value} 374 \tweak #'@var{layout-property} #@var{value}
375 @end example 375 @end example
376 376
377 A @code{\tweak} command can also be used to modify just one in 377 A @code{\tweak} command can also be used to modify just one in
378 a series of articulations, as shown here: 378 a series of articulations, as shown here:
379 379
380 @cindex color property, example 380 @cindex color property, example
381 @cindex @code{\tweak}, example 381 @cindex @code{\tweak}, example
382 382
383 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 383 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
384 a4^"Black" 384 a4^"Black"
385 -\tweak #'color #red ^"Red" 385 -\tweak color #red ^"Red"
386 -\tweak #'color #green _"Green" 386 -\tweak color #green _"Green"
387 @end lilypond 387 @end lilypond
388 388
389 @noindent 389 @noindent
390 Note that the @code{\tweak} command must be preceded by an articulation 390 Note that the @code{\tweak} command must be preceded by an articulation
391 mark since the tweaked expression needs to be applied as an articulation 391 mark since the tweaked expression needs to be applied as an articulation
392 itself. In case of multiple direction overrides (@code{^} or @code{_}), 392 itself. In case of multiple direction overrides (@code{^} or @code{_}),
393 the leftmost override wins since it is applied last. 393 the leftmost override wins since it is applied last.
394 394
395 @cindex @code{\tweak}, Accidental 395 @cindex @code{\tweak}, Accidental
396 @cindex @code{\tweak}, specific layout object 396 @cindex @code{\tweak}, specific layout object
397 397
398 Objects such as stems and accidentals are created later, and not 398 Objects such as stems and accidentals are created later, and not
399 directly from the following event. It is still possible to use 399 directly from the following event. It is still possible to use
400 @code{\tweak} on such indirectly created objects by explicitly naming 400 @code{\tweak} on such indirectly created objects by explicitly naming
401 the layout object, provided that LilyPond can trace its origin back to 401 the layout object, provided that LilyPond can trace its origin back to
402 the original event: 402 the original event:
403 403
404 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 404 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
405 <\tweak Accidental #'color #red cis4 405 <\tweak Accidental.color #red cis4
406 \tweak Accidental #'color #green es 406 \tweak Accidental.color #green es
407 g> 407 g>
408 @end lilypond 408 @end lilypond
409 409
410 This long form of the @code{\tweak} command can be described as 410 This long form of the @code{\tweak} command can be described as
411 @example 411 @example
412 \tweak @var{layout-object} #'@var{layout-property} @var{value} 412 \tweak @var{layout-object} #'@var{layout-property} @var{value}
413 @end example 413 @end example
414 414
415 @cindex tuplets, nested 415 @cindex tuplets, nested
416 @cindex triplets, nested 416 @cindex triplets, nested
(...skipping 13 matching lines...) Expand all
430 distinguish between them. The first @code{\tweak} command 430 distinguish between them. The first @code{\tweak} command
431 specifies that the long tuplet bracket is to be placed above the 431 specifies that the long tuplet bracket is to be placed above the
432 notes and the second one specifies that the tuplet number is to be 432 notes and the second one specifies that the tuplet number is to be
433 printed in red on the first short tuplet bracket. 433 printed in red on the first short tuplet bracket.
434 434
435 @cindex @code{\tweak}, example 435 @cindex @code{\tweak}, example
436 @cindex direction property, example 436 @cindex direction property, example
437 @cindex color property, example 437 @cindex color property, example
438 438
439 @lilypond[quote,ragged-right,verbatim,fragment,relative=2] 439 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
440 \tweak #'direction #up 440 \tweak direction #up
441 \times 4/3 { 441 \times 4/3 {
442 \tweak #'color #red 442 \tweak color #red
443 \times 2/3 { c8[ c c] } 443 \times 2/3 { c8[ c c] }
444 \times 2/3 { c8[ c c] } 444 \times 2/3 { c8[ c c] }
445 \times 2/3 { c8[ c c] } 445 \times 2/3 { c8[ c c] }
446 } 446 }
447 @end lilypond 447 @end lilypond
448 448
449 If nested tuplets do not begin at the same moment, their 449 If nested tuplets do not begin at the same moment, their
450 appearance may be modified in the usual way with 450 appearance may be modified in the usual way with
451 @code{\override} commands: 451 @code{\override} commands:
452 452
453 @cindex text property, example 453 @cindex text property, example
454 @cindex tuplet-number function, example 454 @cindex tuplet-number function, example
455 @cindex transparent property, example 455 @cindex transparent property, example
456 @cindex TupletNumber, example of overriding 456 @cindex TupletNumber, example of overriding
457 457
458 @c NOTE Tuplet brackets collide if notes are high on staff 458 @c NOTE Tuplet brackets collide if notes are high on staff
459 @c See issue 509 459 @c See issue 509
460 @lilypond[quote,ragged-right,verbatim,fragment,relative=1] 460 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
461 \times 2/3 { c8[ c c] } 461 \times 2/3 { c8[ c c] }
462 \once \override TupletNumber 462 \once \override TupletNumber.text = #tuplet-number::calc-fraction-text
463 #'text = #tuplet-number::calc-fraction-text
464 \times 2/3 { 463 \times 2/3 {
465 c8[ c] 464 c8[ c]
466 c8[ c] 465 c8[ c]
467 \once \override TupletNumber #'transparent = ##t 466 \once \override TupletNumber.transparent = ##t
468 \times 2/3 { c8[ c c] } 467 \times 2/3 { c8[ c c] }
469 \times 2/3 { c8[ c c] } 468 \times 2/3 { c8[ c c] }
470 } 469 }
471 @end lilypond 470 @end lilypond
472 471
473 472
474 @seealso 473 @seealso
475 Notation Reference: 474 Notation Reference:
476 @ruser{The tweak command}. 475 @ruser{The tweak command}.
477 476
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 is @code{Slur}, that the name of the property to change is 589 is @code{Slur}, that the name of the property to change is
591 @code{thickness} and that the new value should be a number 590 @code{thickness} and that the new value should be a number
592 somewhat larger than 1.2 if we are to make slurs thicker. 591 somewhat larger than 1.2 if we are to make slurs thicker.
593 592
594 We can now construct the @code{\override} command by simply 593 We can now construct the @code{\override} command by simply
595 substituting the values we have found for the names, omitting 594 substituting the values we have found for the names, omitting
596 the context. Let's use a very large value for the thickness 595 the context. Let's use a very large value for the thickness
597 at first, so we can be sure the command is working. We get: 596 at first, so we can be sure the command is working. We get:
598 597
599 @example 598 @example
600 \override Slur #'thickness = #5.0 599 \override Slur.thickness = #5.0
601 @end example 600 @end example
602 601
603 Don't forget the @code{#'} preceding the 602 Don't forget the @code{#'} preceding the
604 property name and a@tie{}@code{#} preceding the new value! 603 property name and a@tie{}@code{#} preceding the new value!
605 604
606 The final question is, @q{Where should this command be 605 The final question is, @q{Where should this command be
607 placed?} While you are unsure and learning, the best 606 placed?} While you are unsure and learning, the best
608 answer is, @q{Within the music, before the first slur and 607 answer is, @q{Within the music, before the first slur and
609 close to it.} Let's do that: 608 close to it.} Let's do that:
610 609
611 @cindex Slur example of overriding 610 @cindex Slur example of overriding
612 @cindex thickness property, example 611 @cindex thickness property, example
613 612
614 @lilypond[quote,verbatim,relative=2] 613 @lilypond[quote,verbatim,relative=2]
615 { 614 {
616 \key es \major 615 \key es \major
617 \time 6/8 616 \time 6/8
618 { 617 {
619 % Increase thickness of all following slurs from 1.2 to 5.0 618 % Increase thickness of all following slurs from 1.2 to 5.0
620 \override Slur #'thickness = #5.0 619 \override Slur.thickness = #5.0
621 r4 bes8 bes[( g]) g | 620 r4 bes8 bes[( g]) g |
622 g8[( es]) es d[( f]) as | 621 g8[( es]) es d[( f]) as |
623 as8 g 622 as8 g
624 } 623 }
625 \addlyrics { 624 \addlyrics {
626 The man who | feels love's sweet e -- | mo -- tion 625 The man who | feels love's sweet e -- | mo -- tion
627 } 626 }
628 } 627 }
629 @end lilypond 628 @end lilypond
630 629
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 @cindex Slur, example of overriding 679 @cindex Slur, example of overriding
681 @cindex thickness property, example 680 @cindex thickness property, example
682 681
683 @lilypond[quote,verbatim,relative=2] 682 @lilypond[quote,verbatim,relative=2]
684 { 683 {
685 \key es \major 684 \key es \major
686 \time 6/8 685 \time 6/8
687 { 686 {
688 r4 bes8 687 r4 bes8
689 % Increase thickness of immediately following slur only 688 % Increase thickness of immediately following slur only
690 \once \override Slur #'thickness = #5.0 689 \once \override Slur.thickness = #5.0
691 bes8[( g]) g | 690 bes8[( g]) g |
692 g8[( es]) es d[( f]) as | 691 g8[( es]) es d[( f]) as |
693 as8 g 692 as8 g
694 } 693 }
695 \addlyrics { 694 \addlyrics {
696 The man who | feels love's sweet e -- | mo -- tion 695 The man who | feels love's sweet e -- | mo -- tion
697 } 696 }
698 } 697 }
699 @end lilypond 698 @end lilypond
700 699
(...skipping 19 matching lines...) Expand all
720 @cindex Slur, example of overriding 719 @cindex Slur, example of overriding
721 @cindex thickness property, example 720 @cindex thickness property, example
722 721
723 @lilypond[quote,verbatim,relative=2] 722 @lilypond[quote,verbatim,relative=2]
724 { 723 {
725 \key es \major 724 \key es \major
726 \time 6/8 725 \time 6/8
727 { 726 {
728 r4 bes8 727 r4 bes8
729 % Increase thickness of immediately following slur only 728 % Increase thickness of immediately following slur only
730 \once \override Slur #'thickness = #5.0 729 \once \override Slur.thickness = #5.0
731 bes[( g]) g | 730 bes[( g]) g |
732 % Increase thickness of immediately following slur only 731 % Increase thickness of immediately following slur only
733 \once \override Slur #'thickness = #5.0 732 \once \override Slur.thickness = #5.0
734 g8[( es]) es d[( f]) as | 733 g8[( es]) es d[( f]) as |
735 as8 g 734 as8 g
736 } 735 }
737 \addlyrics { 736 \addlyrics {
738 The man who | feels love's sweet e -- | mo -- tion 737 The man who | feels love's sweet e -- | mo -- tion
739 } 738 }
740 } 739 }
741 @end lilypond 740 @end lilypond
742 741
743 @noindent 742 @noindent
744 or we could omit the @code{\once} command and use the @code{\revert} 743 or we could omit the @code{\once} command and use the @code{\revert}
745 command to return the @code{thickness} property to its default value 744 command to return the @code{thickness} property to its default value
746 after the second slur: 745 after the second slur:
747 746
748 @cindex Slur, example of overriding 747 @cindex Slur, example of overriding
749 @cindex thickness property, example 748 @cindex thickness property, example
750 749
751 @lilypond[quote,verbatim,relative=2] 750 @lilypond[quote,verbatim,relative=2]
752 { 751 {
753 \key es \major 752 \key es \major
754 \time 6/8 753 \time 6/8
755 { 754 {
756 r4 bes8 755 r4 bes8
757 % Increase thickness of all following slurs from 1.2 to 5.0 756 % Increase thickness of all following slurs from 1.2 to 5.0
758 \override Slur #'thickness = #5.0 757 \override Slur.thickness = #5.0
759 bes[( g]) g | 758 bes[( g]) g |
760 g8[( es]) es 759 g8[( es]) es
761 % Revert thickness of all following slurs to default of 1.2 760 % Revert thickness of all following slurs to default of 1.2
762 \revert Slur #'thickness 761 \revert Slur.thickness
763 d8[( f]) as | 762 d8[( f]) as |
764 as8 g 763 as8 g
765 } 764 }
766 \addlyrics { 765 \addlyrics {
767 The man who | feels love's sweet e -- | mo -- tion 766 The man who | feels love's sweet e -- | mo -- tion
768 } 767 }
769 } 768 }
770 @end lilypond 769 @end lilypond
771 770
772 @noindent 771 @noindent
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 @code{thickness} or @code{font-shape}, others are used as values that 840 @code{thickness} or @code{font-shape}, others are used as values that
842 can be given to properties, like @code{italic}. Note the distinction 841 can be given to properties, like @code{italic}. Note the distinction
843 from arbitrary text strings, which would appear as @code{"a text 842 from arbitrary text strings, which would appear as @code{"a text
844 string"}; for more details about symbols and strings, see 843 string"}; for more details about symbols and strings, see
845 @rextend{Scheme tutorial}. 844 @rextend{Scheme tutorial}.
846 845
847 So we see that the @code{\override} command needed to print the lyrics 846 So we see that the @code{\override} command needed to print the lyrics
848 in italics is: 847 in italics is:
849 848
850 @example 849 @example
851 \override LyricText #'font-shape = #'italic 850 \override LyricText.font-shape = #'italic
852 @end example 851 @end example
853 852
854 @noindent 853 @noindent
855 This should be placed just in front of the lyrics we wish to affect, 854 This should be placed just in front of the lyrics we wish to affect,
856 like so: 855 like so:
857 856
858 @cindex font-shape property, example 857 @cindex font-shape property, example
859 @cindex italic, example 858 @cindex italic, example
860 @cindex LyricText, example of overriding 859 @cindex LyricText, example of overriding
861 @cindex @code{\addlyrics}, example 860 @cindex @code{\addlyrics}, example
862 861
863 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 862 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
864 { 863 {
865 \key es \major 864 \key es \major
866 \time 6/8 865 \time 6/8
867 { 866 {
868 r4 bes8 bes[( g]) g | 867 r4 bes8 bes[( g]) g |
869 g8[( es]) es d[( f]) as | 868 g8[( es]) es d[( f]) as |
870 as8 g 869 as8 g
871 } 870 }
872 \addlyrics { 871 \addlyrics {
873 \override LyricText #'font-shape = #'italic 872 \override LyricText.font-shape = #'italic
874 The man who | feels love's sweet e -- | mo -- tion 873 The man who | feels love's sweet e -- | mo -- tion
875 } 874 }
876 } 875 }
877 @end lilypond 876 @end lilypond
878 877
879 @noindent 878 @noindent
880 and the lyrics are all printed in italics. 879 and the lyrics are all printed in italics.
881 880
882 @subheading Specifying the context in lyric mode 881 @subheading Specifying the context in lyric mode
883 882
884 @cindex context, specifying in lyric mode 883 @cindex context, specifying in lyric mode
885 @cindex lyric mode, specifying context 884 @cindex lyric mode, specifying context
886 885
887 In the case of lyrics, if you try specifying the context in the 886 In the case of lyrics, if you try specifying the context in the
888 format given earlier the command will fail. A syllable 887 format given earlier the command will fail. A syllable
889 entered in lyricmode is terminated by either a space, 888 entered in lyricmode is terminated by either a space,
890 a newline or a digit. All other characters are included 889 a newline or a digit. All other characters are included
891 as part of the syllable. For this reason a space or newline 890 as part of the syllable. For this reason a space or newline
892 must appear before the terminating @code{@}} to prevent it being 891 must appear before the terminating @code{@}} to prevent it being
893 included as part of the final syllable. Similarly, 892 included as part of the final syllable. Similarly,
894 spaces must be inserted before and after the 893 spaces must be inserted before and after the
895 period or dot, @q{.}, separating the context name from the 894 period or dot, @q{.}, separating the context name from the
896 object name, as otherwise the two names are run together and 895 object name, as otherwise the two names are run together and
897 the interpreter cannot recognize them. So the command should be: 896 the interpreter cannot recognize them. So the command should be:
898 897
899 @example 898 @example
900 \override Lyrics . LyricText #'font-shape = #'italic 899 \override Lyrics.LyricText.font-shape = #'italic
901 @end example 900 @end example
902 901
903 @warning{In lyrics always leave whitespace between the final 902 @warning{In lyrics always leave whitespace between the final
904 syllable and the terminating brace.} 903 syllable and the terminating brace.}
905 904
906 @warning{In overrides in lyrics always place spaces around 905 @warning{In overrides in lyrics always place spaces around
907 the dot between the context name and the object name.} 906 the dot between the context name and the object name.}
908 907
909 908
910 @seealso 909 @seealso
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 with many other properties, it can be set to print nothing by 1037 with many other properties, it can be set to print nothing by
1039 setting its value to @code{#f}. Let's try it, as before, omitting 1038 setting its value to @code{#f}. Let's try it, as before, omitting
1040 the implied Context, @code{Voice}: 1039 the implied Context, @code{Voice}:
1041 1040
1042 @cindex BarLine, example of overriding 1041 @cindex BarLine, example of overriding
1043 @cindex stencil property, example 1042 @cindex stencil property, example
1044 1043
1045 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1044 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1046 { 1045 {
1047 \time 12/16 1046 \time 12/16
1048 \override BarLine #'stencil = ##f 1047 \override BarLine.stencil = ##f
1049 c4 b8 c d16 c d8 | 1048 c4 b8 c d16 c d8 |
1050 g,8 a16 b8 c d4 e16 | 1049 g,8 a16 b8 c d4 e16 |
1051 e8 1050 e8
1052 } 1051 }
1053 @end lilypond 1052 @end lilypond
1054 1053
1055 The bar lines are still printed. What is wrong? Go back to the IR 1054 The bar lines are still printed. What is wrong? Go back to the IR
1056 and look again at the page giving the properties of BarLine. At the 1055 and look again at the page giving the properties of BarLine. At the
1057 top of the page it says @qq{Barline objects are created by: 1056 top of the page it says @qq{Barline objects are created by:
1058 Bar_engraver}. Go to the @code{Bar_engraver} page. At the bottom it 1057 Bar_engraver}. Go to the @code{Bar_engraver} page. At the bottom it
1059 gives a list of Contexts in which the bar engraver operates. All of 1058 gives a list of Contexts in which the bar engraver operates. All of
1060 them are of the type @code{Staff}, so the reason the @code{\override} 1059 them are of the type @code{Staff}, so the reason the @code{\override}
1061 command failed to work as expected is because @code{Barline} is not in 1060 command failed to work as expected is because @code{Barline} is not in
1062 the default @code{Voice} context. If the context is specified 1061 the default @code{Voice} context. If the context is specified
1063 incorrectly, the command simply does not work. No error message is 1062 incorrectly, the command simply does not work. No error message is
1064 produced, and nothing is logged in the log file. Let's try correcting 1063 produced, and nothing is logged in the log file. Let's try correcting
1065 it by adding the correct context: 1064 it by adding the correct context:
1066 1065
1067 @cindex BarLine, example of overriding 1066 @cindex BarLine, example of overriding
1068 @cindex stencil property, example 1067 @cindex stencil property, example
1069 1068
1070 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1069 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1071 { 1070 {
1072 \time 12/16 1071 \time 12/16
1073 \override Staff.BarLine #'stencil = ##f 1072 \override Staff.BarLine.stencil = ##f
1074 c4 b8 c d16 c d8 | 1073 c4 b8 c d16 c d8 |
1075 g,8 a16 b8 c d4 e16 | 1074 g,8 a16 b8 c d4 e16 |
1076 e8 1075 e8
1077 } 1076 }
1078 @end lilypond 1077 @end lilypond
1079 1078
1080 Now the bar lines have vanished. 1079 Now the bar lines have vanished.
1081 1080
1082 Note, though, that setting the @code{stencil} property to @code{#f} 1081 Note, though, that setting the @code{stencil} property to @code{#f}
1083 will cause errors when the dimensions of the object are required for 1082 will cause errors when the dimensions of the object are required for
1084 correct processing. For example, errors will be generated if the 1083 correct processing. For example, errors will be generated if the
1085 @code{stencil} property of the @code{NoteHead} object is set to 1084 @code{stencil} property of the @code{NoteHead} object is set to
1086 @code{#f}. If this is the case, you can instead use the 1085 @code{#f}. If this is the case, you can instead use the
1087 @code{point-stencil} function, which sets the stencil to a object 1086 @code{point-stencil} function, which sets the stencil to a object
1088 with zero size: 1087 with zero size:
1089 1088
1090 @lilypond[quote,verbatim,relative=2] 1089 @lilypond[quote,verbatim,relative=2]
1091 { 1090 {
1092 c4 c 1091 c4 c
1093 \once \override NoteHead #'stencil = #point-stencil 1092 \once \override NoteHead.stencil = #point-stencil
1094 c4 c 1093 c4 c
1095 } 1094 }
1096 @end lilypond 1095 @end lilypond
1097 1096
1098 @subheading break-visibility 1097 @subheading break-visibility
1099 1098
1100 @cindex break-visibility property 1099 @cindex break-visibility property
1101 1100
1102 We see from the @code{BarLine} properties in the IR that the 1101 We see from the @code{BarLine} properties in the IR that the
1103 @code{break-visibility} property requires a vector of three booleans. 1102 @code{break-visibility} property requires a vector of three booleans.
1104 These control respectively whether bar lines are printed at the end of 1103 These control respectively whether bar lines are printed at the end of
1105 a line, in the middle of lines, and at the beginning of lines. For 1104 a line, in the middle of lines, and at the beginning of lines. For
1106 our example we want all bar lines to be suppressed, so the value we 1105 our example we want all bar lines to be suppressed, so the value we
1107 need is @code{'#(#f #f #f)}. Let's try that, remembering to include 1106 need is @code{'#(#f #f #f)}. Let's try that, remembering to include
1108 the @code{Staff} context. Note also that in writing this value we 1107 the @code{Staff} context. Note also that in writing this value we
1109 have @code{#'#} before the opening bracket. The @code{'#} is required 1108 have @code{#'#} before the opening bracket. The @code{'#} is required
1110 as part of the value to introduce a vector, and the first@tie{}@code{#} is 1109 as part of the value to introduce a vector, and the first@tie{}@code{#} is
1111 required, as always, to precede the value itself in the 1110 required, as always, to precede the value itself in the
1112 @code{\override} command. 1111 @code{\override} command.
1113 1112
1114 @cindex BarLine, example of overriding 1113 @cindex BarLine, example of overriding
1115 @cindex break-visibility property, example 1114 @cindex break-visibility property, example
1116 1115
1117 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1116 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1118 { 1117 {
1119 \time 12/16 1118 \time 12/16
1120 \override Staff.BarLine #'break-visibility = #'#(#f #f #f) 1119 \override Staff.BarLine.break-visibility = #'#(#f #f #f)
1121 c4 b8 c d16 c d8 | 1120 c4 b8 c d16 c d8 |
1122 g,8 a16 b8 c d4 e16 | 1121 g,8 a16 b8 c d4 e16 |
1123 e8 1122 e8
1124 } 1123 }
1125 @end lilypond 1124 @end lilypond
1126 1125
1127 And we see this too removes all the bar lines. 1126 And we see this too removes all the bar lines.
1128 1127
1129 @subheading transparent 1128 @subheading transparent
1130 1129
(...skipping 11 matching lines...) Expand all
1142 also lives in the @code{Staff} context and also supports the 1141 also lives in the @code{Staff} context and also supports the
1143 @code{grob-interface}. So the command to make the time signature 1142 @code{grob-interface}. So the command to make the time signature
1144 transparent is: 1143 transparent is:
1145 1144
1146 @cindex TimeSignature, example of overriding 1145 @cindex TimeSignature, example of overriding
1147 @cindex transparent property, example 1146 @cindex transparent property, example
1148 1147
1149 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1148 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1150 { 1149 {
1151 \time 12/16 1150 \time 12/16
1152 \override Staff.TimeSignature #'transparent = ##t 1151 \override Staff.TimeSignature.transparent = ##t
1153 c4 b8 c d16 c d8 | 1152 c4 b8 c d16 c d8 |
1154 g,8 a16 b8 c d4 e16 | 1153 g,8 a16 b8 c d4 e16 |
1155 e8 1154 e8
1156 } 1155 }
1157 @end lilypond 1156 @end lilypond
1158 1157
1159 @noindent 1158 @noindent
1160 The time signature is gone, but this command leaves a gap where 1159 The time signature is gone, but this command leaves a gap where
1161 the time signature should be. Maybe this is what is wanted for 1160 the time signature should be. Maybe this is what is wanted for
1162 an exercise for the student to fill it in, but in other 1161 an exercise for the student to fill it in, but in other
1163 circumstances a gap might be undesirable. To remove it, the 1162 circumstances a gap might be undesirable. To remove it, the
1164 stencil for the time signature should be set to @code{#f} 1163 stencil for the time signature should be set to @code{#f}
1165 instead: 1164 instead:
1166 1165
1167 @cindex TimeSignature, example of overriding 1166 @cindex TimeSignature, example of overriding
1168 @cindex stencil property, example 1167 @cindex stencil property, example
1169 1168
1170 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1169 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1171 { 1170 {
1172 \time 12/16 1171 \time 12/16
1173 \override Staff.TimeSignature #'stencil = ##f 1172 \override Staff.TimeSignature.stencil = ##f
1174 c4 b8 c d16 c d8 | 1173 c4 b8 c d16 c d8 |
1175 g,8 a16 b8 c d4 e16 | 1174 g,8 a16 b8 c d4 e16 |
1176 e8 1175 e8
1177 } 1176 }
1178 @end lilypond 1177 @end lilypond
1179 1178
1180 @noindent 1179 @noindent
1181 and the difference is obvious: setting the stencil to @code{#f} 1180 and the difference is obvious: setting the stencil to @code{#f}
1182 removes the object entirely; making the object @code{transparent} 1181 removes the object entirely; making the object @code{transparent}
1183 leaves it where it is, but makes it invisible. 1182 leaves it where it is, but makes it invisible.
(...skipping 20 matching lines...) Expand all
1204 of the @q{normal} colors listed in the first table in 1203 of the @q{normal} colors listed in the first table in
1205 @ruser{List of colors}. To set the bar lines to white 1204 @ruser{List of colors}. To set the bar lines to white
1206 we write: 1205 we write:
1207 1206
1208 @cindex BarLine, example of overriding 1207 @cindex BarLine, example of overriding
1209 @cindex color property, example 1208 @cindex color property, example
1210 1209
1211 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1210 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1212 { 1211 {
1213 \time 12/16 1212 \time 12/16
1214 \override Staff.BarLine #'color = #white 1213 \override Staff.BarLine.color = #white
1215 c4 b8 c d16 c d8 | 1214 c4 b8 c d16 c d8 |
1216 g,8 a16 b8 c d4 e16 | 1215 g,8 a16 b8 c d4 e16 |
1217 e8 1216 e8
1218 } 1217 }
1219 @end lilypond 1218 @end lilypond
1220 1219
1221 @noindent 1220 @noindent
1222 and again, we see the bar lines are not visible. Note that 1221 and again, we see the bar lines are not visible. Note that
1223 @emph{white} is not preceded by an apostrophe -- it is not 1222 @emph{white} is not preceded by an apostrophe -- it is not
1224 a symbol, but a @emph{function}. When called, it provides 1223 a symbol, but a @emph{function}. When called, it provides
(...skipping 13 matching lines...) Expand all
1238 However, these must be preceded by another function, which 1237 However, these must be preceded by another function, which
1239 converts X11 color names into the list of internal values, 1238 converts X11 color names into the list of internal values,
1240 @code{x11-color}, like this: 1239 @code{x11-color}, like this:
1241 1240
1242 @cindex BarLine, example of overriding 1241 @cindex BarLine, example of overriding
1243 @cindex color property, example 1242 @cindex color property, example
1244 1243
1245 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1244 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1246 { 1245 {
1247 \time 12/16 1246 \time 12/16
1248 \override Staff.BarLine #'color = #(x11-color 'white) 1247 \override Staff.BarLine.color = #(x11-color 'white)
1249 c4 b8 c d16 c d8 | 1248 c4 b8 c d16 c d8 |
1250 g,8 a16 b8 c d4 e16 | 1249 g,8 a16 b8 c d4 e16 |
1251 e8 1250 e8
1252 } 1251 }
1253 @end lilypond 1252 @end lilypond
1254 1253
1255 @noindent 1254 @noindent
1256 Note that in this case the function @code{x11-color} takes 1255 Note that in this case the function @code{x11-color} takes
1257 a symbol as an argument, so the symbol must be preceded by 1256 a symbol as an argument, so the symbol must be preceded by
1258 an apostrophe and the two enclosed in brackets. 1257 an apostrophe and the two enclosed in brackets.
1259 1258
1260 @cindex rgb colors 1259 @cindex rgb colors
1261 @cindex color, rgb 1260 @cindex color, rgb
1262 1261
1263 @funindex rgb-color 1262 @funindex rgb-color
1264 1263
1265 There is yet a third function, one which converts RGB values into 1264 There is yet a third function, one which converts RGB values into
1266 internal colors -- the @code{rgb-color} function. This takes 1265 internal colors -- the @code{rgb-color} function. This takes
1267 three arguments giving the intensities of the red, green and 1266 three arguments giving the intensities of the red, green and
1268 blue colors. These take values in the range 0 to 1. So to 1267 blue colors. These take values in the range 0 to 1. So to
1269 set the color to red the value should be @code{(rgb-color 1 0 0)} 1268 set the color to red the value should be @code{(rgb-color 1 0 0)}
1270 and to white it should be @code{(rgb-color 1 1 1)}: 1269 and to white it should be @code{(rgb-color 1 1 1)}:
1271 1270
1272 @cindex BarLine, example of overriding 1271 @cindex BarLine, example of overriding
1273 @cindex color property, example 1272 @cindex color property, example
1274 1273
1275 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1274 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1276 { 1275 {
1277 \time 12/16 1276 \time 12/16
1278 \override Staff.BarLine #'color = #(rgb-color 1 1 1) 1277 \override Staff.BarLine.color = #(rgb-color 1 1 1)
1279 c4 b8 c d16 c d8 | 1278 c4 b8 c d16 c d8 |
1280 g,8 a16 b8 c d4 e16 | 1279 g,8 a16 b8 c d4 e16 |
1281 e8 1280 e8
1282 } 1281 }
1283 @end lilypond 1282 @end lilypond
1284 1283
1285 Finally, there is also a grey scale available as part of the 1284 Finally, there is also a grey scale available as part of the
1286 X11 set of colors. These range from black, @code{'grey0}, 1285 X11 set of colors. These range from black, @code{'grey0},
1287 to white, @code{'grey100}, in steps of 1. Let's illustrate 1286 to white, @code{'grey100}, in steps of 1. Let's illustrate
1288 this by setting all the layout objects in our example to 1287 this by setting all the layout objects in our example to
1289 various shades of grey: 1288 various shades of grey:
1290 1289
1291 @cindex StaffSymbol, example of overriding 1290 @cindex StaffSymbol, example of overriding
1292 @cindex TimeSignature, example of overriding 1291 @cindex TimeSignature, example of overriding
1293 @cindex Clef, example of overriding 1292 @cindex Clef, example of overriding
1294 @cindex NoteHead, example of overriding 1293 @cindex NoteHead, example of overriding
1295 @cindex Stem, example of overriding 1294 @cindex Stem, example of overriding
1296 @cindex BarLine, example of overriding 1295 @cindex BarLine, example of overriding
1297 @cindex color property, example 1296 @cindex color property, example
1298 @cindex x11-color, example of using 1297 @cindex x11-color, example of using
1299 1298
1300 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1299 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1301 { 1300 {
1302 \time 12/16 1301 \time 12/16
1303 \override Staff.StaffSymbol #'color = #(x11-color 'grey30) 1302 \override Staff.StaffSymbol.color = #(x11-color 'grey30)
1304 \override Staff.TimeSignature #'color = #(x11-color 'grey60) 1303 \override Staff.TimeSignature.color = #(x11-color 'grey60)
1305 \override Staff.Clef #'color = #(x11-color 'grey60) 1304 \override Staff.Clef.color = #(x11-color 'grey60)
1306 \override Voice.NoteHead #'color = #(x11-color 'grey85) 1305 \override Voice.NoteHead.color = #(x11-color 'grey85)
1307 \override Voice.Stem #'color = #(x11-color 'grey85) 1306 \override Voice.Stem.color = #(x11-color 'grey85)
1308 \override Staff.BarLine #'color = #(x11-color 'grey10) 1307 \override Staff.BarLine.color = #(x11-color 'grey10)
1309 c4 b8 c d16 c d8 | 1308 c4 b8 c d16 c d8 |
1310 g,8 a16 b8 c d4 e16 | 1309 g,8 a16 b8 c d4 e16 |
1311 e8 1310 e8
1312 } 1311 }
1313 @end lilypond 1312 @end lilypond
1314 1313
1315 @noindent 1314 @noindent
1316 Note the contexts associated with each of the layout objects. 1315 Note the contexts associated with each of the layout objects.
1317 It is important to get these right, or the commands will not 1316 It is important to get these right, or the commands will not
1318 work! Remember, the context is the one in which the appropriate 1317 work! Remember, the context is the one in which the appropriate
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 \new Staff ="main" { 1368 \new Staff ="main" {
1370 \relative g' { 1369 \relative g' {
1371 r4 g8 g c4 c8 d | 1370 r4 g8 g c4 c8 d |
1372 e4 r8 1371 e4 r8
1373 << 1372 <<
1374 { f8 c c } 1373 { f8 c c }
1375 \new Staff \with { 1374 \new Staff \with {
1376 alignAboveContext = #"main" 1375 alignAboveContext = #"main"
1377 } 1376 }
1378 { 1377 {
1379 \override Staff.Clef #'stencil = ##f 1378 \override Staff.Clef.stencil = ##f
1380 \override Staff.TimeSignature #'stencil = ##f 1379 \override Staff.TimeSignature.stencil = ##f
1381 { f8 f c } 1380 { f8 f c }
1382 } 1381 }
1383 >> 1382 >>
1384 r4 | 1383 r4 |
1385 } 1384 }
1386 } 1385 }
1387 @end lilypond 1386 @end lilypond
1388 1387
1389 @noindent 1388 @noindent
1390 where the extra pair of braces after the @code{\with} clause are 1389 where the extra pair of braces after the @code{\with} clause are
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1428 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1430 \new Staff ="main" { 1429 \new Staff ="main" {
1431 \relative g' { 1430 \relative g' {
1432 r4 g8 g c4 c8 d | 1431 r4 g8 g c4 c8 d |
1433 e4 r8 1432 e4 r8
1434 << 1433 <<
1435 { f8 c c } 1434 { f8 c c }
1436 \new Staff \with { 1435 \new Staff \with {
1437 alignAboveContext = #"main" 1436 alignAboveContext = #"main"
1438 % Don't print clefs in this staff 1437 % Don't print clefs in this staff
1439 \override Clef #'stencil = ##f 1438 \override Clef.stencil = ##f
1440 % Don't print time signatures in this staff 1439 % Don't print time signatures in this staff
1441 \override TimeSignature #'stencil = ##f 1440 \override TimeSignature.stencil = ##f
1442 } 1441 }
1443 { f8 f c } 1442 { f8 f c }
1444 >> 1443 >>
1445 r4 | 1444 r4 |
1446 } 1445 }
1447 } 1446 }
1448 @end lilypond 1447 @end lilypond
1449 1448
1450 Finally we come to changing the size of layout objects. 1449 Finally we come to changing the size of layout objects.
1451 1450
1452 Some layout objects are created as glyphs selected from a typeface 1451 Some layout objects are created as glyphs selected from a typeface
1453 font. These include note heads, accidentals, markup, clefs, time 1452 font. These include note heads, accidentals, markup, clefs, time
1454 signatures, dynamics and lyrics. Their size is changed by modifying 1453 signatures, dynamics and lyrics. Their size is changed by modifying
1455 the @code{font-size} property, as we shall shortly see. Other layout 1454 the @code{font-size} property, as we shall shortly see. Other layout
1456 objects such as slurs and ties -- in general, spanner objects -- are 1455 objects such as slurs and ties -- in general, spanner objects -- are
1457 drawn individually, so there is no @code{font-size} associated with 1456 drawn individually, so there is no @code{font-size} associated with
1458 them. These objects generally derive their size from the objects to 1457 them. These objects generally derive their size from the objects to
1459 which they are attached, so usually there is no need to change their 1458 which they are attached, so usually there is no need to change their
1460 size manually. Still other properties such as the length of stems and 1459 size manually. Still other properties such as the length of stems and
1461 bar lines, thickness of beams and other lines, and the separation of 1460 bar lines, thickness of beams and other lines, and the separation of
1462 staff lines all need to be modified in special ways. 1461 staff lines all need to be modified in special ways.
1463 1462
1464 Returning to the ossia example, let us first change the font-size. 1463 Returning to the ossia example, let us first change the font-size.
1465 We can do this in two ways. We can either change the size of the 1464 We can do this in two ways. We can either change the size of the
1466 fonts of each object type, like @code{NoteHead}s with commands 1465 fonts of each object type, like @code{NoteHead}s with commands
1467 like 1466 like
1468 1467
1469 @example 1468 @example
1470 \override NoteHead #'font-size = #-2 1469 \override NoteHead.font-size = #-2
1471 @end example 1470 @end example
1472 1471
1473 or we can change the size of all fonts by setting a special 1472 or we can change the size of all fonts by setting a special
1474 property, @code{fontSize}, using @code{\set}, or by including 1473 property, @code{fontSize}, using @code{\set}, or by including
1475 it in a @code{\with} clause (but without the @code{\set}). 1474 it in a @code{\with} clause (but without the @code{\set}).
1476 1475
1477 @example 1476 @example
1478 \set fontSize = #-2 1477 \set fontSize = #-2
1479 @end example 1478 @end example
1480 1479
(...skipping 11 matching lines...) Expand all
1492 1491
1493 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1492 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1494 \new Staff ="main" { 1493 \new Staff ="main" {
1495 \relative g' { 1494 \relative g' {
1496 r4 g8 g c4 c8 d | 1495 r4 g8 g c4 c8 d |
1497 e4 r8 1496 e4 r8
1498 << 1497 <<
1499 { f8 c c } 1498 { f8 c c }
1500 \new Staff \with { 1499 \new Staff \with {
1501 alignAboveContext = #"main" 1500 alignAboveContext = #"main"
1502 \override Clef #'stencil = ##f 1501 \override Clef.stencil = ##f
1503 \override TimeSignature #'stencil = ##f 1502 \override TimeSignature.stencil = ##f
1504 % Reduce all font sizes by ~24% 1503 % Reduce all font sizes by ~24%
1505 fontSize = #-2 1504 fontSize = #-2
1506 } 1505 }
1507 { f8 f c } 1506 { f8 f c }
1508 >> 1507 >>
1509 r4 | 1508 r4 |
1510 } 1509 }
1511 } 1510 }
1512 @end lilypond 1511 @end lilypond
1513 1512
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 1557
1559 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1558 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1560 \new Staff ="main" { 1559 \new Staff ="main" {
1561 \relative g' { 1560 \relative g' {
1562 r4 g8 g c4 c8 d | 1561 r4 g8 g c4 c8 d |
1563 e4 r8 1562 e4 r8
1564 << 1563 <<
1565 { f8 c c } 1564 { f8 c c }
1566 \new Staff \with { 1565 \new Staff \with {
1567 alignAboveContext = #"main" 1566 alignAboveContext = #"main"
1568 \override Clef #'stencil = ##f 1567 \override Clef.stencil = ##f
1569 \override TimeSignature #'stencil = ##f 1568 \override TimeSignature.stencil = ##f
1570 fontSize = #-2 1569 fontSize = #-2
1571 % Reduce stem length and line spacing to match 1570 % Reduce stem length and line spacing to match
1572 \override StaffSymbol #'staff-space = #(magstep -2) 1571 \override StaffSymbol.staff-space = #(magstep -2)
1573 } 1572 }
1574 { f8 f c } 1573 { f8 f c }
1575 >> 1574 >>
1576 r4 | 1575 r4 |
1577 } 1576 }
1578 } 1577 }
1579 @end lilypond 1578 @end lilypond
1580 1579
1581 @noindent 1580 @noindent
1582 Since the length of stems and many other length-related properties are 1581 Since the length of stems and many other length-related properties are
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 with those on high notes pointing down and those on low notes pointing 1717 with those on high notes pointing down and those on low notes pointing
1719 up, followed by four notes with all stems forced down, four notes with 1718 up, followed by four notes with all stems forced down, four notes with
1720 all stems forced up, and finally four notes reverted back to the 1719 all stems forced up, and finally four notes reverted back to the
1721 default behavior. 1720 default behavior.
1722 1721
1723 @cindex Stem, example of overriding 1722 @cindex Stem, example of overriding
1724 @cindex direction property, example 1723 @cindex direction property, example
1725 1724
1726 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1725 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1727 a4 g c a | 1726 a4 g c a |
1728 \override Stem #'direction = #DOWN 1727 \override Stem.direction = #DOWN
1729 a4 g c a | 1728 a4 g c a |
1730 \override Stem #'direction = #UP 1729 \override Stem.direction = #UP
1731 a4 g c a | 1730 a4 g c a |
1732 \revert Stem #'direction 1731 \revert Stem.direction
1733 a4 g c a | 1732 a4 g c a |
1734 @end lilypond 1733 @end lilypond
1735 1734
1736 Here we use the constants @code{DOWN} and @code{UP}. 1735 Here we use the constants @code{DOWN} and @code{UP}.
1737 These have the values @w{@code{-1}} and @code{+1} respectively, and 1736 These have the values @w{@code{-1}} and @code{+1} respectively, and
1738 these numerical values may be used instead. The value @code{0} 1737 these numerical values may be used instead. The value @code{0}
1739 may also be used in some cases. It is simply treated as meaning 1738 may also be used in some cases. It is simply treated as meaning
1740 @code{UP} for stems, but for some objects it means @q{center}. 1739 @code{UP} for stems, but for some objects it means @q{center}.
1741 There is a constant, @code{CENTER} which has the value @code{0}. 1740 There is a constant, @code{CENTER} which has the value @code{0}.
1742 1741
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 First, here's the effect of @code{direction} on the fingering 1808 First, here's the effect of @code{direction} on the fingering
1810 attached to single notes. The first bar shows the default 1809 attached to single notes. The first bar shows the default
1811 behaviour, and the following two bars shows the effect of 1810 behaviour, and the following two bars shows the effect of
1812 specifying @code{DOWN} and @code{UP}: 1811 specifying @code{DOWN} and @code{UP}:
1813 1812
1814 @cindex Fingering, example of overriding 1813 @cindex Fingering, example of overriding
1815 @cindex direction property, example 1814 @cindex direction property, example
1816 1815
1817 @lilypond[quote,verbatim,relative=2] 1816 @lilypond[quote,verbatim,relative=2]
1818 c4-5 a-3 f-1 c'-5 | 1817 c4-5 a-3 f-1 c'-5 |
1819 \override Fingering #'direction = #DOWN 1818 \override Fingering.direction = #DOWN
1820 c4-5 a-3 f-1 c'-5 | 1819 c4-5 a-3 f-1 c'-5 |
1821 \override Fingering #'direction = #UP 1820 \override Fingering.direction = #UP
1822 c4-5 a-3 f-1 c'-5 | 1821 c4-5 a-3 f-1 c'-5 |
1823 @end lilypond 1822 @end lilypond
1824 1823
1825 However, overriding the @code{direction} property is not the 1824 However, overriding the @code{direction} property is not the
1826 easiest way of manually setting the fingering above or below 1825 easiest way of manually setting the fingering above or below
1827 the notes; using @code{_} or @code{^} instead of @code{-} before 1826 the notes; using @code{_} or @code{^} instead of @code{-} before
1828 the fingering number is usually preferable. Here is the previous 1827 the fingering number is usually preferable. Here is the previous
1829 example using this method: 1828 example using this method:
1830 1829
1831 @cindex fingering example 1830 @cindex fingering example
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 <c-1 e-2 g-3 b-5>4 1913 <c-1 e-2 g-3 b-5>4
1915 @end lilypond 1914 @end lilypond
1916 1915
1917 @noindent 1916 @noindent
1918 If the fingering seems a little crowded the @code{font-size} 1917 If the fingering seems a little crowded the @code{font-size}
1919 could be reduced. The default value can be seen from the 1918 could be reduced. The default value can be seen from the
1920 @code{Fingering} object in the IR to be @w{@code{-5}}, so let's 1919 @code{Fingering} object in the IR to be @w{@code{-5}}, so let's
1921 try @w{@code{-7}}: 1920 try @w{@code{-7}}:
1922 1921
1923 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 1922 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
1924 \override Fingering #'font-size = #-7 1923 \override Fingering.font-size = #-7
1925 \set fingeringOrientations = #'(left) 1924 \set fingeringOrientations = #'(left)
1926 <f-2>4 1925 <f-2>4
1927 <c-1 e-2 g-3 b-5>4 1926 <c-1 e-2 g-3 b-5>4
1928 \set fingeringOrientations = #'(left) 1927 \set fingeringOrientations = #'(left)
1929 <f-2>4 1928 <f-2>4
1930 <c-1 e-2 g-3 b-5>4 | 1929 <c-1 e-2 g-3 b-5>4 |
1931 \set fingeringOrientations = #'(up left down) 1930 \set fingeringOrientations = #'(up left down)
1932 <f-2>4 1931 <f-2>4
1933 <c-1 e-2 g-3 b-5>4 1932 <c-1 e-2 g-3 b-5>4
1934 \set fingeringOrientations = #'(up left) 1933 \set fingeringOrientations = #'(up left)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 @funindex \startTextSpan 2011 @funindex \startTextSpan
2013 @funindex startTextSpan 2012 @funindex startTextSpan
2014 @funindex \stopTextSpan 2013 @funindex \stopTextSpan
2015 @funindex stopTextSpan 2014 @funindex stopTextSpan
2016 2015
2017 @cindex TextSpanner, example of overriding 2016 @cindex TextSpanner, example of overriding
2018 @cindex bound-details property, example 2017 @cindex bound-details property, example
2019 2018
2020 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 2019 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
2021 % Set details for later Text Spanner 2020 % Set details for later Text Spanner
2022 \override TextSpanner #'(bound-details left text) 2021 \override TextSpanner.bound-details.left.text
2023 = \markup { \small \bold Slower } 2022 = \markup { \small \bold Slower }
2024 % Place dynamics above staff 2023 % Place dynamics above staff
2025 \dynamicUp 2024 \dynamicUp
2026 % Start Ottava Bracket 2025 % Start Ottava Bracket
2027 \ottava #1 2026 \ottava #1
2028 c'4 \startTextSpan 2027 c'4 \startTextSpan
2029 % Add Dynamic Text and hairpin 2028 % Add Dynamic Text and hairpin
2030 c4\pp\< 2029 c4\pp\<
2031 c4 2030 c4
2032 % Add Text Script 2031 % Add Text Script
(...skipping 29 matching lines...) Expand all
2062 look up the priority of @code{OttavaBracket} in the IR or in the 2061 look up the priority of @code{OttavaBracket} in the IR or in the
2063 tables above, and reduce it to a value lower than that of a 2062 tables above, and reduce it to a value lower than that of a
2064 @code{TextSpanner}, remembering that @code{OttavaBracket} is created 2063 @code{TextSpanner}, remembering that @code{OttavaBracket} is created
2065 in the @code{Staff} context: 2064 in the @code{Staff} context:
2066 2065
2067 @cindex TextSpanner, example of overriding 2066 @cindex TextSpanner, example of overriding
2068 @cindex bound-details property, example 2067 @cindex bound-details property, example
2069 2068
2070 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 2069 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
2071 % Set details for later Text Spanner 2070 % Set details for later Text Spanner
2072 \override TextSpanner #'(bound-details left text) 2071 \override TextSpanner.bound-details.left.text
2073 = \markup { \small \bold Slower } 2072 = \markup { \small \bold Slower }
2074 % Place dynamics above staff 2073 % Place dynamics above staff
2075 \dynamicUp 2074 \dynamicUp
2076 % Place following Ottava Bracket below Text Spanners 2075 % Place following Ottava Bracket below Text Spanners
2077 \once \override Staff.OttavaBracket #'outside-staff-priority = #340 2076 \once \override Staff.OttavaBracket.outside-staff-priority = #340
2078 % Start Ottava Bracket 2077 % Start Ottava Bracket
2079 \ottava #1 2078 \ottava #1
2080 c'4 \startTextSpan 2079 c'4 \startTextSpan
2081 % Add Dynamic Text 2080 % Add Dynamic Text
2082 c4\pp 2081 c4\pp
2083 % Add Dynamic Line Spanner 2082 % Add Dynamic Line Spanner
2084 c4\< 2083 c4\<
2085 % Add Text Script 2084 % Add Text Script
2086 c4^Text | 2085 c4^Text |
2087 c4 c 2086 c4 c
(...skipping 22 matching lines...) Expand all
2110 inside the slur, but the @code{avoid-slur} property is effective 2109 inside the slur, but the @code{avoid-slur} property is effective
2111 only if the @code{outside-staff-priority} is also set to @code{#f}. 2110 only if the @code{outside-staff-priority} is also set to @code{#f}.
2112 Alternatively, the @code{outside-staff-priority} of the slur 2111 Alternatively, the @code{outside-staff-priority} of the slur
2113 can be set to a numerical value to cause it to be placed along with 2112 can be set to a numerical value to cause it to be placed along with
2114 other outside-staff objects according to that value. Here's an 2113 other outside-staff objects according to that value. Here's an
2115 example showing the effect of the two methods: 2114 example showing the effect of the two methods:
2116 2115
2117 @lilypond[quote,verbatim,relative=2] 2116 @lilypond[quote,verbatim,relative=2]
2118 c4( c^\markup { \tiny \sharp } d4.) c8 | 2117 c4( c^\markup { \tiny \sharp } d4.) c8 |
2119 c4( 2118 c4(
2120 \once \override TextScript #'avoid-slur = #'inside 2119 \once \override TextScript.avoid-slur = #'inside
2121 \once \override TextScript #'outside-staff-priority = ##f 2120 \once \override TextScript.outside-staff-priority = ##f
2122 c4^\markup { \tiny \sharp } d4.) c8 | 2121 c4^\markup { \tiny \sharp } d4.) c8 |
2123 \once \override Slur #'outside-staff-priority = #500 2122 \once \override Slur.outside-staff-priority = #500
2124 c4( c^\markup { \tiny \sharp } d4.) c8 | 2123 c4( c^\markup { \tiny \sharp } d4.) c8 |
2125 @end lilypond 2124 @end lilypond
2126 2125
2127 Changing the @code{outside-staff-priority} can also be used to 2126 Changing the @code{outside-staff-priority} can also be used to
2128 control the vertical placement of individual objects, although 2127 control the vertical placement of individual objects, although
2129 the results may not always be desirable. Suppose we would 2128 the results may not always be desirable. Suppose we would
2130 like @qq{Text3} to be placed above @qq{Text4} in the example 2129 like @qq{Text3} to be placed above @qq{Text4} in the example
2131 under Automatic behavior, above (see @ref{Automatic behavior}). 2130 under Automatic behavior, above (see @ref{Automatic behavior}).
2132 All we need to do is to look up the priority of @code{TextScript} 2131 All we need to do is to look up the priority of @code{TextScript}
2133 in the IR or in the tables above, and increase the priority of 2132 in the IR or in the tables above, and increase the priority of
2134 @qq{Text3} to a higher value: 2133 @qq{Text3} to a higher value:
2135 2134
2136 @cindex TextScript, example of overriding 2135 @cindex TextScript, example of overriding
2137 @cindex outside-staff-priority property, example 2136 @cindex outside-staff-priority property, example
2138 2137
2139 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2138 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2140 c2^"Text1" 2139 c2^"Text1"
2141 c2^"Text2" | 2140 c2^"Text2" |
2142 \once \override TextScript #'outside-staff-priority = #500 2141 \once \override TextScript.outside-staff-priority = #500
2143 c2^"Text3" 2142 c2^"Text3"
2144 c2^"Text4" | 2143 c2^"Text4" |
2145 @end lilypond 2144 @end lilypond
2146 2145
2147 This certainly lifts @qq{Text3} above @qq{Text4} but it also lifts it 2146 This certainly lifts @qq{Text3} above @qq{Text4} but it also lifts it
2148 above @qq{Text2}, and @qq{Text4} now drops down. Perhaps this is not 2147 above @qq{Text2}, and @qq{Text4} now drops down. Perhaps this is not
2149 so good. What we would really like to do is to position all the 2148 so good. What we would really like to do is to position all the
2150 annotation at the same distance above the staff. To do this, we 2149 annotation at the same distance above the staff. To do this, we
2151 clearly will need to space the notes out horizontally to make more 2150 clearly will need to space the notes out horizontally to make more
2152 room for the text. This is done using the @code{textLengthOn} 2151 room for the text. This is done using the @code{textLengthOn}
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2191 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2193 % This markup is short enough to fit without collision 2192 % This markup is short enough to fit without collision
2194 c2^"Tex" c'' | 2193 c2^"Tex" c'' |
2195 R1 | 2194 R1 |
2196 2195
2197 % This is too long to fit, so it is displaced upwards 2196 % This is too long to fit, so it is displaced upwards
2198 c,,2^"Text" c'' | 2197 c,,2^"Text" c'' |
2199 R1 | 2198 R1 |
2200 2199
2201 % Turn off collision avoidance 2200 % Turn off collision avoidance
2202 \once \override TextScript #'outside-staff-priority = ##f 2201 \once \override TextScript.outside-staff-priority = ##f
2203 c,,2^"Long Text " c'' | 2202 c,,2^"Long Text " c'' |
2204 R1 | 2203 R1 |
2205 2204
2206 % Turn off collision avoidance 2205 % Turn off collision avoidance
2207 \once \override TextScript #'outside-staff-priority = ##f 2206 \once \override TextScript.outside-staff-priority = ##f
2208 \textLengthOn % and turn on textLengthOn 2207 \textLengthOn % and turn on textLengthOn
2209 c,,2^"Long Text " % Spaces at end are honored 2208 c,,2^"Long Text " % Spaces at end are honored
2210 c''2 | 2209 c''2 |
2211 @end lilypond 2210 @end lilypond
2212 2211
2213 2212
2214 @subheading Dynamics 2213 @subheading Dynamics
2215 2214
2216 @cindex tweaking dynamics placement 2215 @cindex tweaking dynamics placement
2217 @cindex dynamics, tweaking placement 2216 @cindex dynamics, tweaking placement
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 that they may overlap in the horizontal direction. This is done 2274 that they may overlap in the horizontal direction. This is done
2276 by the trick of adding infinity to the leftmost extent and 2275 by the trick of adding infinity to the leftmost extent and
2277 minus infinity to the rightmost extent by setting the 2276 minus infinity to the rightmost extent by setting the
2278 @code{extra-spacing-width} to @code{'(+inf.0 . -inf.0)}. So 2277 @code{extra-spacing-width} to @code{'(+inf.0 . -inf.0)}. So
2279 to ensure they do not overlap in the horizontal direction we 2278 to ensure they do not overlap in the horizontal direction we
2280 must override this value of @code{extra-spacing-width} to 2279 must override this value of @code{extra-spacing-width} to
2281 @code{'(0 . 0)} so the true width shines through. This is 2280 @code{'(0 . 0)} so the true width shines through. This is
2282 the command to do this for dynamic text: 2281 the command to do this for dynamic text:
2283 2282
2284 @example 2283 @example
2285 \override DynamicText #'extra-spacing-width = #'(0 . 0) 2284 \override DynamicText.extra-spacing-width = #'(0 . 0)
2286 @end example 2285 @end example
2287 2286
2288 @noindent 2287 @noindent
2289 Let's see if this works in our previous example: 2288 Let's see if this works in our previous example:
2290 2289
2291 @cindex DynamicText, example of overriding 2290 @cindex DynamicText, example of overriding
2292 @cindex extra-spacing-width property, example 2291 @cindex extra-spacing-width property, example
2293 2292
2294 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2293 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2295 \dynamicUp 2294 \dynamicUp
2296 \override DynamicText #'extra-spacing-width = #'(0 . 0) 2295 \override DynamicText.extra-spacing-width = #'(0 . 0)
2297 a4\f b\mf c\mp b\p | 2296 a4\f b\mf c\mp b\p |
2298 @end lilypond 2297 @end lilypond
2299 2298
2300 @noindent 2299 @noindent
2301 Well, it has certainly stopped the dynamic marks being 2300 Well, it has certainly stopped the dynamic marks being
2302 displaced, but two problems remain. The marks should be 2301 displaced, but two problems remain. The marks should be
2303 spaced a little further apart and it would be better 2302 spaced a little further apart and it would be better
2304 if they were all the same distance from the staff. 2303 if they were all the same distance from the staff.
2305 We can solve the first problem easily. Instead of making 2304 We can solve the first problem easily. Instead of making
2306 the @code{extra-spacing-width} zero we could add a little 2305 the @code{extra-spacing-width} zero we could add a little
2307 more to it. The units are the space between two staff 2306 more to it. The units are the space between two staff
2308 lines, so moving the left edge half a unit to the left and the 2307 lines, so moving the left edge half a unit to the left and the
2309 right edge half a unit to the right should do it: 2308 right edge half a unit to the right should do it:
2310 2309
2311 @cindex DynamicText, example of overriding 2310 @cindex DynamicText, example of overriding
2312 @cindex extra-spacing-width property, example 2311 @cindex extra-spacing-width property, example
2313 2312
2314 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2313 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2315 \dynamicUp 2314 \dynamicUp
2316 % Extend width by 1 staff space 2315 % Extend width by 1 staff space
2317 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) 2316 \override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
2318 a4\f b\mf c\mp b\p 2317 a4\f b\mf c\mp b\p
2319 @end lilypond 2318 @end lilypond
2320 2319
2321 @noindent 2320 @noindent
2322 This looks better, but maybe we would prefer the dynamic marks 2321 This looks better, but maybe we would prefer the dynamic marks
2323 to be aligned along the same baseline rather than going up and 2322 to be aligned along the same baseline rather than going up and
2324 down with the notes. The property to do this is 2323 down with the notes. The property to do this is
2325 @code{staff-padding} which is covered in the following section. 2324 @code{staff-padding} which is covered in the following section.
2326 2325
2327 2326
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 2577
2579 The @code{padding} property can be set to increase 2578 The @code{padding} property can be set to increase
2580 (or decrease) the distance between symbols that are printed 2579 (or decrease) the distance between symbols that are printed
2581 above or below notes. 2580 above or below notes.
2582 2581
2583 @cindex Script, example of overriding 2582 @cindex Script, example of overriding
2584 @cindex padding property, example 2583 @cindex padding property, example
2585 2584
2586 @lilypond[quote,fragment,relative=1,verbatim] 2585 @lilypond[quote,fragment,relative=1,verbatim]
2587 c2\fermata 2586 c2\fermata
2588 \override Script #'padding = #3 2587 \override Script.padding = #3
2589 b2\fermata 2588 b2\fermata
2590 @end lilypond 2589 @end lilypond
2591 2590
2592 @cindex MetronomeMark, example of overriding 2591 @cindex MetronomeMark, example of overriding
2593 @cindex padding property, example 2592 @cindex padding property, example
2594 2593
2595 @lilypond[quote,fragment,relative=1,verbatim] 2594 @lilypond[quote,fragment,relative=1,verbatim]
2596 % This will not work, see below 2595 % This will not work, see below
2597 \override MetronomeMark #'padding = #3 2596 \override MetronomeMark.padding = #3
2598 \tempo 4 = 120 2597 \tempo 4 = 120
2599 c1 | 2598 c1 |
2600 % This works 2599 % This works
2601 \override Score.MetronomeMark #'padding = #3 2600 \override Score.MetronomeMark.padding = #3
2602 \tempo 4 = 80 2601 \tempo 4 = 80
2603 d1 | 2602 d1 |
2604 @end lilypond 2603 @end lilypond
2605 2604
2606 Note in the second example how important it is to figure out what 2605 Note in the second example how important it is to figure out what
2607 context handles a certain object. Since the @code{MetronomeMark} 2606 context handles a certain object. Since the @code{MetronomeMark}
2608 object is handled in the @code{Score} context, property changes in the 2607 object is handled in the @code{Score} context, property changes in the
2609 @code{Voice} context will not be noticed. For more details, see 2608 @code{Voice} context will not be noticed. For more details, see
2610 @ruser{Modifying properties}. 2609 @ruser{Modifying properties}.
2611 2610
(...skipping 18 matching lines...) Expand all
2630 @cindex text property, example 2629 @cindex text property, example
2631 @cindex stencil property, example 2630 @cindex stencil property, example
2632 @cindex AccidentalPlacement, example of overriding 2631 @cindex AccidentalPlacement, example of overriding
2633 @cindex right-padding property, example 2632 @cindex right-padding property, example
2634 2633
2635 @lilypond[quote,ragged-right,verbatim] 2634 @lilypond[quote,ragged-right,verbatim]
2636 sesquisharp = \markup { \sesquisharp } 2635 sesquisharp = \markup { \sesquisharp }
2637 \relative c'' { 2636 \relative c'' {
2638 c4 2637 c4
2639 % This prints a sesquisharp but the spacing is too small 2638 % This prints a sesquisharp but the spacing is too small
2640 \once \override Accidental 2639 \once \override Accidental.stencil = #ly:text-interface::print
2641 #'stencil = #ly:text-interface::print 2640 \once \override Accidental.text = #sesquisharp
2642 \once \override Accidental #'text = #sesquisharp
2643 cis4 c 2641 cis4 c
2644 % This improves the spacing 2642 % This improves the spacing
2645 \once \override Score.AccidentalPlacement #'right-padding = #0.6 2643 \once \override Score.AccidentalPlacement.right-padding = #0.6
2646 \once \override Accidental 2644 \once \override Accidental.stencil = #ly:text-interface::print
2647 #'stencil = #ly:text-interface::print 2645 \once \override Accidental.text = #sesquisharp
2648 \once \override Accidental #'text = #sesquisharp
2649 cis4 | 2646 cis4 |
2650 } 2647 }
2651 @end lilypond 2648 @end lilypond
2652 2649
2653 @noindent 2650 @noindent
2654 This necessarily uses an override for the accidental stencil which 2651 This necessarily uses an override for the accidental stencil which
2655 will not be covered until later. The stencil type must be a 2652 will not be covered until later. The stencil type must be a
2656 procedure, here changed to print the contents of the @code{text} 2653 procedure, here changed to print the contents of the @code{text}
2657 property of @code{Accidental}, which itself is set to be a 2654 property of @code{Accidental}, which itself is set to be a
2658 sesquisharp sign. This sign is then moved further away from the 2655 sesquisharp sign. This sign is then moved further away from the
(...skipping 16 matching lines...) Expand all
2675 example taken from the previous section: 2672 example taken from the previous section:
2676 2673
2677 @cindex DynamicText, example of overriding 2674 @cindex DynamicText, example of overriding
2678 @cindex extra-spacing-width property, example 2675 @cindex extra-spacing-width property, example
2679 @cindex DynamicLineSpanner, example of overriding 2676 @cindex DynamicLineSpanner, example of overriding
2680 @cindex staff-padding property, example 2677 @cindex staff-padding property, example
2681 2678
2682 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2679 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2683 \dynamicUp 2680 \dynamicUp
2684 % Extend width by 1 unit 2681 % Extend width by 1 unit
2685 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) 2682 \override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
2686 % Align dynamics to a base line 2 units above staff 2683 % Align dynamics to a base line 2 units above staff
2687 \override DynamicLineSpanner #'staff-padding = #2 2684 \override DynamicLineSpanner.staff-padding = #2
2688 a4\f b\mf c\mp b\p 2685 a4\f b\mf c\mp b\p
2689 @end lilypond 2686 @end lilypond
2690 2687
2691 2688
2692 @subheading self-alignment-X property 2689 @subheading self-alignment-X property
2693 2690
2694 The following example shows how this can resolve the collision 2691 The following example shows how this can resolve the collision
2695 of a string fingering object with a note's stem by aligning the 2692 of a string fingering object with a note's stem by aligning the
2696 right edge with the reference point of the parent note: 2693 right edge with the reference point of the parent note:
2697 2694
2698 @cindex StringNumber, example of overriding 2695 @cindex StringNumber, example of overriding
2699 @cindex self-alignment-X property, example 2696 @cindex self-alignment-X property, example
2700 2697
2701 @lilypond[quote,fragment,ragged-right,verbatim,relative=3] 2698 @lilypond[quote,fragment,ragged-right,verbatim,relative=3]
2702 \voiceOne 2699 \voiceOne
2703 <a\2> 2700 <a\2>
2704 \once \override StringNumber #'self-alignment-X = #RIGHT 2701 \once \override StringNumber.self-alignment-X = #RIGHT
2705 <a\2> 2702 <a\2>
2706 @end lilypond 2703 @end lilypond
2707 2704
2708 @subheading staff-position property 2705 @subheading staff-position property
2709 2706
2710 @cindex object collision within a staff 2707 @cindex object collision within a staff
2711 2708
2712 Multimeasure rests in one voice can collide with notes in another. 2709 Multimeasure rests in one voice can collide with notes in another.
2713 Since these rests are typeset centered between the bar lines, it 2710 Since these rests are typeset centered between the bar lines, it
2714 would require significant effort for LilyPond to figure out which 2711 would require significant effort for LilyPond to figure out which
(...skipping 12 matching lines...) Expand all
2727 @code{staff-position} is set to -4 for MultiMeasureRest, so we need to 2724 @code{staff-position} is set to -4 for MultiMeasureRest, so we need to
2728 move it, say, four half-staff spaces down to @w{@code{-8}}. 2725 move it, say, four half-staff spaces down to @w{@code{-8}}.
2729 2726
2730 @cindex MultiMeasureRest, example of overriding 2727 @cindex MultiMeasureRest, example of overriding
2731 @cindex staff-position property, example 2728 @cindex staff-position property, example
2732 2729
2733 @lilypond[quote,verbatim,fragment,ragged-right, relative=1] 2730 @lilypond[quote,verbatim,fragment,ragged-right, relative=1]
2734 << 2731 <<
2735 { c4 c c c } 2732 { c4 c c c }
2736 \\ 2733 \\
2737 \override MultiMeasureRest #'staff-position = #-8 2734 \override MultiMeasureRest.staff-position = #-8
2738 { R1 } 2735 { R1 }
2739 >> 2736 >>
2740 @end lilypond 2737 @end lilypond
2741 2738
2742 This is better than using, for example, @code{extra-offset}, 2739 This is better than using, for example, @code{extra-offset},
2743 because the ledger line above the rest is inserted automatically. 2740 because the ledger line above the rest is inserted automatically.
2744 2741
2745 @subheading extra-offset property 2742 @subheading extra-offset property
2746 2743
2747 @cindex positioning objects 2744 @cindex positioning objects
2748 @cindex positioning grobs 2745 @cindex positioning grobs
2749 @cindex objects, positioning 2746 @cindex objects, positioning
2750 @cindex grobs, positioning 2747 @cindex grobs, positioning
2751 2748
2752 The @code{extra-offset} property provides complete control over the 2749 The @code{extra-offset} property provides complete control over the
2753 positioning of an object both horizontally and vertically. 2750 positioning of an object both horizontally and vertically.
2754 2751
2755 In the following example, the second fingering is moved a little to 2752 In the following example, the second fingering is moved a little to
2756 the left, and 1.8 staff space downwards: 2753 the left, and 1.8 staff space downwards:
2757 2754
2758 @cindex Fingering, example of overriding 2755 @cindex Fingering, example of overriding
2759 @cindex extra-offset property, example 2756 @cindex extra-offset property, example
2760 2757
2761 @lilypond[quote,fragment,relative=1,verbatim] 2758 @lilypond[quote,fragment,relative=1,verbatim]
2762 \stemUp 2759 \stemUp
2763 f4-5 2760 f4-5
2764 \once \override Fingering #'extra-offset = #'(-0.3 . -1.8) 2761 \once \override Fingering.extra-offset = #'(-0.3 . -1.8)
2765 f4-5 2762 f4-5
2766 @end lilypond 2763 @end lilypond
2767 2764
2768 2765
2769 @subheading positions property 2766 @subheading positions property
2770 2767
2771 @cindex controlling tuplets, slurs, phrasing slurs, and beams manually 2768 @cindex controlling tuplets, slurs, phrasing slurs, and beams manually
2772 @cindex manually controlling tuplets, slurs, phrasing slurs, and beams 2769 @cindex manually controlling tuplets, slurs, phrasing slurs, and beams
2773 @cindex tuplet beams, controlling manually 2770 @cindex tuplet beams, controlling manually
2774 @cindex slurs, controlling manually 2771 @cindex slurs, controlling manually
(...skipping 23 matching lines...) Expand all
2798 But if there were some reason why this could not be done the 2795 But if there were some reason why this could not be done the
2799 other alternative would be to move the left end of the phrasing 2796 other alternative would be to move the left end of the phrasing
2800 slur down a little using the @code{positions} property. This 2797 slur down a little using the @code{positions} property. This
2801 also resolves the rather nasty shape. 2798 also resolves the rather nasty shape.
2802 2799
2803 @cindex PhrasingSlur, example of overriding 2800 @cindex PhrasingSlur, example of overriding
2804 @cindex positions property, example 2801 @cindex positions property, example
2805 2802
2806 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] 2803 @lilypond[quote,verbatim,fragment,ragged-right,relative=1]
2807 r4 2804 r4
2808 \once \override PhrasingSlur #'positions = #'(-4 . -3) 2805 \once \override PhrasingSlur.positions = #'(-4 . -3)
2809 \acciaccatura e8\( d8 c~ c d c d\) 2806 \acciaccatura e8\( d8 c~ c d c d\)
2810 @end lilypond 2807 @end lilypond
2811 2808
2812 Here's a further example. We see that the beams 2809 Here's a further example. We see that the beams
2813 collide with the ties: 2810 collide with the ties:
2814 2811
2815 @lilypond[quote,verbatim,fragment,ragged-right] 2812 @lilypond[quote,verbatim,fragment,ragged-right]
2816 { 2813 {
2817 \time 4/2 2814 \time 4/2
2818 << 2815 <<
(...skipping 17 matching lines...) Expand all
2836 @cindex Beam, example of overriding 2833 @cindex Beam, example of overriding
2837 @cindex positions property, example 2834 @cindex positions property, example
2838 2835
2839 @lilypond[quote,verbatim,fragment,ragged-right] 2836 @lilypond[quote,verbatim,fragment,ragged-right]
2840 { 2837 {
2841 \time 4/2 2838 \time 4/2
2842 << 2839 <<
2843 { c'1 ~ c'2. e'8 f' } 2840 { c'1 ~ c'2. e'8 f' }
2844 \\ 2841 \\
2845 { 2842 {
2846 \override Beam #'positions = #'(-1 . -1) 2843 \override Beam.positions = #'(-1 . -1)
2847 e''8 e'' e'' e'' e'' e'' e'' e'' f''2 g'' 2844 e''8 e'' e'' e'' e'' e'' e'' e'' f''2 g''
2848 } 2845 }
2849 >> 2846 >>
2850 << 2847 <<
2851 { c'1 ~ c'2. e'8 f' } 2848 { c'1 ~ c'2. e'8 f' }
2852 \\ 2849 \\
2853 { e''8 e'' e'' e'' e'' e'' e'' e'' f''2 g'' } 2850 { e''8 e'' e'' e'' e'' e'' e'' e'' f''2 g'' }
2854 >> 2851 >>
2855 } 2852 }
2856 @end lilypond 2853 @end lilypond
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2899 @cindex force-hshift property, example 2896 @cindex force-hshift property, example
2900 2897
2901 @lilypond[quote,verbatim,fragment,ragged-right] 2898 @lilypond[quote,verbatim,fragment,ragged-right]
2902 \new Staff \relative c'' { 2899 \new Staff \relative c'' {
2903 \key aes \major 2900 \key aes \major
2904 << 2901 <<
2905 { c2 aes4. bes8 } 2902 { c2 aes4. bes8 }
2906 \\ 2903 \\
2907 { 2904 {
2908 <ees, c>2 2905 <ees, c>2
2909 \once \override NoteColumn #'force-hshift = #0.5 2906 \once \override NoteColumn.force-hshift = #0.5
2910 des2 2907 des2
2911 } 2908 }
2912 \\ 2909 \\
2913 \\ 2910 \\
2914 { 2911 {
2915 \override NoteColumn #'force-hshift = #0 2912 \override NoteColumn.force-hshift = #0
2916 aes'2 f4 fes 2913 aes'2 f4 fes
2917 } 2914 }
2918 >> | 2915 >> |
2919 <c ees aes c>1 | 2916 <c ees aes c>1 |
2920 } 2917 }
2921 @end lilypond 2918 @end lilypond
2922 2919
2923 2920
2924 @node Real music example 2921 @node Real music example
2925 @subsection Real music example 2922 @subsection Real music example
(...skipping 12 matching lines...) Expand all
2938 over-complicating the example too much we have left out the 2935 over-complicating the example too much we have left out the
2939 dynamics, fingering and pedalling. 2936 dynamics, fingering and pedalling.
2940 2937
2941 @c The following should appear as music without code 2938 @c The following should appear as music without code
2942 @c This example should not be indexed 2939 @c This example should not be indexed
2943 @c line-width ensures no break 2940 @c line-width ensures no break
2944 @lilypond[quote,ragged-right,line-width=6\in] 2941 @lilypond[quote,ragged-right,line-width=6\in]
2945 rhMusic = \relative c'' { 2942 rhMusic = \relative c'' {
2946 \new Voice { 2943 \new Voice {
2947 r2 c4.\( g8 | 2944 r2 c4.\( g8 |
2948 \once \override Tie #'staff-position = #3.5 2945 \once \override Tie.staff-position = #3.5
2949 bes1~ | 2946 bes1~ |
2950 \bar "||" 2947 \bar "||"
2951 \time 6/4 2948 \time 6/4
2952 \mergeDifferentlyHeadedOn 2949 \mergeDifferentlyHeadedOn
2953 \mergeDifferentlyDottedOn 2950 \mergeDifferentlyDottedOn
2954 bes2.^\markup { \bold "Moderato" } r8 2951 bes2.^\markup { \bold "Moderato" } r8
2955 << 2952 <<
2956 { c,8 d fis bes a } 2953 { c,8 d fis bes a }
2957 \new Voice { 2954 \new Voice {
2958 \voiceTwo 2955 \voiceTwo
2959 c,8~ 2956 c,8~
2960 % Reposition the c2 to the right of the merged note 2957 % Reposition the c2 to the right of the merged note
2961 \once \override NoteColumn #'force-hshift = #1.0 2958 \once \override NoteColumn.force-hshift = #1.0
2962 % Move the c2 out of the main note column 2959 % Move the c2 out of the main note column
2963 % so the merge will work 2960 % so the merge will work
2964 \shiftOnn 2961 \shiftOnn
2965 c2 2962 c2
2966 } 2963 }
2967 \new Voice { 2964 \new Voice {
2968 \voiceThree 2965 \voiceThree
2969 s8 2966 s8
2970 % Stem on the d2 must be down to permit merging 2967 % Stem on the d2 must be down to permit merging
2971 \stemDown 2968 \stemDown
2972 % Stem on the d2 should be invisible 2969 % Stem on the d2 should be invisible
2973 \tweak Stem #'transparent ##t 2970 \tweak Stem.transparent ##t
2974 \tweak Flag #'transparent ##t 2971 \tweak Flag.transparent ##t
2975 d2 2972 d2
2976 } 2973 }
2977 \new Voice { 2974 \new Voice {
2978 \voiceFour 2975 \voiceFour
2979 s4 fis4. 2976 s4 fis4.
2980 } 2977 }
2981 >> | 2978 >> |
2982 \mergeDifferentlyHeadedOff 2979 \mergeDifferentlyHeadedOff
2983 \mergeDifferentlyDottedOff 2980 \mergeDifferentlyDottedOff
2984 g2.\) 2981 g2.\)
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3140 produced by the @code{\bar "||"} command. That's easily done. We 3137 produced by the @code{\bar "||"} command. That's easily done. We
3141 next need to correct the collision of the tie with the time signature. 3138 next need to correct the collision of the tie with the time signature.
3142 This is best done by moving the tie upwards. Moving objects was 3139 This is best done by moving the tie upwards. Moving objects was
3143 covered earlier in @ref{Moving objects}, which says that objects 3140 covered earlier in @ref{Moving objects}, which says that objects
3144 positioned relative to the staff can be moved vertically by overriding 3141 positioned relative to the staff can be moved vertically by overriding
3145 their @code{staff-position} property, which is specified in half staff 3142 their @code{staff-position} property, which is specified in half staff
3146 spaces relative to the center line of the staff. So the following 3143 spaces relative to the center line of the staff. So the following
3147 override placed just before the first tied note would move the tie up 3144 override placed just before the first tied note would move the tie up
3148 to 3.5 half staff spaces above the center line: 3145 to 3.5 half staff spaces above the center line:
3149 3146
3150 @code{\once \override Tie #'staff-position = #3.5} 3147 @code{\once \override Tie.staff-position = #3.5}
3151 3148
3152 This completes bar two, giving: 3149 This completes bar two, giving:
3153 3150
3154 @c line-width ensures no break 3151 @c line-width ensures no break
3155 @lilypond[quote,verbatim,ragged-right,line-width=6\in] 3152 @lilypond[quote,verbatim,ragged-right,line-width=6\in]
3156 rhMusic = \relative c'' { 3153 rhMusic = \relative c'' {
3157 \new Voice { 3154 \new Voice {
3158 r2 c4.\( g8 | 3155 r2 c4.\( g8 |
3159 \once \override Tie #'staff-position = #3.5 3156 \once \override Tie.staff-position = #3.5
3160 bes1~ | 3157 bes1~ |
3161 \bar "||" 3158 \bar "||"
3162 \time 6/4 3159 \time 6/4
3163 bes2. r8 3160 bes2. r8
3164 % Start polyphonic section of four voices 3161 % Start polyphonic section of four voices
3165 << 3162 <<
3166 { c,8 d fis bes a } % continuation of main voice 3163 { c,8 d fis bes a } % continuation of main voice
3167 \new Voice { 3164 \new Voice {
3168 \voiceTwo 3165 \voiceTwo
3169 c,8~ c2 3166 c,8~ c2
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 @end example 3225 @end example
3229 3226
3230 @noindent 3227 @noindent
3231 to the end, giving: 3228 to the end, giving:
3232 3229
3233 @c line-width ensures no break 3230 @c line-width ensures no break
3234 @lilypond[quote,ragged-right,line-width=6\in] 3231 @lilypond[quote,ragged-right,line-width=6\in]
3235 rhMusic = \relative c'' { 3232 rhMusic = \relative c'' {
3236 \new Voice { 3233 \new Voice {
3237 r2 c4.\( g8 | 3234 r2 c4.\( g8 |
3238 \once \override Tie #'staff-position = #3.5 3235 \once \override Tie.staff-position = #3.5
3239 bes1~ | 3236 bes1~ |
3240 \bar "||" 3237 \bar "||"
3241 \time 6/4 3238 \time 6/4
3242 bes2.^\markup { \bold "Moderato" } r8 3239 bes2.^\markup { \bold "Moderato" } r8
3243 \mergeDifferentlyHeadedOn 3240 \mergeDifferentlyHeadedOn
3244 \mergeDifferentlyDottedOn 3241 \mergeDifferentlyDottedOn
3245 % Start polyphonic section of four voices 3242 % Start polyphonic section of four voices
3246 << 3243 <<
3247 { c,8 d fis bes a } % continuation of main voice 3244 { c,8 d fis bes a } % continuation of main voice
3248 \new Voice { 3245 \new Voice {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 Applying these changes gives: 3299 Applying these changes gives:
3303 3300
3304 @cindex Tie, example of overriding 3301 @cindex Tie, example of overriding
3305 @cindex staff-position property, example 3302 @cindex staff-position property, example
3306 3303
3307 @c line-width ensures no break 3304 @c line-width ensures no break
3308 @lilypond[quote,verbatim,ragged-right,line-width=6\in] 3305 @lilypond[quote,verbatim,ragged-right,line-width=6\in]
3309 rhMusic = \relative c'' { 3306 rhMusic = \relative c'' {
3310 \new Voice { 3307 \new Voice {
3311 r2 c4.\( g8 | 3308 r2 c4.\( g8 |
3312 \once \override Tie #'staff-position = #3.5 3309 \once \override Tie.staff-position = #3.5
3313 bes1~ | 3310 bes1~ |
3314 \bar "||" 3311 \bar "||"
3315 \time 6/4 3312 \time 6/4
3316 bes2.^\markup { \bold "Moderato" } r8 3313 bes2.^\markup { \bold "Moderato" } r8
3317 \mergeDifferentlyHeadedOn 3314 \mergeDifferentlyHeadedOn
3318 \mergeDifferentlyDottedOn 3315 \mergeDifferentlyDottedOn
3319 % Start polyphonic section of four voices 3316 % Start polyphonic section of four voices
3320 << 3317 <<
3321 { c,8 d fis bes a } % continuation of main voice 3318 { c,8 d fis bes a } % continuation of main voice
3322 \new Voice { 3319 \new Voice {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 @cindex NoteColumn, example of overriding 3369 @cindex NoteColumn, example of overriding
3373 @cindex force-hshift property, example 3370 @cindex force-hshift property, example
3374 @cindex Stem, example of overriding 3371 @cindex Stem, example of overriding
3375 @cindex transparent property, example 3372 @cindex transparent property, example
3376 3373
3377 @c line-width ensures no break 3374 @c line-width ensures no break
3378 @lilypond[quote,verbatim,ragged-right,line-width=6\in] 3375 @lilypond[quote,verbatim,ragged-right,line-width=6\in]
3379 rhMusic = \relative c'' { 3376 rhMusic = \relative c'' {
3380 \new Voice { 3377 \new Voice {
3381 r2 c4.\( g8 | 3378 r2 c4.\( g8 |
3382 \once \override Tie #'staff-position = #3.5 3379 \once \override Tie.staff-position = #3.5
3383 bes1~ | 3380 bes1~ |
3384 \bar "||" 3381 \bar "||"
3385 \time 6/4 3382 \time 6/4
3386 bes2.^\markup { \bold "Moderato" } r8 3383 bes2.^\markup { \bold "Moderato" } r8
3387 \mergeDifferentlyHeadedOn 3384 \mergeDifferentlyHeadedOn
3388 \mergeDifferentlyDottedOn 3385 \mergeDifferentlyDottedOn
3389 % Start polyphonic section of four voices 3386 % Start polyphonic section of four voices
3390 << 3387 <<
3391 { c,8 d fis bes a } % continuation of main voice 3388 { c,8 d fis bes a } % continuation of main voice
3392 \new Voice { 3389 \new Voice {
3393 \voiceTwo 3390 \voiceTwo
3394 c,8~ 3391 c,8~
3395 % Reposition the c2 to the right of the merged note 3392 % Reposition the c2 to the right of the merged note
3396 \once \override NoteColumn #'force-hshift = #1.0 3393 \once \override NoteColumn.force-hshift = #1.0
3397 % Move the c2 out of the main note column 3394 % Move the c2 out of the main note column
3398 % so the merge will work 3395 % so the merge will work
3399 \shiftOnn 3396 \shiftOnn
3400 c2 3397 c2
3401 } 3398 }
3402 \new Voice { 3399 \new Voice {
3403 \voiceThree 3400 \voiceThree
3404 s8 3401 s8
3405 % Stem on the d2 must be down to permit merging 3402 % Stem on the d2 must be down to permit merging
3406 \stemDown 3403 \stemDown
3407 % Stem on the d2 should be invisible 3404 % Stem on the d2 should be invisible
3408 \tweak Stem #'transparent ##t 3405 \tweak Stem.transparent ##t
3409 \tweak Flag #'transparent ##t 3406 \tweak Flag.transparent ##t
3410 d2 3407 d2
3411 } 3408 }
3412 \new Voice { 3409 \new Voice {
3413 \voiceFour 3410 \voiceFour
3414 s4 fis4. 3411 s4 fis4.
3415 } 3412 }
3416 >> | 3413 >> |
3417 \mergeDifferentlyHeadedOff 3414 \mergeDifferentlyHeadedOff
3418 \mergeDifferentlyDottedOff 3415 \mergeDifferentlyDottedOff
3419 g2.\) % continuation of main voice 3416 g2.\) % continuation of main voice
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3481 @noindent 3478 @noindent
3482 and blanking the first up-stem in that voice, the tie appears to 3479 and blanking the first up-stem in that voice, the tie appears to
3483 cross voices: 3480 cross voices:
3484 3481
3485 @cindex Stem, example of overriding 3482 @cindex Stem, example of overriding
3486 @cindex transparent property, example 3483 @cindex transparent property, example
3487 3484
3488 @lilypond[quote,fragment,relative=2,verbatim] 3485 @lilypond[quote,fragment,relative=2,verbatim]
3489 << 3486 <<
3490 { 3487 {
3491 \tweak Stem #'transparent ##t 3488 \tweak Stem.transparent ##t
3492 \tweak Flag #'transparent ##t 3489 \tweak Flag.transparent ##t
3493 b8~ b\noBeam 3490 b8~ b\noBeam
3494 } 3491 }
3495 \\ 3492 \\
3496 { b8[ g] } 3493 { b8[ g] }
3497 >> 3494 >>
3498 @end lilypond 3495 @end lilypond
3499 3496
3500 To make sure that the just-blanked stem doesn't squeeze the tie 3497 To make sure that the just-blanked stem doesn't squeeze the tie
3501 too much, we can lengthen the stem by setting the 3498 too much, we can lengthen the stem by setting the
3502 @code{length} to @code{8}, 3499 @code{length} to @code{8},
3503 3500
3504 @lilypond[quote,fragment,relative=2,verbatim] 3501 @lilypond[quote,fragment,relative=2,verbatim]
3505 << 3502 <<
3506 { 3503 {
3507 \tweak Stem #'transparent ##t 3504 \tweak Stem.transparent ##t
3508 \tweak Flag #'transparent ##t 3505 \tweak Flag.transparent ##t
3509 \tweak Stem #'length #8 3506 \tweak Stem.length #8
3510 b8~ b\noBeam 3507 b8~ b\noBeam
3511 } 3508 }
3512 \\ 3509 \\
3513 { b8[ g] } 3510 { b8[ g] }
3514 >> 3511 >>
3515 @end lilypond 3512 @end lilypond
3516 3513
3517 @subheading Simulating a fermata in MIDI 3514 @subheading Simulating a fermata in MIDI
3518 3515
3519 @cindex stencil property, use of 3516 @cindex stencil property, use of
(...skipping 17 matching lines...) Expand all
3537 3534
3538 @cindex MetronomeMark, example of overriding 3535 @cindex MetronomeMark, example of overriding
3539 @cindex transparent property, example 3536 @cindex transparent property, example
3540 3537
3541 @lilypond[quote,verbatim,ragged-right] 3538 @lilypond[quote,verbatim,ragged-right]
3542 \score { 3539 \score {
3543 \relative c'' { 3540 \relative c'' {
3544 % Visible tempo marking 3541 % Visible tempo marking
3545 \tempo 4=120 3542 \tempo 4=120
3546 a4 a a 3543 a4 a a
3547 \once \override Score.MetronomeMark #'transparent = ##t 3544 \once \override Score.MetronomeMark.transparent = ##t
3548 % Invisible tempo marking to lengthen fermata in MIDI 3545 % Invisible tempo marking to lengthen fermata in MIDI
3549 \tempo 4=80 3546 \tempo 4=80
3550 a4\fermata | 3547 a4\fermata |
3551 % New tempo for next section 3548 % New tempo for next section
3552 \tempo 4=100 3549 \tempo 4=100
3553 a4 a a a | 3550 a4 a a a |
3554 } 3551 }
3555 \layout { } 3552 \layout { }
3556 \midi { } 3553 \midi { }
3557 } 3554 }
3558 @end lilypond 3555 @end lilypond
3559 3556
3560 @cindex MetronomeMark, example of overriding 3557 @cindex MetronomeMark, example of overriding
3561 @cindex stencil property, example 3558 @cindex stencil property, example
3562 3559
3563 @lilypond[quote,verbatim,ragged-right] 3560 @lilypond[quote,verbatim,ragged-right]
3564 \score { 3561 \score {
3565 \relative c'' { 3562 \relative c'' {
3566 % Visible tempo marking 3563 % Visible tempo marking
3567 \tempo 4=120 3564 \tempo 4=120
3568 a4 a a 3565 a4 a a
3569 \once \override Score.MetronomeMark #'stencil = ##f 3566 \once \override Score.MetronomeMark.stencil = ##f
3570 % Invisible tempo marking to lengthen fermata in MIDI 3567 % Invisible tempo marking to lengthen fermata in MIDI
3571 \tempo 4=80 3568 \tempo 4=80
3572 a4\fermata | 3569 a4\fermata |
3573 % New tempo for next section 3570 % New tempo for next section
3574 \tempo 4=100 3571 \tempo 4=100
3575 a4 a a a | 3572 a4 a a a |
3576 } 3573 }
3577 \layout { } 3574 \layout { }
3578 \midi { } 3575 \midi { }
3579 } 3576 }
(...skipping 23 matching lines...) Expand all
3603 3600
3604 Suppose we wish to emphasize certain words in lyrics by printing 3601 Suppose we wish to emphasize certain words in lyrics by printing
3605 them in bold italics. The @code{\italic} and @code{\bold} 3602 them in bold italics. The @code{\italic} and @code{\bold}
3606 commands only work within lyrics if they are embedded, together with 3603 commands only work within lyrics if they are embedded, together with
3607 the word or words to be modified, within a @code{\markup} block, 3604 the word or words to be modified, within a @code{\markup} block,
3608 which makes them tedious to enter. The need to embed the words 3605 which makes them tedious to enter. The need to embed the words
3609 themselves prevents their use in simple variables. As an 3606 themselves prevents their use in simple variables. As an
3610 alternative can we use @code{\override} and @code{\revert} commands? 3607 alternative can we use @code{\override} and @code{\revert} commands?
3611 3608
3612 @example 3609 @example
3613 @code{\override Lyrics . LyricText #'font-shape = #'italic} 3610 @code{\override Lyrics.LyricText.font-shape = #'italic}
3614 @code{\override Lyrics . LyricText #'font-series = #'bold} 3611 @code{\override Lyrics.LyricText.font-series = #'bold}
3615 3612
3616 @code{\revert Lyrics . LyricText #'font-shape} 3613 @code{\revert Lyrics.LyricText.font-shape}
3617 @code{\revert Lyrics . LyricText #'font-series} 3614 @code{\revert Lyrics.LyricText.font-series}
3618 @end example 3615 @end example
3619 3616
3620 These would also be extremely tedious to enter if there were many 3617 These would also be extremely tedious to enter if there were many
3621 words requiring emphasis. But we @emph{can} define these as two 3618 words requiring emphasis. But we @emph{can} define these as two
3622 variables and use those to bracket the words to be emphasized. 3619 variables and use those to bracket the words to be emphasized.
3623 Another advantage of using variables for these overrides is that 3620 Another advantage of using variables for these overrides is that
3624 the spaces around the dot are not necessary, since they are not 3621 the spaces around the dot are not necessary, since they are not
3625 being interpreted in @code{\lyricmode} directly. Here's an example 3622 being interpreted in @code{\lyricmode} directly. Here's an example
3626 of this, although in practice we would choose shorter names 3623 of this, although in practice we would choose shorter names
3627 for the variables to make them quicker to type: 3624 for the variables to make them quicker to type:
3628 3625
3629 @cindex LyricText, example of overriding 3626 @cindex LyricText, example of overriding
3630 @cindex font-shape property, example 3627 @cindex font-shape property, example
3631 @cindex font-series property, example 3628 @cindex font-series property, example
3632 3629
3633 @lilypond[quote,verbatim] 3630 @lilypond[quote,verbatim]
3634 emphasize = { 3631 emphasize = {
3635 \override Lyrics.LyricText #'font-shape = #'italic 3632 \override Lyrics.LyricText.font-shape = #'italic
3636 \override Lyrics.LyricText #'font-series = #'bold 3633 \override Lyrics.LyricText.font-series = #'bold
3637 } 3634 }
3638 3635
3639 normal = { 3636 normal = {
3640 \revert Lyrics.LyricText #'font-shape 3637 \revert Lyrics.LyricText.font-shape
3641 \revert Lyrics.LyricText #'font-series 3638 \revert Lyrics.LyricText.font-series
3642 } 3639 }
3643 3640
3644 global = { \key c \major \time 4/4 \partial 4 } 3641 global = { \key c \major \time 4/4 \partial 4 }
3645 3642
3646 SopranoMusic = \relative c' { c4 | e4. e8 g4 g | a4 a g } 3643 SopranoMusic = \relative c' { c4 | e4. e8 g4 g | a4 a g }
3647 AltoMusic = \relative c' { c4 | c4. c8 e4 e | f4 f e } 3644 AltoMusic = \relative c' { c4 | c4. c8 e4 e | f4 f e }
3648 TenorMusic = \relative c { e4 | g4. g8 c4. b8 | a8 b c d e4 } 3645 TenorMusic = \relative c { e4 | g4. g8 c4. b8 | a8 b c d e4 }
3649 BassMusic = \relative c { c4 | c4. c8 c4 c | f8 g a b c4 } 3646 BassMusic = \relative c { c4 | c4. c8 c4 c | f8 g a b c4 }
3650 3647
3651 VerseOne = \lyrics { 3648 VerseOne = \lyrics {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3815 3812
3816 inst = 3813 inst =
3817 #(define-music-function 3814 #(define-music-function
3818 (parser location string) 3815 (parser location string)
3819 (string?) 3816 (string?)
3820 #@{ ^\markup \bold \box #string #@}) 3817 #@{ ^\markup \bold \box #string #@})
3821 3818
3822 \layout@{ 3819 \layout@{
3823 \context @{ 3820 \context @{
3824 \Score 3821 \Score
3825 \override MetronomeMark #'extra-offset = #'(-9 . 0) 3822 \override MetronomeMark.extra-offset = #'(-9 . 0)
3826 \override MetronomeMark #'padding = #'3 3823 \override MetronomeMark.padding = #'3
3827 @} 3824 @}
3828 \context @{ 3825 \context @{
3829 \Staff 3826 \Staff
3830 \override TimeSignature #'style = #'numbered 3827 \override TimeSignature.style = #'numbered
3831 @} 3828 @}
3832 \context @{ 3829 \context @{
3833 \Voice 3830 \Voice
3834 \override Glissando #'thickness = #3 3831 \override Glissando.thickness = #3
3835 \override Glissando #'gap = #0.1 3832 \override Glissando.gap = #0.1
3836 @} 3833 @}
3837 @} 3834 @}
3838 @end example 3835 @end example
3839 3836
3840 @lilypond[quote,ragged-right] 3837 @lilypond[quote,ragged-right]
3841 mpdolce = 3838 mpdolce =
3842 #(make-dynamic-script 3839 #(make-dynamic-script
3843 #{ \markup { \hspace #0 3840 #{ \markup { \hspace #0
3844 \translate #'(5 . 0) 3841 \translate #'(5 . 0)
3845 \line { \dynamic "mp" 3842 \line { \dynamic "mp"
3846 \text \italic "dolce" } } 3843 \text \italic "dolce" } }
3847 #}) 3844 #})
3848 3845
3849 inst = 3846 inst =
3850 #(define-music-function 3847 #(define-music-function
3851 (parser location string) 3848 (parser location string)
3852 (string?) 3849 (string?)
3853 #{ ^\markup \bold \box #string #}) 3850 #{ ^\markup \bold \box #string #})
3854 3851
3855 \layout{ 3852 \layout{
3856 \context { 3853 \context {
3857 \Score 3854 \Score
3858 \override MetronomeMark #'extra-offset = #'(-9 . 0) 3855 \override MetronomeMark.extra-offset = #'(-9 . 0)
3859 \override MetronomeMark #'padding = #'3 3856 \override MetronomeMark.padding = #'3
3860 } 3857 }
3861 \context { 3858 \context {
3862 \Staff 3859 \Staff
3863 \override TimeSignature #'style = #'numbered 3860 \override TimeSignature.style = #'numbered
3864 } 3861 }
3865 \context { 3862 \context {
3866 \Voice 3863 \Voice
3867 \override Glissando #'thickness = #3 3864 \override Glissando.thickness = #3
3868 \override Glissando #'gap = #0.1 3865 \override Glissando.gap = #0.1
3869 } 3866 }
3870 } 3867 }
3871 3868
3872 \relative c'' { 3869 \relative c'' {
3873 \tempo 4=50 3870 \tempo 4=50
3874 a4.\mpdolce d8 cis4--\glissando a | 3871 a4.\mpdolce d8 cis4--\glissando a |
3875 b4 bes a2 | 3872 b4 bes a2 |
3876 \inst "Clarinet" 3873 \inst "Clarinet"
3877 cis4.\< d8 e4 fis | 3874 cis4.\< d8 e4 fis |
3878 g8(\! fis)-. e( d)-. cis2 | 3875 g8(\! fis)-. e( d)-. cis2 |
(...skipping 22 matching lines...) Expand all
3901 #(define-music-function 3898 #(define-music-function
3902 (parser location string) 3899 (parser location string)
3903 (string?) 3900 (string?)
3904 #@{ ^\markup \bold \box #string #@}) 3901 #@{ ^\markup \bold \box #string #@})
3905 3902
3906 #(set-global-staff-size 23) 3903 #(set-global-staff-size 23)
3907 3904
3908 \layout@{ 3905 \layout@{
3909 \context @{ 3906 \context @{
3910 \Score 3907 \Score
3911 \override MetronomeMark #'extra-offset = #'(-9 . 0) 3908 \override MetronomeMark.extra-offset = #'(-9 . 0)
3912 \override MetronomeMark #'padding = #'3 3909 \override MetronomeMark.padding = #'3
3913 @} 3910 @}
3914 \context @{ 3911 \context @{
3915 \Staff 3912 \Staff
3916 @} 3913 @}
3917 \context @{ 3914 \context @{
3918 \Voice 3915 \Voice
3919 \override Glissando #'thickness = #3 3916 \override Glissando.thickness = #3
3920 \override Glissando #'gap = #0.1 3917 \override Glissando.gap = #0.1
3921 @} 3918 @}
3922 @} 3919 @}
3923 @end example 3920 @end example
3924 3921
3925 @lilypond[quote,ragged-right] 3922 @lilypond[quote,ragged-right]
3926 mpdolce = 3923 mpdolce =
3927 #(make-dynamic-script 3924 #(make-dynamic-script
3928 #{ \markup { \hspace #0 3925 #{ \markup { \hspace #0
3929 \translate #'(5 . 0) 3926 \translate #'(5 . 0)
3930 \line { \dynamic "mp" 3927 \line { \dynamic "mp"
3931 \text \italic "dolce" } } 3928 \text \italic "dolce" } }
3932 #}) 3929 #})
3933 3930
3934 inst = 3931 inst =
3935 #(define-music-function 3932 #(define-music-function
3936 (parser location string) 3933 (parser location string)
3937 (string?) 3934 (string?)
3938 #{ ^\markup \bold \box #string #}) 3935 #{ ^\markup \bold \box #string #})
3939 3936
3940 #(set-global-staff-size 23) 3937 #(set-global-staff-size 23)
3941 3938
3942 \layout{ 3939 \layout{
3943 \context { \Score 3940 \context { \Score
3944 \override MetronomeMark #'extra-offset = #'(-9 . 0) 3941 \override MetronomeMark.extra-offset = #'(-9 . 0)
3945 \override MetronomeMark #'padding = #'3 3942 \override MetronomeMark.padding = #'3
3946 } 3943 }
3947 \context { \Voice 3944 \context { \Voice
3948 \override Glissando #'thickness = #3 3945 \override Glissando.thickness = #3
3949 \override Glissando #'gap = #0.1 3946 \override Glissando.gap = #0.1
3950 } 3947 }
3951 } 3948 }
3952 3949
3953 \relative c'' { 3950 \relative c'' {
3954 \tempo 4=50 3951 \tempo 4=50
3955 a4.\mpdolce d8 cis4--\glissando a | 3952 a4.\mpdolce d8 cis4--\glissando a |
3956 b4 bes a2 | 3953 b4 bes a2 |
3957 \inst "Clarinet" 3954 \inst "Clarinet"
3958 cis4.\< d8 e4 fis | 3955 cis4.\< d8 e4 fis |
3959 g8(\! fis)-. e( d)-. cis2 | 3956 g8(\! fis)-. e( d)-. cis2 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
4060 Open @file{ly/property-init.ly} in a text editor. The one 4057 Open @file{ly/property-init.ly} in a text editor. The one
4061 you normally use for @code{.ly} files will be fine. This file 4058 you normally use for @code{.ly} files will be fine. This file
4062 contains the definitions of all the standard LilyPond predefined 4059 contains the definitions of all the standard LilyPond predefined
4063 commands, such as @code{\stemUp} and @code{\slurDotted}. You will 4060 commands, such as @code{\stemUp} and @code{\slurDotted}. You will
4064 see that these are nothing more than definitions of variables 4061 see that these are nothing more than definitions of variables
4065 containing one or a group of @code{\override} commands. For 4062 containing one or a group of @code{\override} commands. For
4066 example, @code{/tieDotted} is defined to be: 4063 example, @code{/tieDotted} is defined to be:
4067 4064
4068 @example 4065 @example
4069 tieDotted = @{ 4066 tieDotted = @{
4070 \override Tie #'dash-period = #0.75 4067 \override Tie.dash-period = #0.75
4071 \override Tie #'dash-fraction = #0.1 4068 \override Tie.dash-fraction = #0.1
4072 @} 4069 @}
4073 @end example 4070 @end example
4074 4071
4075 If you do not like the default values these predefined commands can 4072 If you do not like the default values these predefined commands can
4076 be redefined easily, just like any other variable, at the 4073 be redefined easily, just like any other variable, at the
4077 head of your input file. 4074 head of your input file.
4078 4075
4079 The following are the most useful files to be found in 4076 The following are the most useful files to be found in
4080 @file{ly/}: 4077 @file{ly/}:
4081 4078
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
4162 ((2) (x11-color 'orange )) ; for D 4159 ((2) (x11-color 'orange )) ; for D
4163 ((3) (x11-color 'yellow )) ; for E 4160 ((3) (x11-color 'yellow )) ; for E
4164 ((4) (x11-color 'green )) ; for F 4161 ((4) (x11-color 'green )) ; for F
4165 ((5) (x11-color 'blue )) ; for G 4162 ((5) (x11-color 'blue )) ; for G
4166 ((6) (x11-color 'purple )) ; for A 4163 ((6) (x11-color 'purple )) ; for A
4167 ((0) (x11-color 'violet )) ; for B 4164 ((0) (x11-color 'violet )) ; for B
4168 ))) 4165 )))
4169 4166
4170 \relative c' { 4167 \relative c' {
4171 % Arrange to obtain color from color-notehead procedure 4168 % Arrange to obtain color from color-notehead procedure
4172 \override NoteHead #'color = #color-notehead 4169 \override NoteHead.color = #color-notehead
4173 a2 b | c2 d | e2 f | g2 a | 4170 a2 b | c2 d | e2 f | g2 a |
4174 } 4171 }
4175 @end lilypond 4172 @end lilypond
4176 4173
4177 Further examples showing the use of these programmable interfaces 4174 Further examples showing the use of these programmable interfaces
4178 can be found in @rextend{Callback functions}. 4175 can be found in @rextend{Callback functions}.
4179 4176
4180 4177
4181 4178
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b