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

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

Issue 1056041: Doc: LM: Reformat ly code. (Closed)
Left Patch Set: Created 13 years, 11 months ago
Right Patch Set: Make requested changes. Created 13 years, 10 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 These must always be present in exactly this form. This is the 223 These must always be present in exactly this form. This is the
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
Graham Percival (old account) 2010/05/02 16:01:33 Half notes might work better here.
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
247 Once overridden, the property retains its new value until it is 247 Once overridden, the property retains its new value until it is
(...skipping 11 matching lines...) Expand all
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 281 Both the @code{\override} and the @code{\set} commands may be
282 prefixed by @code{\once}. This causes the following 282 prefixed by @code{\once}. This causes the following
283 @code{\override} or @code{\set} command to be effective only 283 @code{\override} or @code{\set} command to be effective only
284 during the current musical moment before the property reverts 284 during the current musical moment before the property reverts
285 back to its default value. Using the same example, we can 285 back to its default value. Using the same example, we can
286 change the color of a single note like this: 286 change the color of a single note like this:
287 287
288 @cindex color property, example 288 @cindex color property, example
289 @cindex NoteHead, example of overriding 289 @cindex NoteHead, example of overriding
290 290
291 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 291 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
292 c4 d 292 c4 d
293 \once \override NoteHead #'color = #red 293 \once \override NoteHead #'color = #red
294 e4 f 294 e4 f |
295 \once \override NoteHead #'color = #green 295 \once \override NoteHead #'color = #green
296 g4 a b c 296 g4 a b c |
297 @end lilypond 297 @end lilypond
298 298
299 @strong{\overrideProperty command} 299 @strong{\overrideProperty command}
300 300
301 @cindex overrideProperty command 301 @cindex overrideProperty command
302 302
303 @funindex \overrideProperty 303 @funindex \overrideProperty
304 @funindex overrideProperty 304 @funindex overrideProperty
305 305
306 There is another form of the override command, 306 There is another form of the override command,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 \tweak #'@var{layout-property} #@var{value} 378 \tweak #'@var{layout-property} #@var{value}
379 @end example 379 @end example
380 380
381 A @code{\tweak} command can also be used to modify just one in 381 A @code{\tweak} command can also be used to modify just one in
382 a series of articulations, as shown here: 382 a series of articulations, as shown here:
383 383
384 @cindex color property, example 384 @cindex color property, example
385 @cindex @code{\tweak}, example 385 @cindex @code{\tweak}, example
386 386
387 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 387 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
388 a4^Black 388 a4^"Black"
389 -\tweak #'color #red ^Red 389 -\tweak #'color #red ^"Red"
390 -\tweak #'color #green _Green 390 -\tweak #'color #green _"Green"
391 @end lilypond 391 @end lilypond
392 392
393 @noindent 393 @noindent
394 Note that the @code{\tweak} command must be preceded by an 394 Note that the @code{\tweak} command must be preceded by an
395 articulation mark as if it were an articulation itself. 395 articulation mark as if it were an articulation itself.
396 396
397 @cindex tuplets, nested 397 @cindex tuplets, nested
398 @cindex triplets, nested 398 @cindex triplets, nested
399 @cindex bracket, tuplet 399 @cindex bracket, tuplet
400 @cindex bracket, triplet 400 @cindex bracket, triplet
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 Let's use a concrete example with a simple fragment of real 505 Let's use a concrete example with a simple fragment of real
506 music: 506 music:
507 507
508 @c Mozart, Die Zauberflöte Nr.7 Duett 508 @c Mozart, Die Zauberflöte Nr.7 Duett
509 509
510 @lilypond[quote,verbatim,relative=2] 510 @lilypond[quote,verbatim,relative=2]
511 { 511 {
512 \key es \major 512 \key es \major
513 \time 6/8 513 \time 6/8
514 { 514 {
515 r4 bes8 bes[( g]) g 515 r4 bes8 bes[( g]) g |
516 g8[( es]) es d[( f]) as 516 g8[( es]) es d[( f]) as |
517 as8 g 517 as8 g
518 } 518 }
519 \addlyrics { 519 \addlyrics {
520 The man who feels love's sweet e -- mo -- tion 520 The man who | feels love's sweet e -- | mo -- tion
521 } 521 }
522 } 522 }
523 @end lilypond 523 @end lilypond
524 524
525 Suppose now that we decide we would like the slurs to be a 525 Suppose now that we decide we would like the slurs to be a
526 little heavier. Is this possible? The slur is certainly a 526 little heavier. Is this possible? The slur is certainly a
527 layout object, so the question is, @q{Is there a property 527 layout object, so the question is, @q{Is there a property
528 belonging to a slur which controls the heaviness?} To answer 528 belonging to a slur which controls the heaviness?} To answer
529 this we must look in the Internals Reference, or IR for short. 529 this we must look in the Internals Reference, or IR for short.
530 530
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 @cindex Slur example of overriding 594 @cindex Slur example of overriding
595 @cindex thickness property, example 595 @cindex thickness property, example
596 596
597 @lilypond[quote,verbatim,relative=2] 597 @lilypond[quote,verbatim,relative=2]
598 { 598 {
599 \key es \major 599 \key es \major
600 \time 6/8 600 \time 6/8
601 { 601 {
602 % Increase thickness of all following slurs from 1.2 to 5.0 602 % Increase thickness of all following slurs from 1.2 to 5.0
603 \override Slur #'thickness = #5.0 603 \override Slur #'thickness = #5.0
604 r4 bes8 bes[( g]) g 604 r4 bes8 bes[( g]) g |
605 g8[( es]) es d[( f]) as 605 g8[( es]) es d[( f]) as |
606 as8 g 606 as8 g
607 } 607 }
608 \addlyrics { 608 \addlyrics {
609 The man who feels love's sweet e -- mo -- tion 609 The man who | feels love's sweet e -- | mo -- tion
610 } 610 }
611 } 611 }
612 @end lilypond 612 @end lilypond
613 613
614 @noindent 614 @noindent
615 and we see that the slur is indeed heavier. 615 and we see that the slur is indeed heavier.
616 616
617 So this is the basic way of constructing @code{\override} 617 So this is the basic way of constructing @code{\override}
618 commands. There are a few more complications that we 618 commands. There are a few more complications that we
619 shall meet in later sections, but you now know all the 619 shall meet in later sections, but you now know all the
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 @cindex thickness property, example 664 @cindex thickness property, example
665 665
666 @lilypond[quote,verbatim,relative=2] 666 @lilypond[quote,verbatim,relative=2]
667 { 667 {
668 \key es \major 668 \key es \major
669 \time 6/8 669 \time 6/8
670 { 670 {
671 r4 bes8 671 r4 bes8
672 % Increase thickness of immediately following slur only 672 % Increase thickness of immediately following slur only
673 \once \override Slur #'thickness = #5.0 673 \once \override Slur #'thickness = #5.0
674 bes8[( g]) g 674 bes8[( g]) g |
675 g8[( es]) es d[( f]) as 675 g8[( es]) es d[( f]) as |
676 as8 g 676 as8 g
677 } 677 }
678 \addlyrics { 678 \addlyrics {
679 The man who feels love's sweet e -- mo -- tion 679 The man who | feels love's sweet e -- | mo -- tion
680 } 680 }
681 } 681 }
682 @end lilypond 682 @end lilypond
683 683
684 @noindent 684 @noindent
685 Now only the first slur is made heavier. 685 Now only the first slur is made heavier.
686 686
687 The @code{\once} command can also be used before the @code{\set} 687 The @code{\once} command can also be used before the @code{\set}
688 command. 688 command.
689 689
(...skipping 14 matching lines...) Expand all
704 @cindex thickness property, example 704 @cindex thickness property, example
705 705
706 @lilypond[quote,verbatim,relative=2] 706 @lilypond[quote,verbatim,relative=2]
707 { 707 {
708 \key es \major 708 \key es \major
709 \time 6/8 709 \time 6/8
710 { 710 {
711 r4 bes8 711 r4 bes8
712 % Increase thickness of immediately following slur only 712 % Increase thickness of immediately following slur only
713 \once \override Slur #'thickness = #5.0 713 \once \override Slur #'thickness = #5.0
714 bes[( g]) g 714 bes[( g]) g |
715 % Increase thickness of immediately following slur only 715 % Increase thickness of immediately following slur only
716 \once \override Slur #'thickness = #5.0 716 \once \override Slur #'thickness = #5.0
717 g8[( es]) es d[( f]) as 717 g8[( es]) es d[( f]) as |
718 as8 g 718 as8 g
719 } 719 }
720 \addlyrics { 720 \addlyrics {
721 The man who feels love's sweet e -- mo -- tion 721 The man who | feels love's sweet e -- | mo -- tion
722 } 722 }
723 } 723 }
724 @end lilypond 724 @end lilypond
725 725
726 @noindent 726 @noindent
727 or we could omit the @code{\once} command and use the @code{\revert} 727 or we could omit the @code{\once} command and use the @code{\revert}
728 command to return the @code{thickness} property to its default value 728 command to return the @code{thickness} property to its default value
729 after the second slur: 729 after the second slur:
730 730
731 @cindex Slur, example of overriding 731 @cindex Slur, example of overriding
732 @cindex thickness property, example 732 @cindex thickness property, example
733 733
734 @lilypond[quote,verbatim,relative=2] 734 @lilypond[quote,verbatim,relative=2]
735 { 735 {
736 \key es \major 736 \key es \major
737 \time 6/8 737 \time 6/8
738 { 738 {
739 r4 bes8 739 r4 bes8
740 % Increase thickness of all following slurs from 1.2 to 5.0 740 % Increase thickness of all following slurs from 1.2 to 5.0
741 \override Slur #'thickness = #5.0 741 \override Slur #'thickness = #5.0
742 bes[( g]) g 742 bes[( g]) g |
743 g8[( es]) es 743 g8[( es]) es
744 % Revert thickness of all following slurs to default of 1.2 744 % Revert thickness of all following slurs to default of 1.2
745 \revert Slur #'thickness 745 \revert Slur #'thickness
746 d8[( f]) as 746 d8[( f]) as |
747 as8 g 747 as8 g
748 } 748 }
749 \addlyrics { 749 \addlyrics {
750 The man who feels love's sweet e -- mo -- tion 750 The man who | feels love's sweet e -- | mo -- tion
751 } 751 }
752 } 752 }
753 @end lilypond 753 @end lilypond
754 754
755 @noindent 755 @noindent
756 The @code{\revert} command can be used to return any property 756 The @code{\revert} command can be used to return any property
757 changed with @code{\override} back to its default value. 757 changed with @code{\override} back to its default value.
758 You may use whichever method best suits what you want to do. 758 You may use whichever method best suits what you want to do.
759 759
760 That concludes our introduction to the IR, and the basic 760 That concludes our introduction to the IR, and the basic
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 @cindex font-shape property, example 841 @cindex font-shape property, example
842 @cindex italic, example 842 @cindex italic, example
843 @cindex LyricText, example of overriding 843 @cindex LyricText, example of overriding
844 @cindex @code{\addlyrics}, example 844 @cindex @code{\addlyrics}, example
845 845
846 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 846 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
847 { 847 {
848 \key es \major 848 \key es \major
849 \time 6/8 849 \time 6/8
850 { 850 {
851 r4 bes8 bes[( g]) g 851 r4 bes8 bes[( g]) g |
852 g8[( es]) es d[( f]) as 852 g8[( es]) es d[( f]) as |
853 as8 g 853 as8 g
854 } 854 }
855 \addlyrics { 855 \addlyrics {
856 \override LyricText #'font-shape = #'italic 856 \override LyricText #'font-shape = #'italic
857 The man who feels love's sweet e -- mo -- tion 857 The man who | feels love's sweet e -- | mo -- tion
858 } 858 }
859 } 859 }
860 @end lilypond 860 @end lilypond
861 861
862 @noindent 862 @noindent
863 and the lyrics are all printed in italics. 863 and the lyrics are all printed in italics.
864 864
865 @subheading Specifying the context in lyric mode 865 @subheading Specifying the context in lyric mode
866 866
867 @cindex context, specifying in lyric mode 867 @cindex context, specifying in lyric mode
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 setting its value to @code{#f}. Let's try it, as before, omitting 1022 setting its value to @code{#f}. Let's try it, as before, omitting
1023 the implied Context, @code{Voice}: 1023 the implied Context, @code{Voice}:
1024 1024
1025 @cindex BarLine, example of overriding 1025 @cindex BarLine, example of overriding
1026 @cindex stencil property, example 1026 @cindex stencil property, example
1027 1027
1028 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1028 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1029 { 1029 {
1030 \time 12/16 1030 \time 12/16
1031 \override BarLine #'stencil = ##f 1031 \override BarLine #'stencil = ##f
1032 c4 b8 c d16 c d8 1032 c4 b8 c d16 c d8 |
1033 g,8 a16 b8 c d4 e16 1033 g,8 a16 b8 c d4 e16 |
1034 e8 1034 e8
1035 } 1035 }
1036 @end lilypond 1036 @end lilypond
1037 1037
1038 The bar lines are still printed. What is wrong? Go back to the IR 1038 The bar lines are still printed. What is wrong? Go back to the IR
1039 and look again at the page giving the properties of BarLine. At the 1039 and look again at the page giving the properties of BarLine. At the
1040 top of the page it says @qq{Barline objects are created by: 1040 top of the page it says @qq{Barline objects are created by:
1041 Bar_engraver}. Go to the @code{Bar_engraver} page. At the bottom it 1041 Bar_engraver}. Go to the @code{Bar_engraver} page. At the bottom it
1042 gives a list of Contexts in which the bar engraver operates. All of 1042 gives a list of Contexts in which the bar engraver operates. All of
1043 them are of the type @code{Staff}, so the reason the @code{\override} 1043 them are of the type @code{Staff}, so the reason the @code{\override}
1044 command failed to work as expected is because @code{Barline} is not in 1044 command failed to work as expected is because @code{Barline} is not in
1045 the default @code{Voice} context. If the context is specified 1045 the default @code{Voice} context. If the context is specified
1046 incorrectly, the command simply does not work. No error message is 1046 incorrectly, the command simply does not work. No error message is
1047 produced, and nothing is logged in the log file. Let's try correcting 1047 produced, and nothing is logged in the log file. Let's try correcting
1048 it by adding the correct context: 1048 it by adding the correct context:
1049 1049
1050 @cindex BarLine, example of overriding 1050 @cindex BarLine, example of overriding
1051 @cindex stencil property, example 1051 @cindex stencil property, example
1052 1052
1053 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1053 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1054 { 1054 {
1055 \time 12/16 1055 \time 12/16
1056 \override Staff.BarLine #'stencil = ##f 1056 \override Staff.BarLine #'stencil = ##f
1057 c4 b8 c d16 c d8 1057 c4 b8 c d16 c d8 |
1058 g,8 a16 b8 c d4 e16 1058 g,8 a16 b8 c d4 e16 |
1059 e8 1059 e8
1060 } 1060 }
1061 @end lilypond 1061 @end lilypond
1062 1062
1063 Now the bar lines have vanished. 1063 Now the bar lines have vanished.
1064 1064
1065 Note, though, that setting the @code{stencil} property to @code{#f} 1065 Note, though, that setting the @code{stencil} property to @code{#f}
1066 will cause errors when the dimensions of the object are required for 1066 will cause errors when the dimensions of the object are required for
1067 correct processing. For example, errors will be generated if the 1067 correct processing. For example, errors will be generated if the
1068 @code{stencil} property of the @code{NoteHead} object is set to 1068 @code{stencil} property of the @code{NoteHead} object is set to
(...skipping 25 matching lines...) Expand all
1094 required, as always, to precede the value itself in the 1094 required, as always, to precede the value itself in the
1095 @code{\override} command. 1095 @code{\override} command.
1096 1096
1097 @cindex BarLine, example of overriding 1097 @cindex BarLine, example of overriding
1098 @cindex break-visibility property, example 1098 @cindex break-visibility property, example
1099 1099
1100 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1100 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1101 { 1101 {
1102 \time 12/16 1102 \time 12/16
1103 \override Staff.BarLine #'break-visibility = #'#(#f #f #f) 1103 \override Staff.BarLine #'break-visibility = #'#(#f #f #f)
1104 c4 b8 c d16 c d8 1104 c4 b8 c d16 c d8 |
1105 g,8 a16 b8 c d4 e16 1105 g,8 a16 b8 c d4 e16 |
1106 e8 1106 e8
1107 } 1107 }
1108 @end lilypond 1108 @end lilypond
1109 1109
1110 And we see this too removes all the bar lines. 1110 And we see this too removes all the bar lines.
1111 1111
1112 @subheading transparent 1112 @subheading transparent
1113 1113
1114 @cindex transparent property 1114 @cindex transparent property
1115 @cindex transparency 1115 @cindex transparency
(...skipping 10 matching lines...) Expand all
1126 @code{grob-interface}. So the command to make the time signature 1126 @code{grob-interface}. So the command to make the time signature
1127 transparent is: 1127 transparent is:
1128 1128
1129 @cindex TimeSignature, example of overriding 1129 @cindex TimeSignature, example of overriding
1130 @cindex transparent property, example 1130 @cindex transparent property, example
1131 1131
1132 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1132 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1133 { 1133 {
1134 \time 12/16 1134 \time 12/16
1135 \override Staff.TimeSignature #'transparent = ##t 1135 \override Staff.TimeSignature #'transparent = ##t
1136 c4 b8 c d16 c d8 1136 c4 b8 c d16 c d8 |
1137 g,8 a16 b8 c d4 e16 1137 g,8 a16 b8 c d4 e16 |
1138 e8 1138 e8
1139 } 1139 }
1140 @end lilypond 1140 @end lilypond
1141 1141
1142 @noindent 1142 @noindent
1143 The time signature is gone, but this command leaves a gap where 1143 The time signature is gone, but this command leaves a gap where
1144 the time signature should be. Maybe this is what is wanted for 1144 the time signature should be. Maybe this is what is wanted for
1145 an exercise for the student to fill it in, but in other 1145 an exercise for the student to fill it in, but in other
1146 circumstances a gap might be undesirable. To remove it, the 1146 circumstances a gap might be undesirable. To remove it, the
1147 stencil for the time signature should be set to @code{#f} 1147 stencil for the time signature should be set to @code{#f}
1148 instead: 1148 instead:
1149 1149
1150 @cindex TimeSignature, example of overriding 1150 @cindex TimeSignature, example of overriding
1151 @cindex stencil property, example 1151 @cindex stencil property, example
1152 1152
1153 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1153 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1154 { 1154 {
1155 \time 12/16 1155 \time 12/16
1156 \override Staff.TimeSignature #'stencil = ##f 1156 \override Staff.TimeSignature #'stencil = ##f
1157 c4 b8 c d16 c d8 1157 c4 b8 c d16 c d8 |
1158 g,8 a16 b8 c d4 e16 1158 g,8 a16 b8 c d4 e16 |
1159 e8 1159 e8
1160 } 1160 }
1161 @end lilypond 1161 @end lilypond
1162 1162
1163 @noindent 1163 @noindent
1164 and the difference is obvious: setting the stencil to @code{#f} 1164 and the difference is obvious: setting the stencil to @code{#f}
1165 removes the object entirely; making the object @code{transparent} 1165 removes the object entirely; making the object @code{transparent}
1166 leaves it where it is, but makes it invisible. 1166 leaves it where it is, but makes it invisible.
1167 1167
1168 @subheading color 1168 @subheading color
(...skipping 19 matching lines...) Expand all
1188 @ruser{List of colors}. To set the bar lines to white 1188 @ruser{List of colors}. To set the bar lines to white
1189 we write: 1189 we write:
1190 1190
1191 @cindex BarLine, example of overriding 1191 @cindex BarLine, example of overriding
1192 @cindex color property, example 1192 @cindex color property, example
1193 1193
1194 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1194 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1195 { 1195 {
1196 \time 12/16 1196 \time 12/16
1197 \override Staff.BarLine #'color = #white 1197 \override Staff.BarLine #'color = #white
1198 c4 b8 c d16 c d8 1198 c4 b8 c d16 c d8 |
1199 g,8 a16 b8 c d4 e16 1199 g,8 a16 b8 c d4 e16 |
1200 e8 1200 e8
1201 } 1201 }
1202 @end lilypond 1202 @end lilypond
1203 1203
1204 @noindent 1204 @noindent
1205 and again, we see the bar lines are not visible. Note that 1205 and again, we see the bar lines are not visible. Note that
1206 @emph{white} is not preceded by an apostrophe -- it is not 1206 @emph{white} is not preceded by an apostrophe -- it is not
1207 a symbol, but a @emph{function}. When called, it provides 1207 a symbol, but a @emph{function}. When called, it provides
1208 the list of internal values required to set the color to 1208 the list of internal values required to set the color to
1209 white. The other colors in the normal list are functions 1209 white. The other colors in the normal list are functions
(...skipping 12 matching lines...) Expand all
1222 converts X11 color names into the list of internal values, 1222 converts X11 color names into the list of internal values,
1223 @code{x11-color}, like this: 1223 @code{x11-color}, like this:
1224 1224
1225 @cindex BarLine, example of overriding 1225 @cindex BarLine, example of overriding
1226 @cindex color property, example 1226 @cindex color property, example
1227 1227
1228 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1228 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1229 { 1229 {
1230 \time 12/16 1230 \time 12/16
1231 \override Staff.BarLine #'color = #(x11-color 'white) 1231 \override Staff.BarLine #'color = #(x11-color 'white)
1232 c4 b8 c d16 c d8 1232 c4 b8 c d16 c d8 |
1233 g,8 a16 b8 c d4 e16 1233 g,8 a16 b8 c d4 e16 |
1234 e8 1234 e8
1235 } 1235 }
1236 @end lilypond 1236 @end lilypond
1237 1237
1238 @noindent 1238 @noindent
1239 Note that in this case the function @code{x11-color} takes 1239 Note that in this case the function @code{x11-color} takes
1240 a symbol as an argument, so the symbol must be preceded by 1240 a symbol as an argument, so the symbol must be preceded by
1241 an apostrophe and the two enclosed in brackets. 1241 an apostrophe and the two enclosed in brackets.
1242 1242
1243 @cindex rgb colors 1243 @cindex rgb colors
1244 @cindex color, rgb 1244 @cindex color, rgb
1245 1245
1246 @funindex rgb-color 1246 @funindex rgb-color
1247 1247
1248 There is yet a third function, one which converts RGB values into 1248 There is yet a third function, one which converts RGB values into
1249 internal colors -- the @code{rgb-color} function. This takes 1249 internal colors -- the @code{rgb-color} function. This takes
1250 three arguments giving the intensities of the red, green and 1250 three arguments giving the intensities of the red, green and
1251 blue colors. These take values in the range 0 to 1. So to 1251 blue colors. These take values in the range 0 to 1. So to
1252 set the color to red the value should be @code{(rgb-color 1 0 0)} 1252 set the color to red the value should be @code{(rgb-color 1 0 0)}
1253 and to white it should be @code{(rgb-color 1 1 1)}: 1253 and to white it should be @code{(rgb-color 1 1 1)}:
1254 1254
1255 @cindex BarLine, example of overriding 1255 @cindex BarLine, example of overriding
1256 @cindex color property, example 1256 @cindex color property, example
1257 1257
1258 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1258 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1259 { 1259 {
1260 \time 12/16 1260 \time 12/16
1261 \override Staff.BarLine #'color = #(rgb-color 1 1 1) 1261 \override Staff.BarLine #'color = #(rgb-color 1 1 1)
1262 c4 b8 c d16 c d8 1262 c4 b8 c d16 c d8 |
1263 g,8 a16 b8 c d4 e16 1263 g,8 a16 b8 c d4 e16 |
1264 e8 1264 e8
1265 } 1265 }
1266 @end lilypond 1266 @end lilypond
1267 1267
1268 Finally, there is also a grey scale available as part of the 1268 Finally, there is also a grey scale available as part of the
1269 X11 set of colors. These range from black, @code{'grey0'}, 1269 X11 set of colors. These range from black, @code{'grey0'},
1270 to white, @code{'grey100}, in steps of 1. Let's illustrate 1270 to white, @code{'grey100}, in steps of 1. Let's illustrate
1271 this by setting all the layout objects in our example to 1271 this by setting all the layout objects in our example to
1272 various shades of grey: 1272 various shades of grey:
1273 1273
1274 @cindex StaffSymbol, example of overriding 1274 @cindex StaffSymbol, example of overriding
1275 @cindex TimeSignature, example of overriding 1275 @cindex TimeSignature, example of overriding
1276 @cindex Clef, example of overriding 1276 @cindex Clef, example of overriding
1277 @cindex NoteHead, example of overriding 1277 @cindex NoteHead, example of overriding
1278 @cindex Stem, example of overriding 1278 @cindex Stem, example of overriding
1279 @cindex BarLine, example of overriding 1279 @cindex BarLine, example of overriding
1280 @cindex color property, example 1280 @cindex color property, example
1281 @cindex x11-color, example of using 1281 @cindex x11-color, example of using
1282 1282
1283 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1283 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1284 { 1284 {
1285 \time 12/16 1285 \time 12/16
1286 \override Staff.StaffSymbol #'color = #(x11-color 'grey30) 1286 \override Staff.StaffSymbol #'color = #(x11-color 'grey30)
1287 \override Staff.TimeSignature #'color = #(x11-color 'grey60) 1287 \override Staff.TimeSignature #'color = #(x11-color 'grey60)
1288 \override Staff.Clef #'color = #(x11-color 'grey60) 1288 \override Staff.Clef #'color = #(x11-color 'grey60)
1289 \override Voice.NoteHead #'color = #(x11-color 'grey85) 1289 \override Voice.NoteHead #'color = #(x11-color 'grey85)
1290 \override Voice.Stem #'color = #(x11-color 'grey85) 1290 \override Voice.Stem #'color = #(x11-color 'grey85)
1291 \override Staff.BarLine #'color = #(x11-color 'grey10) 1291 \override Staff.BarLine #'color = #(x11-color 'grey10)
1292 c4 b8 c d16 c d8 1292 c4 b8 c d16 c d8 |
1293 g,8 a16 b8 c d4 e16 1293 g,8 a16 b8 c d4 e16 |
1294 e8 1294 e8
1295 } 1295 }
1296 @end lilypond 1296 @end lilypond
1297 1297
1298 @noindent 1298 @noindent
1299 Note the contexts associated with each of the layout objects. 1299 Note the contexts associated with each of the layout objects.
1300 It is important to get these right, or the commands will not 1300 It is important to get these right, or the commands will not
1301 work! Remember, the context is the one in which the appropriate 1301 work! Remember, the context is the one in which the appropriate
1302 engraver is placed. The default context for engravers can be 1302 engraver is placed. The default context for engravers can be
1303 found by starting from the layout object, going from there to 1303 found by starting from the layout object, going from there to
(...skipping 13 matching lines...) Expand all
1317 Let us begin by looking again at the earlier example 1317 Let us begin by looking again at the earlier example
1318 see @ref{Nesting music expressions}) which showed 1318 see @ref{Nesting music expressions}) which showed
1319 how to introduce a new temporary staff, as in an @rglos{ossia}. 1319 how to introduce a new temporary staff, as in an @rglos{ossia}.
1320 1320
1321 @cindex alignAboveContext property, example 1321 @cindex alignAboveContext property, example
1322 @cindex @code{\with}, example 1322 @cindex @code{\with}, example
1323 1323
1324 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1324 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1325 \new Staff ="main" { 1325 \new Staff ="main" {
1326 \relative g' { 1326 \relative g' {
1327 r4 g8 g c4 c8 d 1327 r4 g8 g c4 c8 d |
1328 e4 r8 1328 e4 r8
1329 << 1329 <<
1330 { f8 c c } 1330 { f8 c c }
1331 \new Staff \with { 1331 \new Staff \with {
1332 alignAboveContext = #"main" } 1332 alignAboveContext = #"main" }
1333 { f8 f c } 1333 { f8 f c }
1334 >> 1334 >>
1335 r4 1335 r4 |
1336 } 1336 }
1337 } 1337 }
1338 @end lilypond 1338 @end lilypond
1339 1339
1340 Ossia are normally written without clef and time signature, and 1340 Ossia are normally written without clef and time signature, and
1341 are usually printed slightly smaller than the main staff. We 1341 are usually printed slightly smaller than the main staff. We
1342 already know now how to remove the clef and time signature -- 1342 already know now how to remove the clef and time signature --
1343 we simply set the stencil of each to @code{#f}, as follows: 1343 we simply set the stencil of each to @code{#f}, as follows:
1344 1344
1345 @cindex alignAboveContext property, example 1345 @cindex alignAboveContext property, example
1346 @cindex @code{\with}, example 1346 @cindex @code{\with}, example
1347 @cindex stencil property, example 1347 @cindex stencil property, example
1348 @cindex Clef, example of overriding 1348 @cindex Clef, example of overriding
1349 @cindex TimeSignature, example of overriding 1349 @cindex TimeSignature, example of overriding
1350 1350
1351 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1351 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1352 \new Staff ="main" { 1352 \new Staff ="main" {
1353 \relative g' { 1353 \relative g' {
1354 r4 g8 g c4 c8 d 1354 r4 g8 g c4 c8 d |
1355 e4 r8 1355 e4 r8
1356 << 1356 <<
1357 { f8 c c } 1357 { f8 c c }
1358 \new Staff \with { 1358 \new Staff \with {
1359 alignAboveContext = #"main" 1359 alignAboveContext = #"main"
1360 } 1360 }
1361 { 1361 {
1362 \override Staff.Clef #'stencil = ##f 1362 \override Staff.Clef #'stencil = ##f
1363 \override Staff.TimeSignature #'stencil = ##f 1363 \override Staff.TimeSignature #'stencil = ##f
1364 { f8 f c } 1364 { f8 f c }
1365 } 1365 }
1366 >> 1366 >>
1367 r4 1367 r4 |
1368 } 1368 }
1369 } 1369 }
1370 @end lilypond 1370 @end lilypond
1371 1371
1372 @noindent 1372 @noindent
1373 where the extra pair of braces after the @code{\with} clause are 1373 where the extra pair of braces after the @code{\with} clause are
1374 required to ensure the enclosed overrides and music are applied 1374 required to ensure the enclosed overrides and music are applied
1375 to the ossia staff. 1375 to the ossia staff.
1376 1376
1377 But what is the difference between modifying the staff context by 1377 But what is the difference between modifying the staff context by
(...skipping 27 matching lines...) Expand all
1405 So we could replace the example above with 1405 So we could replace the example above with
1406 1406
1407 @cindex alignAboveContext property, example 1407 @cindex alignAboveContext property, example
1408 @cindex @code{\with}, example 1408 @cindex @code{\with}, example
1409 @cindex Clef, example of overriding 1409 @cindex Clef, example of overriding
1410 @cindex TimeSignature, example of overriding 1410 @cindex TimeSignature, example of overriding
1411 1411
1412 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1412 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1413 \new Staff ="main" { 1413 \new Staff ="main" {
1414 \relative g' { 1414 \relative g' {
1415 r4 g8 g c4 c8 d 1415 r4 g8 g c4 c8 d |
1416 e4 r8 1416 e4 r8
1417 << 1417 <<
1418 { f8 c c } 1418 { f8 c c }
1419 \new Staff \with { 1419 \new Staff \with {
1420 alignAboveContext = #"main" 1420 alignAboveContext = #"main"
1421 % Don't print clefs in this staff 1421 % Don't print clefs in this staff
1422 \override Clef #'stencil = ##f 1422 \override Clef #'stencil = ##f
1423 % Don't print time signatures in this staff 1423 % Don't print time signatures in this staff
1424 \override TimeSignature #'stencil = ##f 1424 \override TimeSignature #'stencil = ##f
1425 } 1425 }
1426 { f8 f c } 1426 { f8 f c }
1427 >> 1427 >>
1428 r4 1428 r4 |
1429 } 1429 }
1430 } 1430 }
1431 @end lilypond 1431 @end lilypond
1432 1432
1433 Finally we come to changing the size of layout objects. 1433 Finally we come to changing the size of layout objects.
1434 1434
1435 Some layout objects are created as glyphs selected from a typeface 1435 Some layout objects are created as glyphs selected from a typeface
1436 font. These include note heads, accidentals, markup, clefs, time 1436 font. These include note heads, accidentals, markup, clefs, time
1437 signatures, dynamics and lyrics. Their size is changed by modifying 1437 signatures, dynamics and lyrics. Their size is changed by modifying
1438 the @code{font-size} property, as we shall shortly see. Other layout 1438 the @code{font-size} property, as we shall shortly see. Other layout
(...skipping 30 matching lines...) Expand all
1469 1469
1470 @cindex alignAboveContext property, example 1470 @cindex alignAboveContext property, example
1471 @cindex @code{\with}, example 1471 @cindex @code{\with}, example
1472 @cindex Clef, example of overriding 1472 @cindex Clef, example of overriding
1473 @cindex TimeSignature, example of overriding 1473 @cindex TimeSignature, example of overriding
1474 @cindex fontSize property, example 1474 @cindex fontSize property, example
1475 1475
1476 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1476 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1477 \new Staff ="main" { 1477 \new Staff ="main" {
1478 \relative g' { 1478 \relative g' {
1479 r4 g8 g c4 c8 d 1479 r4 g8 g c4 c8 d |
1480 e4 r8 1480 e4 r8
1481 << 1481 <<
1482 { f8 c c } 1482 { f8 c c }
1483 \new Staff \with { 1483 \new Staff \with {
1484 alignAboveContext = #"main" 1484 alignAboveContext = #"main"
1485 \override Clef #'stencil = ##f 1485 \override Clef #'stencil = ##f
1486 \override TimeSignature #'stencil = ##f 1486 \override TimeSignature #'stencil = ##f
1487 % Reduce all font sizes by ~24% 1487 % Reduce all font sizes by ~24%
1488 fontSize = #-2 1488 fontSize = #-2
1489 } 1489 }
1490 { f8 f c } 1490 { f8 f c }
1491 >> 1491 >>
1492 r4 1492 r4 |
1493 } 1493 }
1494 } 1494 }
1495 @end lilypond 1495 @end lilypond
1496 1496
1497 This is still not quite right. The note heads and flags are 1497 This is still not quite right. The note heads and flags are
1498 smaller, but the stems are too long in proportion and the 1498 smaller, but the stems are too long in proportion and the
1499 staff lines are spaced too widely apart. These need to be 1499 staff lines are spaced too widely apart. These need to be
1500 scaled down in proportion to the font reduction. The next 1500 scaled down in proportion to the font reduction. The next
1501 sub-section discusses how this is done. 1501 sub-section discusses how this is done.
1502 1502
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 @cindex TimeSignature, example of overriding 1535 @cindex TimeSignature, example of overriding
1536 @cindex fontSize property, example 1536 @cindex fontSize property, example
1537 @cindex StaffSymbol, example of overriding 1537 @cindex StaffSymbol, example of overriding
1538 @cindex magstep function, example of using 1538 @cindex magstep function, example of using
1539 @cindex staff-space property, example 1539 @cindex staff-space property, example
1540 @cindex stencil property, example 1540 @cindex stencil property, example
1541 1541
1542 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1542 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1543 \new Staff ="main" { 1543 \new Staff ="main" {
1544 \relative g' { 1544 \relative g' {
1545 r4 g8 g c4 c8 d 1545 r4 g8 g c4 c8 d |
1546 e4 r8 1546 e4 r8
1547 << 1547 <<
1548 { f8 c c } 1548 { f8 c c }
1549 \new Staff \with { 1549 \new Staff \with {
1550 alignAboveContext = #"main" 1550 alignAboveContext = #"main"
1551 \override Clef #'stencil = ##f 1551 \override Clef #'stencil = ##f
1552 \override TimeSignature #'stencil = ##f 1552 \override TimeSignature #'stencil = ##f
1553 fontSize = #-2 1553 fontSize = #-2
1554 % Reduce stem length and line spacing to match 1554 % Reduce stem length and line spacing to match
1555 \override StaffSymbol #'staff-space = #(magstep -2) 1555 \override StaffSymbol #'staff-space = #(magstep -2)
1556 } 1556 }
1557 { f8 f c } 1557 { f8 f c }
1558 >> 1558 >>
1559 r4 1559 r4 |
1560 } 1560 }
1561 } 1561 }
1562 @end lilypond 1562 @end lilypond
1563 1563
1564 @noindent 1564 @noindent
1565 Since the length of stems and many other length-related properties are 1565 Since the length of stems and many other length-related properties are
1566 always calculated relative to the value of the @code{staff-space} 1566 always calculated relative to the value of the @code{staff-space}
1567 property these are automatically scaled down in length too. Note that 1567 property these are automatically scaled down in length too. Note that
1568 this affects only the vertical scale of the ossia -- the horizontal 1568 this affects only the vertical scale of the ossia -- the horizontal
1569 scale is determined by the layout of the main music in order to remain 1569 scale is determined by the layout of the main music in order to remain
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 placed closer to the staff. 1640 placed closer to the staff.
1641 1641
1642 In the following example all the markup texts have the same 1642 In the following example all the markup texts have the same
1643 priority (since it is not explicitly set). Note that @q{Text3} 1643 priority (since it is not explicitly set). Note that @q{Text3}
1644 is automatically positioned close to the staff again, nestling 1644 is automatically positioned close to the staff again, nestling
1645 under @q{Text2}. 1645 under @q{Text2}.
1646 1646
1647 @cindex markup example 1647 @cindex markup example
1648 1648
1649 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1649 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1650 c2^"Text1" c^"Text2" 1650 c2^"Text1"
1651 c2^"Text3" c^"Text4" 1651 c2^"Text2" |
1652 c2^"Text3"
1653 c2^"Text4" |
1652 @end lilypond 1654 @end lilypond
1653 1655
1654 Staves are also positioned, by default, as closely together as 1656 Staves are also positioned, by default, as closely together as
1655 possible (subject to a minimum separation). If notes project 1657 possible (subject to a minimum separation). If notes project
1656 a long way towards an adjacent staff they will force the 1658 a long way towards an adjacent staff they will force the
1657 staves further apart only if an overlap of the notation 1659 staves further apart only if an overlap of the notation
1658 would otherwise occur. The following example demonstrates 1660 would otherwise occur. The following example demonstrates
1659 this @q{nestling} of the notes on adjacent staves: 1661 this @q{nestling} of the notes on adjacent staves:
1660 1662
1661 @lilypond[quote,ragged-right,verbatim] 1663 @lilypond[quote,ragged-right,verbatim]
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 The following example shows in bar 1 the default behavior of stems, 1701 The following example shows in bar 1 the default behavior of stems,
1700 with those on high notes pointing down and those on low notes pointing 1702 with those on high notes pointing down and those on low notes pointing
1701 up, followed by four notes with all stems forced down, four notes with 1703 up, followed by four notes with all stems forced down, four notes with
1702 all stems forced up, and finally four notes reverted back to the 1704 all stems forced up, and finally four notes reverted back to the
1703 default behavior. 1705 default behavior.
1704 1706
1705 @cindex Stem, example of overriding 1707 @cindex Stem, example of overriding
1706 @cindex direction property, example 1708 @cindex direction property, example
1707 1709
1708 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 1710 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
1709 a4 g c a 1711 a4 g c a |
1710 \override Stem #'direction = #DOWN 1712 \override Stem #'direction = #DOWN
1711 a4 g c a 1713 a4 g c a |
1712 \override Stem #'direction = #UP 1714 \override Stem #'direction = #UP
1713 a4 g c a 1715 a4 g c a |
1714 \revert Stem #'direction 1716 \revert Stem #'direction
1715 a4 g c a 1717 a4 g c a |
1716 @end lilypond 1718 @end lilypond
1717 1719
1718 Here we use the constants @code{DOWN} and @code{UP}. 1720 Here we use the constants @code{DOWN} and @code{UP}.
1719 These have the values @code{-1} and @code{+1} respectively, and 1721 These have the values @code{-1} and @code{+1} respectively, and
1720 these numerical values may be used instead. The value @code{0} 1722 these numerical values may be used instead. The value @code{0}
1721 may also be used in some cases. It is simply treated as meaning 1723 may also be used in some cases. It is simply treated as meaning
1722 @code{UP} for stems, but for some objects it means @q{center}. 1724 @code{UP} for stems, but for some objects it means @q{center}.
1723 There is a constant, @code{CENTER} which has the value @code{0}. 1725 There is a constant, @code{CENTER} which has the value @code{0}.
1724 1726
1725 However, these explicit overrides are not usually used, as there are 1727 However, these explicit overrides are not usually used, as there are
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 1792
1791 First, here's the effect of @code{direction} on the fingering 1793 First, here's the effect of @code{direction} on the fingering
1792 attached to single notes. The first bar shows the default 1794 attached to single notes. The first bar shows the default
1793 behaviour, and the following two bars shows the effect of 1795 behaviour, and the following two bars shows the effect of
1794 specifying @code{DOWN} and @code{UP}: 1796 specifying @code{DOWN} and @code{UP}:
1795 1797
1796 @cindex Fingering, example of overriding 1798 @cindex Fingering, example of overriding
1797 @cindex direction property, example 1799 @cindex direction property, example
1798 1800
1799 @lilypond[quote,verbatim,relative=2] 1801 @lilypond[quote,verbatim,relative=2]
1800 c4-5 a-3 f-1 c'-5 1802 c4-5 a-3 f-1 c'-5 |
1801 \override Fingering #'direction = #DOWN 1803 \override Fingering #'direction = #DOWN
1802 c4-5 a-3 f-1 c'-5 1804 c4-5 a-3 f-1 c'-5 |
1803 \override Fingering #'direction = #UP 1805 \override Fingering #'direction = #UP
1804 c4-5 a-3 f-1 c'-5 1806 c4-5 a-3 f-1 c'-5 |
1805 @end lilypond 1807 @end lilypond
1806 1808
1807 However, overriding the @code{direction} property is not the 1809 However, overriding the @code{direction} property is not the
1808 easiest way of manually setting the fingering above or below 1810 easiest way of manually setting the fingering above or below
1809 the notes; using @code{_} or @code{^} instead of @code{-} before 1811 the notes; using @code{_} or @code{^} instead of @code{-} before
1810 the fingering number is usually preferable. Here is the previous 1812 the fingering number is usually preferable. Here is the previous
1811 example using this method: 1813 example using this method:
1812 1814
1813 @cindex fingering example 1815 @cindex fingering example
1814 1816
1815 @lilypond[quote,verbatim,relative=2] 1817 @lilypond[quote,verbatim,relative=2]
1816 c4-5 a-3 f-1 c'-5 1818 c4-5 a-3 f-1 c'-5 |
1817 c4_5 a_3 f_1 c'_5 1819 c4_5 a_3 f_1 c'_5 |
1818 c4^5 a^3 f^1 c'^5 1820 c4^5 a^3 f^1 c'^5 |
1819 @end lilypond 1821 @end lilypond
1820 1822
1821 The @code{direction} property is ignored for chords, but the 1823 The @code{direction} property is ignored for chords, but the
1822 directional prefixes, @code{_} and @code{^} do work. By default, 1824 directional prefixes, @code{_} and @code{^} do work. By default,
1823 the fingering is automatically placed both above and below the 1825 the fingering is automatically placed both above and below the
1824 notes of a chord, as shown: 1826 notes of a chord, as shown:
1825 1827
1826 @cindex fingering example 1828 @cindex fingering example
1827 1829
1828 @lilypond[quote,verbatim,relative=2] 1830 @lilypond[quote,verbatim,relative=2]
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 @cindex fingering example 1879 @cindex fingering example
1878 @cindex @code{\set}, example of using 1880 @cindex @code{\set}, example of using
1879 @cindex fingeringOrientations property, example 1881 @cindex fingeringOrientations property, example
1880 1882
1881 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 1883 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
1882 \set fingeringOrientations = #'(left) 1884 \set fingeringOrientations = #'(left)
1883 <f-2>4 1885 <f-2>4
1884 <c-1 e-2 g-3 b-5>4 1886 <c-1 e-2 g-3 b-5>4
1885 \set fingeringOrientations = #'(left) 1887 \set fingeringOrientations = #'(left)
1886 <f-2>4 1888 <f-2>4
1887 <c-1 e-2 g-3 b-5>4 1889 <c-1 e-2 g-3 b-5>4 |
1888 \set fingeringOrientations = #'(up left down) 1890 \set fingeringOrientations = #'(up left down)
1889 <f-2>4 1891 <f-2>4
1890 <c-1 e-2 g-3 b-5>4 1892 <c-1 e-2 g-3 b-5>4
1891 \set fingeringOrientations = #'(up left) 1893 \set fingeringOrientations = #'(up left)
1892 <f-2>4 1894 <f-2>4
1893 <c-1 e-2 g-3 b-5>4 1895 <c-1 e-2 g-3 b-5>4 |
1894 \set fingeringOrientations = #'(right) 1896 \set fingeringOrientations = #'(right)
1895 <f-2>4 1897 <f-2>4
1896 <c-1 e-2 g-3 b-5>4 1898 <c-1 e-2 g-3 b-5>4
1897 @end lilypond 1899 @end lilypond
1898 1900
1899 @noindent 1901 @noindent
1900 If the fingering seems a little crowded the @code{font-size} 1902 If the fingering seems a little crowded the @code{font-size}
1901 could be reduced. The default value can be seen from the 1903 could be reduced. The default value can be seen from the
1902 @code{Fingering} object in the IR to be @code{-5}, so let's 1904 @code{Fingering} object in the IR to be @code{-5}, so let's
1903 try @code{-7}: 1905 try @code{-7}:
1904 1906
1905 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 1907 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
1906 \override Fingering #'font-size = #-7 1908 \override Fingering #'font-size = #-7
1907 \set fingeringOrientations = #'(left) 1909 \set fingeringOrientations = #'(left)
1908 <f-2>4 1910 <f-2>4
1909 <c-1 e-2 g-3 b-5>4 1911 <c-1 e-2 g-3 b-5>4
1910 \set fingeringOrientations = #'(left) 1912 \set fingeringOrientations = #'(left)
1911 <f-2>4 1913 <f-2>4
1912 <c-1 e-2 g-3 b-5>4 1914 <c-1 e-2 g-3 b-5>4 |
1913 \set fingeringOrientations = #'(up left down) 1915 \set fingeringOrientations = #'(up left down)
1914 <f-2>4 1916 <f-2>4
1915 <c-1 e-2 g-3 b-5>4 1917 <c-1 e-2 g-3 b-5>4
1916 \set fingeringOrientations = #'(up left) 1918 \set fingeringOrientations = #'(up left)
1917 <f-2>4 1919 <f-2>4
1918 <c-1 e-2 g-3 b-5>4 1920 <c-1 e-2 g-3 b-5>4 |
1919 \set fingeringOrientations = #'(right) 1921 \set fingeringOrientations = #'(right)
1920 <f-2>4 1922 <f-2>4
1921 <c-1 e-2 g-3 b-5>4 1923 <c-1 e-2 g-3 b-5>4
1922 @end lilypond 1924 @end lilypond
1923 1925
1924 @node Outside-staff objects 1926 @node Outside-staff objects
1925 @subsection Outside-staff objects 1927 @subsection Outside-staff objects
1926 1928
1927 Outside-staff objects are automatically placed to avoid collisions. 1929 Outside-staff objects are automatically placed to avoid collisions.
1928 Objects with the lower value of the @code{outside-staff-priority} 1930 Objects with the lower value of the @code{outside-staff-priority}
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 = \markup { \small \bold Slower } 2000 = \markup { \small \bold Slower }
1999 % Place dynamics above staff 2001 % Place dynamics above staff
2000 \dynamicUp 2002 \dynamicUp
2001 % Start Ottava Bracket 2003 % Start Ottava Bracket
2002 \ottava #1 2004 \ottava #1
2003 c'4 \startTextSpan 2005 c'4 \startTextSpan
2004 % Add Dynamic Text and hairpin 2006 % Add Dynamic Text and hairpin
2005 c4\pp\< 2007 c4\pp\<
2006 c4 2008 c4
2007 % Add Text Script 2009 % Add Text Script
2008 c4^Text 2010 c4^Text |
2009 c4 c 2011 c4 c
2010 % Add Dynamic Text and terminate hairpin 2012 % Add Dynamic Text and terminate hairpin
2011 c4\ff c \stopTextSpan 2013 c4\ff c \stopTextSpan |
2012 % Stop Ottava Bracket 2014 % Stop Ottava Bracket
2013 \ottava #0 2015 \ottava #0
2014 c,4 c c c 2016 c,4 c c c |
2015 @end lilypond 2017 @end lilypond
2016 2018
2017 This example also shows how to create Text Spanners -- 2019 This example also shows how to create Text Spanners --
2018 text with extender lines above a section of music. The 2020 text with extender lines above a section of music. The
2019 spanner extends from the @code{\startTextSpan} command to 2021 spanner extends from the @code{\startTextSpan} command to
2020 the @code{\stopTextSpan} command, and the format of the 2022 the @code{\stopTextSpan} command, and the format of the
2021 text is defined by the @code{\override TextSpanner} command. 2023 text is defined by the @code{\override TextSpanner} command.
2022 For more details see @ruser{Text spanners}. 2024 For more details see @ruser{Text spanners}.
2023 2025
2024 It also shows how ottava brackets are created. 2026 It also shows how ottava brackets are created.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 % Place following Ottava Bracket below Text Spanners 2072 % Place following Ottava Bracket below Text Spanners
2071 \once \override Staff.OttavaBracket #'outside-staff-priority = #340 2073 \once \override Staff.OttavaBracket #'outside-staff-priority = #340
2072 % Start Ottava Bracket 2074 % Start Ottava Bracket
2073 \ottava #1 2075 \ottava #1
2074 c'4 \startTextSpan 2076 c'4 \startTextSpan
2075 % Add Dynamic Text 2077 % Add Dynamic Text
2076 c4\pp 2078 c4\pp
2077 % Add Dynamic Line Spanner 2079 % Add Dynamic Line Spanner
2078 c4\< 2080 c4\<
2079 % Add Text Script 2081 % Add Text Script
2080 c4^Text 2082 c4^Text |
2081 c4 c 2083 c4 c
2082 % Add Dynamic Text 2084 % Add Dynamic Text
2083 c4\ff c \stopTextSpan 2085 c4\ff c \stopTextSpan |
2084 % Stop Ottava Bracket 2086 % Stop Ottava Bracket
2085 \ottava #0 2087 \ottava #0
2086 c,4 c c c 2088 c,4 c c c |
2087 @end lilypond 2089 @end lilypond
2088 2090
2089 @cindex slurs and outside-staff-priority 2091 @cindex slurs and outside-staff-priority
2090 @cindex slurs and articulations 2092 @cindex slurs and articulations
2091 @cindex articulations and slurs 2093 @cindex articulations and slurs
2092 2094
2093 Slurs by default are classed as within-staff objects, but 2095 Slurs by default are classed as within-staff objects, but
2094 they often appear above the staff if the notes to 2096 they often appear above the staff if the notes to
2095 which they are attached are high on the staff. This can push 2097 which they are attached are high on the staff. This can push
2096 outside-staff objects such as articulations too high, as the slur 2098 outside-staff objects such as articulations too high, as the slur
2097 will be placed first. The @code{avoid-slur} property of the 2099 will be placed first. The @code{avoid-slur} property of the
2098 articulation can be set to @code{'inside} to bring the articulation 2100 articulation can be set to @code{'inside} to bring the articulation
2099 inside the slur, but the @code{avoid-slur} property is effective 2101 inside the slur, but the @code{avoid-slur} property is effective
2100 only if the @code{outside-staff-priority} is also set to @code{#f}. 2102 only if the @code{outside-staff-priority} is also set to @code{#f}.
2101 Alternatively, the @code{outside-staff-priority} of the slur 2103 Alternatively, the @code{outside-staff-priority} of the slur
2102 can be set to a numerical value to cause it to be placed along with 2104 can be set to a numerical value to cause it to be placed along with
2103 other outside-staff objects according to that value. Here's an 2105 other outside-staff objects according to that value. Here's an
2104 example showing the effect of the two methods: 2106 example showing the effect of the two methods:
2105 2107
2106 @lilypond[quote,verbatim,relative=2] 2108 @lilypond[quote,verbatim,relative=2]
2107 c4( c^\markup { \tiny \sharp } d4.) c8 2109 c4( c^\markup { \tiny \sharp } d4.) c8 |
2108 c4( 2110 c4(
2109 \once \override TextScript #'avoid-slur = #'inside 2111 \once \override TextScript #'avoid-slur = #'inside
2110 \once \override TextScript #'outside-staff-priority = ##f 2112 \once \override TextScript #'outside-staff-priority = ##f
2111 c4^\markup { \tiny \sharp } d4.) c8 2113 c4^\markup { \tiny \sharp } d4.) c8 |
2112 \once \override Slur #'outside-staff-priority = #500 2114 \once \override Slur #'outside-staff-priority = #500
2113 c4( c^\markup { \tiny \sharp } d4.) c8 2115 c4( c^\markup { \tiny \sharp } d4.) c8 |
2114 @end lilypond 2116 @end lilypond
2115 2117
2116 Changing the @code{outside-staff-priority} can also be used to 2118 Changing the @code{outside-staff-priority} can also be used to
2117 control the vertical placement of individual objects, although 2119 control the vertical placement of individual objects, although
2118 the results may not always be desirable. Suppose we would 2120 the results may not always be desirable. Suppose we would
2119 like @qq{Text3} to be placed above @qq{Text4} in the example 2121 like @qq{Text3} to be placed above @qq{Text4} in the example
2120 under Automatic behavior, above (see @ref{Automatic behavior}). 2122 under Automatic behavior, above (see @ref{Automatic behavior}).
2121 All we need to do is to look up the priority of @code{TextScript} 2123 All we need to do is to look up the priority of @code{TextScript}
2122 in the IR or in the tables above, and increase the priority of 2124 in the IR or in the tables above, and increase the priority of
2123 @qq{Text3} to a higher value: 2125 @qq{Text3} to a higher value:
2124 2126
2125 @cindex TextScript, example of overriding 2127 @cindex TextScript, example of overriding
2126 @cindex outside-staff-priority property, example 2128 @cindex outside-staff-priority property, example
2127 2129
2128 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2130 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2129 c2^"Text1" c^"Text2" 2131 c2^"Text1"
2132 c2^"Text2" |
2130 \once \override TextScript #'outside-staff-priority = #500 2133 \once \override TextScript #'outside-staff-priority = #500
2131 c2^"Text3" c^"Text4" 2134 c2^"Text3"
2135 c2^"Text4" |
2132 @end lilypond 2136 @end lilypond
2133 2137
2134 This certainly lifts @qq{Text3} above @qq{Text4} but it also lifts it 2138 This certainly lifts @qq{Text3} above @qq{Text4} but it also lifts it
2135 above @qq{Text2}, and @qq{Text4} now drops down. Perhaps this is not 2139 above @qq{Text2}, and @qq{Text4} now drops down. Perhaps this is not
2136 so good. What we would really like to do is to position all the 2140 so good. What we would really like to do is to position all the
2137 annotation at the same distance above the staff. To do this, we 2141 annotation at the same distance above the staff. To do this, we
2138 clearly will need to space the notes out horizontally to make more 2142 clearly will need to space the notes out horizontally to make more
2139 room for the text. This is done using the @code{textLengthOn} 2143 room for the text. This is done using the @code{textLengthOn}
2140 command. 2144 command.
2141 2145
2142 @subheading \textLengthOn 2146 @subheading \textLengthOn
2143 2147
2144 @cindex notes, spreading out with text 2148 @cindex notes, spreading out with text
2145 2149
2146 @funindex \textLengthOn 2150 @funindex \textLengthOn
2147 @funindex textLengthOn 2151 @funindex textLengthOn
2148 @funindex \textLengthOff 2152 @funindex \textLengthOff
2149 @funindex textLengthOff 2153 @funindex textLengthOff
2150 2154
2151 By default, text produced by markup takes up no horizontal space 2155 By default, text produced by markup takes up no horizontal space
2152 as far as laying out the music is concerned. The @code{\textLengthOn} 2156 as far as laying out the music is concerned. The @code{\textLengthOn}
2153 command reverses this behavior, causing the notes to be spaced 2157 command reverses this behavior, causing the notes to be spaced
2154 out as far as is necessary to accommodate the text: 2158 out as far as is necessary to accommodate the text:
2155 2159
2156 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2160 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2157 \textLengthOn % Cause notes to space out to accommodate text 2161 \textLengthOn % Cause notes to space out to accommodate text
2158 c2^"Text1" c^"Text2" 2162 c2^"Text1"
2159 c2^"Text3" c^"Text4" 2163 c2^"Text2" |
2164 c2^"Text3"
2165 c2^"Text4" |
2160 @end lilypond 2166 @end lilypond
2161 2167
2162 The command to revert to the default behavior is 2168 The command to revert to the default behavior is
2163 @code{\textLengthOff}. Remember @code{\once} only works with 2169 @code{\textLengthOff}. Remember @code{\once} only works with
2164 @code{\override}, @code{\set}, @code{\revert} or @code{unset}, 2170 @code{\override}, @code{\set}, @code{\revert} or @code{unset},
2165 so cannot be used with @code{\textLengthOn}. 2171 so cannot be used with @code{\textLengthOn}.
2166 2172
2167 @cindex markup text, allowing collisions 2173 @cindex markup text, allowing collisions
2168 2174
2169 Markup text will also avoid notes which project above the staff. 2175 Markup text will also avoid notes which project above the staff.
2170 If this is not desired, the automatic displacement upwards may 2176 If this is not desired, the automatic displacement upwards may
2171 be turned off by setting the priority to @code{#f}. Here's an 2177 be turned off by setting the priority to @code{#f}. Here's an
2172 example to show how markup text interacts with such notes. 2178 example to show how markup text interacts with such notes.
2173 2179
2174 @cindex TextScript, example of overriding 2180 @cindex TextScript, example of overriding
2175 @cindex outside-staff-priority property, example 2181 @cindex outside-staff-priority property, example
2176 2182
2177 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2183 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2178 % This markup is short enough to fit without collision 2184 % This markup is short enough to fit without collision
2179 c2^"Tex" c'' 2185 c2^"Tex" c'' |
2180 R1 2186 R1 |
2181 2187
2182 % This is too long to fit, so it is displaced upwards 2188 % This is too long to fit, so it is displaced upwards
2183 c,,2^"Text" c'' 2189 c,,2^"Text" c'' |
2184 R1 2190 R1 |
2185 2191
2186 % Turn off collision avoidance 2192 % Turn off collision avoidance
2187 \once \override TextScript #'outside-staff-priority = ##f 2193 \once \override TextScript #'outside-staff-priority = ##f
2188 c,,2^"Long Text " c'' 2194 c,,2^"Long Text " c'' |
2189 R1 2195 R1 |
2190 2196
2191 % Turn off collision avoidance 2197 % Turn off collision avoidance
2192 \once \override TextScript #'outside-staff-priority = ##f 2198 \once \override TextScript #'outside-staff-priority = ##f
2193 \textLengthOn % and turn on textLengthOn 2199 \textLengthOn % and turn on textLengthOn
2194 c,,2^"Long Text " % Spaces at end are honored 2200 c,,2^"Long Text " % Spaces at end are honored
2195 c''2 2201 c''2 |
2196 @end lilypond 2202 @end lilypond
2197 2203
2198 2204
2199 @subheading Dynamics 2205 @subheading Dynamics
2200 2206
2201 @cindex tweaking dynamics placement 2207 @cindex tweaking dynamics placement
2202 @cindex dynamics, tweaking placement 2208 @cindex dynamics, tweaking placement
2203 2209
2204 Dynamic markings will normally be positioned beneath the 2210 Dynamic markings will normally be positioned beneath the
2205 staff, but may be positioned above with the @code{dynamicUp} 2211 staff, but may be positioned above with the @code{dynamicUp}
2206 command. They will be positioned vertically relative to the 2212 command. They will be positioned vertically relative to the
2207 note to which they are attached, and will float below (or above) 2213 note to which they are attached, and will float below (or above)
2208 all within-staff objects such as phrasing slurs and bar numbers. 2214 all within-staff objects such as phrasing slurs and bar numbers.
2209 This can give quite acceptable results, as this example 2215 This can give quite acceptable results, as this example
2210 shows: 2216 shows:
2211 2217
2212 @lilypond[quote,fragment,ragged-right,verbatim,relative=1] 2218 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
2213 \clef bass 2219 \clef bass
2214 \key aes \major 2220 \key aes \major
2215 \time 9/8 2221 \time 9/8
2216 \dynamicUp 2222 \dynamicUp
2217 bes4.~\f\< \( bes4 bes8 des4\ff\> c16 bes\! 2223 bes4.~\f\< \( bes4 bes8 des4\ff\> c16 bes\! |
2218 ees,2.~\)\mf ees4 r8 2224 ees,2.~\)\mf ees4 r8 |
2219 @end lilypond 2225 @end lilypond
2220 2226
2221 However, if the notes and attached dynamics are close 2227 However, if the notes and attached dynamics are close
2222 together the automatic placement will avoid collisions 2228 together the automatic placement will avoid collisions
2223 by displacing later dynamic markings further away, but this may 2229 by displacing later dynamic markings further away, but this may
2224 not be the optimum placement, as this rather artificial example 2230 not be the optimum placement, as this rather artificial example
2225 shows: 2231 shows:
2226 2232
2227 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2233 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2228 \dynamicUp 2234 \dynamicUp
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 2278
2273 @noindent 2279 @noindent
2274 Let's see if this works in our previous example: 2280 Let's see if this works in our previous example:
2275 2281
2276 @cindex DynamicText, example of overriding 2282 @cindex DynamicText, example of overriding
2277 @cindex extra-spacing-width property, example 2283 @cindex extra-spacing-width property, example
2278 2284
2279 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] 2285 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
2280 \dynamicUp 2286 \dynamicUp
2281 \override DynamicText #'extra-spacing-width = #'(0 . 0) 2287 \override DynamicText #'extra-spacing-width = #'(0 . 0)
2282 a4\f b\mf c\mp b\p 2288 a4\f b\mf c\mp b\p |
2283 @end lilypond 2289 @end lilypond
2284 2290
2285 @noindent 2291 @noindent
2286 Well, it has certainly stopped the dynamic marks being 2292 Well, it has certainly stopped the dynamic marks being
2287 displaced, but two problems remain. The marks should be 2293 displaced, but two problems remain. The marks should be
2288 spaced a little further apart and it would be better 2294 spaced a little further apart and it would be better
2289 if they were all the same distance from the staff. 2295 if they were all the same distance from the staff.
2290 We can solve the first problem easily. Instead of making 2296 We can solve the first problem easily. Instead of making
2291 the @code{extra-spacing-width} zero we could add a little 2297 the @code{extra-spacing-width} zero we could add a little
2292 more to it. The units are the space between two staff 2298 more to it. The units are the space between two staff
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 b2\fermata 2583 b2\fermata
2578 @end lilypond 2584 @end lilypond
2579 2585
2580 @cindex MetronomeMark, example of overriding 2586 @cindex MetronomeMark, example of overriding
2581 @cindex padding property, example 2587 @cindex padding property, example
2582 2588
2583 @lilypond[quote,fragment,relative=1,verbatim] 2589 @lilypond[quote,fragment,relative=1,verbatim]
2584 % This will not work, see below 2590 % This will not work, see below
2585 \override MetronomeMark #'padding = #3 2591 \override MetronomeMark #'padding = #3
2586 \tempo 4=120 2592 \tempo 4=120
2587 c1 2593 c1 |
2588 % This works 2594 % This works
2589 \override Score.MetronomeMark #'padding = #3 2595 \override Score.MetronomeMark #'padding = #3
2590 \tempo 4=80 2596 \tempo 4=80
2591 d1 2597 d1 |
2592 @end lilypond 2598 @end lilypond
2593 2599
2594 Note in the second example how important it is to figure out what 2600 Note in the second example how important it is to figure out what
2595 context handles a certain object. Since the @code{MetronomeMark} 2601 context handles a certain object. Since the @code{MetronomeMark}
2596 object is handled in the @code{Score} context, property changes in the 2602 object is handled in the @code{Score} context, property changes in the
2597 @code{Voice} context will not be noticed. For more details, see 2603 @code{Voice} context will not be noticed. For more details, see
2598 @ruser{Modifying properties}. 2604 @ruser{Modifying properties}.
2599 2605
2600 If the @code{padding} property of an object is increased when that 2606 If the @code{padding} property of an object is increased when that
2601 object is in a stack of objects being positioned according to 2607 object is in a stack of objects being positioned according to
(...skipping 26 matching lines...) Expand all
2628 % This prints a sesquisharp but the spacing is too small 2634 % This prints a sesquisharp but the spacing is too small
2629 \once \override Accidental 2635 \once \override Accidental
2630 #'stencil = #ly:text-interface::print 2636 #'stencil = #ly:text-interface::print
2631 \once \override Accidental #'text = #sesquisharp 2637 \once \override Accidental #'text = #sesquisharp
2632 cis4 c 2638 cis4 c
2633 % This improves the spacing 2639 % This improves the spacing
2634 \once \override Score.AccidentalPlacement #'right-padding = #0.6 2640 \once \override Score.AccidentalPlacement #'right-padding = #0.6
2635 \once \override Accidental 2641 \once \override Accidental
2636 #'stencil = #ly:text-interface::print 2642 #'stencil = #ly:text-interface::print
2637 \once \override Accidental #'text = #sesquisharp 2643 \once \override Accidental #'text = #sesquisharp
2638 cis4 2644 cis4 |
2639 } 2645 }
2640 @end lilypond 2646 @end lilypond
2641 2647
2642 @noindent 2648 @noindent
2643 This necessarily uses an override for the accidental stencil which 2649 This necessarily uses an override for the accidental stencil which
2644 will not be covered until later. The stencil type must be a 2650 will not be covered until later. The stencil type must be a
2645 procedure, here changed to print the contents of the @code{text} 2651 procedure, here changed to print the contents of the @code{text}
2646 property of @code{Accidental}, which itself is set to be a 2652 property of @code{Accidental}, which itself is set to be a
2647 sesquisharp sign. This sign is then moved further away from the 2653 sesquisharp sign. This sign is then moved further away from the
2648 note head by overriding @code{right-padding}. 2654 note head by overriding @code{right-padding}.
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 \key aes \major 2853 \key aes \major
2848 << 2854 <<
2849 { c2 aes4. bes8 } 2855 { c2 aes4. bes8 }
2850 \\ 2856 \\
2851 { aes2 f4 fes } 2857 { aes2 f4 fes }
2852 \\ 2858 \\
2853 { 2859 {
2854 \voiceFour 2860 \voiceFour
2855 <ees c>2 des 2861 <ees c>2 des
2856 } 2862 }
2857 >> 2863 >> |
2858 <c ees aes c>1 2864 <c ees aes c>1 |
2859 } 2865 }
2860 @end lilypond 2866 @end lilypond
2861 2867
2862 @noindent 2868 @noindent
2863 The lower two notes of the first chord (i.e, those in the third voice) 2869 The lower two notes of the first chord (i.e, those in the third voice)
2864 should not be shifted away from the note column of the higher two 2870 should not be shifted away from the note column of the higher two
2865 notes. To correct this we set @code{force-hshift}, which is a 2871 notes. To correct this we set @code{force-hshift}, which is a
2866 property of @code{NoteColumn}, of these notes to zero. The lower note 2872 property of @code{NoteColumn}, of these notes to zero. The lower note
2867 of the second chord is best placed just to the right of the higher 2873 of the second chord is best placed just to the right of the higher
2868 notes. We achieve this by setting @code{force-hshift} of this note to 2874 notes. We achieve this by setting @code{force-hshift} of this note to
(...skipping 13 matching lines...) Expand all
2882 \\ 2888 \\
2883 { aes2 f4 fes } 2889 { aes2 f4 fes }
2884 \\ 2890 \\
2885 { 2891 {
2886 \voiceFour 2892 \voiceFour
2887 \once \override NoteColumn #'force-hshift = #0 2893 \once \override NoteColumn #'force-hshift = #0
2888 <ees c>2 2894 <ees c>2
2889 \once \override NoteColumn #'force-hshift = #0.5 2895 \once \override NoteColumn #'force-hshift = #0.5
2890 des2 2896 des2
2891 } 2897 }
2892 >> 2898 >> |
2893 <c ees aes c>1 2899 <c ees aes c>1 |
2894 } 2900 }
2895 @end lilypond 2901 @end lilypond
2896 2902
2897 2903
2898 @node Real music example 2904 @node Real music example
2899 @subsection Real music example 2905 @subsection Real music example
2900 2906
2901 We end this section on Tweaks by showing the steps to be taken to 2907 We end this section on Tweaks by showing the steps to be taken to
2902 deal with a tricky example which needs several tweaks to produce 2908 deal with a tricky example which needs several tweaks to produce
2903 the desired output. The example has been deliberately chosen to 2909 the desired output. The example has been deliberately chosen to
2904 illustrate the use of the Notation Reference to resolve unusual 2910 illustrate the use of the Notation Reference to resolve unusual
2905 problems with notation. It is not representative of more usual 2911 problems with notation. It is not representative of more usual
2906 engraving process, so please do not let these difficulties put 2912 engraving process, so please do not let these difficulties put
2907 you off! Fortunately, difficulties like these are not very common! 2913 you off! Fortunately, difficulties like these are not very common!
2908 2914
2909 The example is from Chopin's Première Ballade, Op. 23, bars 6 to 2915 The example is from Chopin's Première Ballade, Op. 23, bars 6 to
2910 9, the transition from the opening Lento to Moderato. 2916 9, the transition from the opening Lento to Moderato.
2911 Here, first, is what we want the output to look like, but to avoid 2917 Here, first, is what we want the output to look like, but to avoid
2912 over-complicating the example too much we have left out the 2918 over-complicating the example too much we have left out the
2913 dynamics, fingering and pedalling. 2919 dynamics, fingering and pedalling.
2914 2920
2915 @c The following should appear as music without code 2921 @c The following should appear as music without code
2916 @c This example should not be indexed 2922 @c This example should not be indexed
2917 @c line-width ensures no break 2923 @c line-width ensures no break
2918 @lilypond[quote,ragged-right,line-width=5.5\in] 2924 @lilypond[quote,ragged-right,line-width=5.5\in]
2919 rhMusic = \relative c'' { 2925 rhMusic = \relative c'' {
2920 r2 c4.\( g8 2926 r2 c4.\( g8 |
2921 \once \override Tie #'staff-position = #3.5 2927 \once \override Tie #'staff-position = #3.5
2922 bes1~ 2928 bes1~ |
2923 \bar "||" 2929 \bar "||"
2924 \time 6/4 2930 \time 6/4
2925 \mergeDifferentlyHeadedOn 2931 \mergeDifferentlyHeadedOn
2926 \mergeDifferentlyDottedOn 2932 \mergeDifferentlyDottedOn
2927 bes2.^\markup { \bold "Moderato" } r8 2933 bes2.^\markup { \bold "Moderato" } r8
2928 << 2934 <<
2929 { c,8 d fis bes a } 2935 { c,8 d fis bes a }
2930 \\ 2936 \\
2931 { 2937 {
2932 % Reposition the c2 to the right of the merged note 2938 % Reposition the c2 to the right of the merged note
2933 c,8~ \once \override NoteColumn #'force-hshift = #1.0 2939 c,8~ \once \override NoteColumn #'force-hshift = #1.0
2934 % Move the c2 out of the main note column so the merge will work 2940 % Move the c2 out of the main note column so the merge will work
2935 \shiftOnn c2 2941 \shiftOnn c2
2936 } 2942 }
2937 \\ 2943 \\
2938 { 2944 {
2939 % Stem on the d2 must be down to permit merging 2945 % Stem on the d2 must be down to permit merging
2940 s8 \stemDown 2946 s8 \stemDown
2941 \once \override Stem #'transparent = ##t 2947 \once \override Stem #'transparent = ##t
2942 d2 2948 d2
2943 } 2949 }
2944 \\ 2950 \\
2945 { s4 fis4. } 2951 { s4 fis4. }
2946 >> 2952 >> |
2947 \mergeDifferentlyHeadedOff 2953 \mergeDifferentlyHeadedOff
2948 \mergeDifferentlyDottedOff 2954 \mergeDifferentlyDottedOff
2949 g2.\) 2955 g2.\)
2950 } 2956 }
2951 2957
2952 lhMusic = \relative c' { 2958 lhMusic = \relative c' {
2953 r2 <c g ees>2( 2959 r2 <c g ees>2( |
2954 <d g, d>1)\arpeggio 2960 <d g, d>1)\arpeggio |
2955 r2. d,,4 r4 r 2961 r2. d,,4 r4 r |
2956 r4 2962 r4
2957 } 2963 }
2958 2964
2959 \score { 2965 \score {
2960 \new PianoStaff << 2966 \new PianoStaff <<
2961 \new Staff = "RH" << 2967 \new Staff = "RH" <<
2962 \key g \minor 2968 \key g \minor
2963 \rhMusic 2969 \rhMusic
2964 >> 2970 >>
2965 \new Staff = "LH" << 2971 \new Staff = "LH" <<
(...skipping 13 matching lines...) Expand all
2979 voice, so the easiest way is to introduce these four voices 2985 voice, so the easiest way is to introduce these four voices
2980 temporarily at the time they are needed. If you have forgotten 2986 temporarily at the time they are needed. If you have forgotten
2981 how to do this, look at @ref{I'm hearing Voices}. Let us begin 2987 how to do this, look at @ref{I'm hearing Voices}. Let us begin
2982 by entering the notes as two variables and setting up the staff 2988 by entering the notes as two variables and setting up the staff
2983 structure in a score block, and see what LilyPond produces by 2989 structure in a score block, and see what LilyPond produces by
2984 default: 2990 default:
2985 2991
2986 @c line-width ensures no break 2992 @c line-width ensures no break
2987 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in] 2993 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in]
2988 rhMusic = \relative c'' { 2994 rhMusic = \relative c'' {
2989 r2 c4. g8 2995 r2 c4. g8 |
2990 bes1~ 2996 bes1~ |
2991 \time 6/4 2997 \time 6/4
2992 bes2. r8 2998 bes2. r8
2993 % Start polyphonic section of four voices 2999 % Start polyphonic section of four voices
2994 << 3000 <<
2995 { c,8 d fis bes a } 3001 { c,8 d fis bes a }
2996 \\ 3002 \\
2997 { c,8~ c2 } 3003 { c,8~ c2 }
2998 \\ 3004 \\
2999 { s8 d2 } 3005 { s8 d2 }
3000 \\ 3006 \\
3001 { s4 fis4. } 3007 { s4 fis4. }
3002 >> 3008 >> |
3003 g2. 3009 g2. |
3004 } 3010 }
3005 3011
3006 lhMusic = \relative c' { 3012 lhMusic = \relative c' {
3007 r2 <c g ees>2 3013 r2 <c g ees>2 |
3008 <d g, d>1 3014 <d g, d>1 |
3009 r2. d,,4 r4 r 3015 r2. d,,4 r4 r |
3010 r4 3016 r4
3011 } 3017 }
3012 3018
3013 \score { 3019 \score {
3014 \new PianoStaff << 3020 \new PianoStaff <<
3015 \new Staff = "RH" << 3021 \new Staff = "RH" <<
3016 \key g \minor 3022 \key g \minor
3017 \rhMusic 3023 \rhMusic
3018 >> 3024 >>
3019 \new Staff = "LH" << 3025 \new Staff = "LH" <<
3020 \key g \minor 3026 \key g \minor
3021 \clef bass 3027 \clef bass
3022 \lhMusic 3028 \lhMusic
3023 >> 3029 >>
3024 >> 3030 >>
3025 } 3031 }
3026 @end lilypond 3032 @end lilypond
3027 3033
3028 All the notes are right, but the appearance is far from 3034 All the notes are right, but the appearance is far from
3029 satisfactory. The tie clashes with the change in time signature, 3035 satisfactory. The tie clashes with the change in time signature,
3030 the notes are not merged together, and several notation elements 3036 the notes are not merged together, and several notation elements
3031 are missing. Let's first deal with the easier things. We can 3037 are missing. Let's first deal with the easier things. We can
3032 easily add the left hand slur and the right hand phrasing slur, 3038 easily add the left hand slur and the right hand phrasing slur,
3033 since these were all covered in the Tutorial. Doing this gives: 3039 since these were all covered in the Tutorial. Doing this gives:
3034 3040
3035 @c line-width ensures no break 3041 @c line-width ensures no break
3036 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in] 3042 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in]
3037 rhMusic = \relative c'' { 3043 rhMusic = \relative c'' {
3038 r2 c4.\( g8 3044 r2 c4.\( g8 |
3039 bes1~ 3045 bes1~ |
3040 \time 6/4 3046 \time 6/4
3041 bes2. r8 3047 bes2. r8
3042 % Start polyphonic section of four voices 3048 % Start polyphonic section of four voices
3043 << 3049 <<
3044 { c,8 d fis bes a } 3050 { c,8 d fis bes a }
3045 \\ 3051 \\
3046 { c,8~ c2 } 3052 { c,8~ c2 }
3047 \\ 3053 \\
3048 { s8 d2 } 3054 { s8 d2 }
3049 \\ 3055 \\
3050 { s4 fis4. } 3056 { s4 fis4. }
3051 >> 3057 >> |
3052 g2.\) 3058 g2.\) |
3053 } 3059 }
3054 3060
3055 lhMusic = \relative c' { 3061 lhMusic = \relative c' {
3056 r2 <c g ees>2( 3062 r2 <c g ees>2( |
3057 <d g, d>1) 3063 <d g, d>1) |
3058 r2. d,,4 r4 r 3064 r2. d,,4 r4 r |
3059 r4 3065 r4
3060 } 3066 }
3061 3067
3062 \score { 3068 \score {
3063 \new PianoStaff << 3069 \new PianoStaff <<
3064 \new Staff = "RH" << 3070 \new Staff = "RH" <<
3065 \key g \minor 3071 \key g \minor
3066 \rhMusic 3072 \rhMusic
3067 >> 3073 >>
3068 \new Staff = "LH" << 3074 \new Staff = "LH" <<
(...skipping 21 matching lines...) Expand all
3090 override placed just before the first tied note would move the tie up 3096 override placed just before the first tied note would move the tie up
3091 to 3.5 half staff spaces above the center line: 3097 to 3.5 half staff spaces above the center line:
3092 3098
3093 @code{\once \override Tie #'staff-position = #3.5} 3099 @code{\once \override Tie #'staff-position = #3.5}
3094 3100
3095 This completes bar two, giving: 3101 This completes bar two, giving:
3096 3102
3097 @c line-width ensures no break 3103 @c line-width ensures no break
3098 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in] 3104 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in]
3099 rhMusic = \relative c'' { 3105 rhMusic = \relative c'' {
3100 r2 c4.\( g8 3106 r2 c4.\( g8 |
3101 \once \override Tie #'staff-position = #3.5 3107 \once \override Tie #'staff-position = #3.5
3102 bes1~ 3108 bes1~ |
3103 \bar "||" 3109 \bar "||"
3104 \time 6/4 3110 \time 6/4
3105 bes2. r8 3111 bes2. r8
3106 % Start polyphonic section of four voices 3112 % Start polyphonic section of four voices
3107 << 3113 <<
3108 { c,8 d fis bes a } 3114 { c,8 d fis bes a }
3109 \\ 3115 \\
3110 { c,8~ c2 } 3116 { c,8~ c2 }
3111 \\ 3117 \\
3112 { s8 d2 } 3118 { s8 d2 }
3113 \\ 3119 \\
3114 { s4 fis4. } 3120 { s4 fis4. }
3115 >> 3121 >> |
3116 g2.\) 3122 g2.\) |
3117 } 3123 }
3118 3124
3119 lhMusic = \relative c' { 3125 lhMusic = \relative c' {
3120 r2 <c g ees>2( 3126 r2 <c g ees>2( |
3121 <d g, d>1)\arpeggio 3127 <d g, d>1)\arpeggio |
3122 r2. d,,4 r4 r 3128 r2. d,,4 r4 r |
3123 r4 3129 r4
3124 } 3130 }
3125 3131
3126 \score { 3132 \score {
3127 \new PianoStaff << 3133 \new PianoStaff <<
3128 \new Staff = "RH" << 3134 \new Staff = "RH" <<
3129 \key g \minor 3135 \key g \minor
3130 \rhMusic 3136 \rhMusic
3131 >> 3137 >>
3132 \new Staff = "LH" << 3138 \new Staff = "LH" <<
(...skipping 28 matching lines...) Expand all
3161 \mergeDifferentlyHeadedOff 3167 \mergeDifferentlyHeadedOff
3162 \mergeDifferentlyDottedOff 3168 \mergeDifferentlyDottedOff
3163 @end example 3169 @end example
3164 3170
3165 @noindent 3171 @noindent
3166 to the end, giving: 3172 to the end, giving:
3167 3173
3168 @c line-width ensures no break 3174 @c line-width ensures no break
3169 @lilypond[quote,ragged-right,line-width=5.5\in] 3175 @lilypond[quote,ragged-right,line-width=5.5\in]
3170 rhMusic = \relative c'' { 3176 rhMusic = \relative c'' {
3171 r2 c4.\( g8 3177 r2 c4.\( g8 |
3172 \once \override Tie #'staff-position = #3.5 3178 \once \override Tie #'staff-position = #3.5
3173 bes1~ 3179 bes1~ |
3174 \bar "||" 3180 \bar "||"
3175 \time 6/4 3181 \time 6/4
3176 bes2.^\markup { \bold "Moderato" } r8 3182 bes2.^\markup { \bold "Moderato" } r8
3177 \mergeDifferentlyHeadedOn 3183 \mergeDifferentlyHeadedOn
3178 \mergeDifferentlyDottedOn 3184 \mergeDifferentlyDottedOn
3179 % Start polyphonic section of four voices 3185 % Start polyphonic section of four voices
3180 << 3186 <<
3181 { c,8 d fis bes a } 3187 { c,8 d fis bes a }
3182 \\ 3188 \\
3183 { c,8~ c2 } 3189 { c,8~ c2 }
3184 \\ 3190 \\
3185 { s8 d2 } 3191 { s8 d2 }
3186 \\ 3192 \\
3187 { s4 fis4. } 3193 { s4 fis4. }
3188 >> 3194 >> |
3189 \mergeDifferentlyHeadedOff 3195 \mergeDifferentlyHeadedOff
3190 \mergeDifferentlyDottedOff 3196 \mergeDifferentlyDottedOff
3191 g2.\) 3197 g2.\) |
3192 } 3198 }
3193 3199
3194 lhMusic = \relative c' { 3200 lhMusic = \relative c' {
3195 r2 <c g ees>2( 3201 r2 <c g ees>2( |
3196 <d g, d>1)\arpeggio 3202 <d g, d>1)\arpeggio |
3197 r2. d,,4 r4 r 3203 r2. d,,4 r4 r |
3198 r4 3204 r4
3199 } 3205 }
3200 3206
3201 \score { 3207 \score {
3202 \new PianoStaff << 3208 \new PianoStaff <<
3203 \new Staff = "RH" << 3209 \new Staff = "RH" <<
3204 \key g \minor 3210 \key g \minor
3205 \rhMusic 3211 \rhMusic
3206 >> 3212 >>
3207 \new Staff = "LH" << 3213 \new Staff = "LH" <<
(...skipping 19 matching lines...) Expand all
3227 respectively. So we have to shift the C a further level still 3233 respectively. So we have to shift the C a further level still
3228 using @code{\shiftOnn} to avoid it interfering with the two D's. 3234 using @code{\shiftOnn} to avoid it interfering with the two D's.
3229 Applying these changes gives: 3235 Applying these changes gives:
3230 3236
3231 @cindex Tie, example of overriding 3237 @cindex Tie, example of overriding
3232 @cindex staff-position property, example 3238 @cindex staff-position property, example
3233 3239
3234 @c line-width ensures no break 3240 @c line-width ensures no break
3235 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in] 3241 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in]
3236 rhMusic = \relative c'' { 3242 rhMusic = \relative c'' {
3237 r2 c4.\( g8 3243 r2 c4.\( g8 |
3238 \once \override Tie #'staff-position = #3.5 3244 \once \override Tie #'staff-position = #3.5
3239 bes1~ 3245 bes1~ |
3240 \bar "||" 3246 \bar "||"
3241 \time 6/4 3247 \time 6/4
3242 bes2.^\markup { \bold "Moderato" } r8 3248 bes2.^\markup { \bold "Moderato" } r8
3243 \mergeDifferentlyHeadedOn 3249 \mergeDifferentlyHeadedOn
3244 \mergeDifferentlyDottedOn 3250 \mergeDifferentlyDottedOn
3245 % Start polyphonic section of four voices 3251 % Start polyphonic section of four voices
3246 << 3252 <<
3247 { c,8 d fis bes a } 3253 { c,8 d fis bes a }
3248 \\ 3254 \\
3249 { 3255 {
3250 % Move the c2 out of the main note column so the merge will work 3256 % Move the c2 out of the main note column so the merge will work
3251 c,8~ \shiftOnn c2 3257 c,8~ \shiftOnn c2
3252 } 3258 }
3253 \\ 3259 \\
3254 { 3260 {
3255 % Stem on the d2 must be down to permit merging 3261 % Stem on the d2 must be down to permit merging
3256 s8 \stemDown d2 3262 s8 \stemDown d2
3257 } 3263 }
3258 \\ 3264 \\
3259 { s4 fis4. } 3265 { s4 fis4. }
3260 >> 3266 >> |
3261 \mergeDifferentlyHeadedOff 3267 \mergeDifferentlyHeadedOff
3262 \mergeDifferentlyDottedOff 3268 \mergeDifferentlyDottedOff
3263 g2.\) 3269 g2.\) |
3264 } 3270 }
3265 3271
3266 lhMusic = \relative c' { 3272 lhMusic = \relative c' {
3267 r2 <c g ees>2( 3273 r2 <c g ees>2( |
3268 <d g, d>1)\arpeggio 3274 <d g, d>1)\arpeggio |
3269 r2. d,,4 r4 r 3275 r2. d,,4 r4 r |
3270 r4 3276 r4
3271 } 3277 }
3272 3278
3273 \score { 3279 \score {
3274 \new PianoStaff << 3280 \new PianoStaff <<
3275 \new Staff = "RH" << 3281 \new Staff = "RH" <<
3276 \key g \minor 3282 \key g \minor
3277 \rhMusic 3283 \rhMusic
3278 >> 3284 >>
3279 \new Staff = "LH" << 3285 \new Staff = "LH" <<
(...skipping 12 matching lines...) Expand all
3292 the @code{force-hshift} property. Here's the final result: 3298 the @code{force-hshift} property. Here's the final result:
3293 3299
3294 @cindex NoteColumn, example of overriding 3300 @cindex NoteColumn, example of overriding
3295 @cindex force-hshift property, example 3301 @cindex force-hshift property, example
3296 @cindex Stem, example of overriding 3302 @cindex Stem, example of overriding
3297 @cindex transparent property, example 3303 @cindex transparent property, example
3298 3304
3299 @c line-width ensures no break 3305 @c line-width ensures no break
3300 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in] 3306 @lilypond[quote,verbatim,ragged-right,line-width=5.5\in]
3301 rhMusic = \relative c'' { 3307 rhMusic = \relative c'' {
3302 r2 3308 r2 c4.\( g8 |
3303 c4.\( g8
3304 \once \override Tie #'staff-position = #3.5 3309 \once \override Tie #'staff-position = #3.5
3305 bes1~ 3310 bes1~ |
3306 \bar "||" 3311 \bar "||"
3307 \time 6/4 3312 \time 6/4
3308 bes2.^\markup { \bold "Moderato" } r8 3313 bes2.^\markup { \bold "Moderato" } r8
3309 \mergeDifferentlyHeadedOn 3314 \mergeDifferentlyHeadedOn
3310 \mergeDifferentlyDottedOn 3315 \mergeDifferentlyDottedOn
3311 << 3316 <<
3312 { c,8 d fis bes a } 3317 { c,8 d fis bes a }
3313 \\ 3318 \\
3314 { 3319 {
3315 % Reposition the c2 to the right of the merged note 3320 % Reposition the c2 to the right of the merged note
3316 c,8~ \once \override NoteColumn #'force-hshift = #1.0 3321 c,8~ \once \override NoteColumn #'force-hshift = #1.0
3317 % Move the c2 out of the main note column so the merge will work 3322 % Move the c2 out of the main note column so the merge will work
3318 \shiftOnn c2 3323 \shiftOnn c2
3319 } 3324 }
3320 \\ 3325 \\
3321 { 3326 {
3322 % Stem on the d2 must be down to permit merging 3327 % Stem on the d2 must be down to permit merging
3323 s8 \stemDown 3328 s8 \stemDown
3324 \once \override Stem #'transparent = ##t 3329 \once \override Stem #'transparent = ##t
3325 d2 3330 d2
3326 } 3331 }
3327 \\ 3332 \\
3328 { s4 fis4. } 3333 { s4 fis4. }
3329 >> 3334 >> |
3330 \mergeDifferentlyHeadedOff 3335 \mergeDifferentlyHeadedOff
3331 \mergeDifferentlyDottedOff 3336 \mergeDifferentlyDottedOff
3332 g2.\) 3337 g2.\) |
3333 } 3338 }
3334 3339
3335 lhMusic = \relative c' { 3340 lhMusic = \relative c' {
3336 r2 <c g ees>2( 3341 r2 <c g ees>2( |
3337 <d g, d>1)\arpeggio 3342 <d g, d>1)\arpeggio |
3338 r2. d,,4 r4 r 3343 r2. d,,4 r4 r |
3339 r4 3344 r4
3340 } 3345 }
3341 3346
3342 \score { 3347 \score {
3343 \new PianoStaff << 3348 \new PianoStaff <<
3344 \new Staff = "RH" << 3349 \new Staff = "RH" <<
3345 \key g \minor 3350 \key g \minor
3346 \rhMusic 3351 \rhMusic
3347 >> 3352 >>
3348 \new Staff = "LH" << 3353 \new Staff = "LH" <<
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
3451 3456
3452 @lilypond[quote,verbatim,ragged-right] 3457 @lilypond[quote,verbatim,ragged-right]
3453 \score { 3458 \score {
3454 \relative c'' { 3459 \relative c'' {
3455 % Visible tempo marking 3460 % Visible tempo marking
3456 \tempo 4=120 3461 \tempo 4=120
3457 a4 a a 3462 a4 a a
3458 \once \override Score.MetronomeMark #'transparent = ##t 3463 \once \override Score.MetronomeMark #'transparent = ##t
3459 % Invisible tempo marking to lengthen fermata in MIDI 3464 % Invisible tempo marking to lengthen fermata in MIDI
3460 \tempo 4=80 3465 \tempo 4=80
3461 a4\fermata 3466 a4\fermata |
3462 % New tempo for next section 3467 % New tempo for next section
3463 \tempo 4=100 3468 \tempo 4=100
3464 a4 a a a 3469 a4 a a a |
3465 } 3470 }
3466 \layout { } 3471 \layout { }
3467 \midi { } 3472 \midi { }
3468 } 3473 }
3469 @end lilypond 3474 @end lilypond
3470 3475
3471 @cindex MetronomeMark, example of overriding 3476 @cindex MetronomeMark, example of overriding
3472 @cindex stencil property, example 3477 @cindex stencil property, example
3473 3478
3474 @lilypond[quote,verbatim,ragged-right] 3479 @lilypond[quote,verbatim,ragged-right]
3475 \score { 3480 \score {
3476 \relative c'' { 3481 \relative c'' {
3477 % Visible tempo marking 3482 % Visible tempo marking
3478 \tempo 4=120 3483 \tempo 4=120
3479 a4 a a 3484 a4 a a
3480 \once \override Score.MetronomeMark #'stencil = ##f 3485 \once \override Score.MetronomeMark #'stencil = ##f
3481 % Invisible tempo marking to lengthen fermata in MIDI 3486 % Invisible tempo marking to lengthen fermata in MIDI
3482 \tempo 4=80 3487 \tempo 4=80
3483 a4\fermata 3488 a4\fermata |
3484 % New tempo for next section 3489 % New tempo for next section
3485 \tempo 4=100 3490 \tempo 4=100
3486 a4 a a a 3491 a4 a a a |
3487 } 3492 }
3488 \layout { } 3493 \layout { }
3489 \midi { } 3494 \midi { }
3490 } 3495 }
3491 @end lilypond 3496 @end lilypond
3492 3497
3493 @noindent 3498 @noindent
3494 Both methods remove the metronome mark which lengthens the fermata 3499 Both methods remove the metronome mark which lengthens the fermata
3495 from the printed output, and both affect the MIDI timing as 3500 from the printed output, and both affect the MIDI timing as
3496 required, but the transparent metronome mark in the first line 3501 required, but the transparent metronome mark in the first line
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3541 emphasize = { 3546 emphasize = {
3542 \override Lyrics.LyricText #'font-shape = #'italic 3547 \override Lyrics.LyricText #'font-shape = #'italic
3543 \override Lyrics.LyricText #'font-series = #'bold 3548 \override Lyrics.LyricText #'font-series = #'bold
3544 } 3549 }
3545 3550
3546 normal = { 3551 normal = {
3547 \revert Lyrics.LyricText #'font-shape 3552 \revert Lyrics.LyricText #'font-shape
3548 \revert Lyrics.LyricText #'font-series 3553 \revert Lyrics.LyricText #'font-series
3549 } 3554 }
3550 3555
3551 global = { 3556 global = { \key c \major \time 4/4 \partial 4 }
Graham Percival (old account) 2010/05/02 16:01:33 PDP +104%. Was it too complicated before? Given
3552 \key c \major 3557
3553 \time 4/4 3558 SopranoMusic = \relative c' { c4 | e4. e8 g4 g | a4 a g }
3554 \partial 4 3559 AltoMusic = \relative c' { c4 | c4. c8 e4 e | f4 f e }
3555 } 3560 TenorMusic = \relative c { e4 | g4. g8 c4. b8 | a8 b c d e4 }
3556 3561 BassMusic = \relative c { c4 | c4. c8 c4 c | f8 g a b c4 }
3557 SopranoMusic = \relative c' {
3558 c4
3559 e4. e8 g4 g
3560 a4 a g
3561 }
3562
3563 AltoMusic = \relative c' {
3564 c4
3565 c4. c8 e4 e
3566 f4 f e
3567 }
3568
3569 TenorMusic = \relative c {
3570 e4
3571 g4. g8 c4. b8
3572 a8 b c d e4
3573 }
3574
3575 BassMusic = \relative c {
3576 c4
3577 c4. c8 c4 c
3578 f8 g a b c4
3579 }
3580 3562
3581 VerseOne = \lyrics { 3563 VerseOne = \lyrics {
3582 E -- | ter -- nal 3564 E -- | ter -- nal \emphasize Fa -- ther, | \normal strong to save,
3583 \emphasize
3584 Fa -- ther, |
3585 \normal
3586 strong to save,
3587 } 3565 }
3588 3566
3589 VerseTwo = \lyricmode { 3567 VerseTwo = \lyricmode {
3590 O | 3568 O | \emphasize Christ, \normal whose voice the | wa -- ters heard,
3591 \emphasize
3592 Christ,
3593 \normal
3594 whose voice the |
3595 wa -- ters heard,
3596 } 3569 }
3597 3570
3598 VerseThree = \lyricmode { 3571 VerseThree = \lyricmode {
3599 O | 3572 O | \emphasize Ho -- ly Spi -- rit, | \normal who didst brood
3600 \emphasize
3601 Ho -- ly Spi -- rit, |
3602 \normal
3603 who didst brood
3604 } 3573 }
3605 3574
3606 VerseFour = \lyricmode { 3575 VerseFour = \lyricmode {
3607 O | 3576 O | \emphasize Tri -- ni -- ty \normal of | love and pow'r
3608 \emphasize
3609 Tri -- ni -- ty
3610 \normal
3611 of |
3612 love and pow'r
3613 } 3577 }
3614 3578
3615 \score { 3579 \score {
3616 \new ChoirStaff << 3580 \new ChoirStaff <<
3617 \new Staff << 3581 \new Staff <<
3618 \clef treble 3582 \clef treble
3619 \new Voice = "Soprano" { \voiceOne \global \SopranoMusic } 3583 \new Voice = "Soprano" { \voiceOne \global \SopranoMusic }
3620 \new Voice = "Alto" { \voiceTwo \AltoMusic } 3584 \new Voice = "Alto" { \voiceTwo \AltoMusic }
3621 \new Lyrics \lyricsto "Soprano" { \VerseOne } 3585 \new Lyrics \lyricsto "Soprano" { \VerseOne }
3622 \new Lyrics \lyricsto "Soprano" { \VerseTwo } 3586 \new Lyrics \lyricsto "Soprano" { \VerseTwo }
(...skipping 17 matching lines...) Expand all
3640 @ref{Tweaking output}, for details. But what if you have many 3604 @ref{Tweaking output}, for details. But what if you have many
3641 input files that you want to apply your tweaks to? Or what if you 3605 input files that you want to apply your tweaks to? Or what if you
3642 simply want to separate your tweaks from the actual music? This 3606 simply want to separate your tweaks from the actual music? This
3643 is quite easy to do. 3607 is quite easy to do.
3644 3608
3645 Let's look at an example. Don't worry if you don't understand 3609 Let's look at an example. Don't worry if you don't understand
3646 the parts with all the @code{#()}. This is explained in 3610 the parts with all the @code{#()}. This is explained in
3647 @ref{Advanced tweaks with Scheme}. 3611 @ref{Advanced tweaks with Scheme}.
3648 3612
3649 @lilypond[quote,verbatim,ragged-right] 3613 @lilypond[quote,verbatim,ragged-right]
3650 mpdolce = 3614 mpdolce =
Graham Percival (old account) 2010/05/02 16:01:33 By contrast, I (mostly) like this expansion, since
Mark Polesky 2010/05/02 20:13:05 The practice can prevent needlessly long lines: u
3651 #(make-dynamic-script 3615 #(make-dynamic-script
3652 (markup #:hspace 0 3616 (markup #:hspace 0
3653 #:translate '(5 . 0) 3617 #:translate '(5 . 0)
3654 #:line (#:dynamic "mp" 3618 #:line (#:dynamic "mp"
3655 #:text #:italic "dolce"))) 3619 #:text #:italic "dolce")))
3656 3620
3657 inst = 3621 inst =
3658 #(define-music-function 3622 #(define-music-function
3659 (parser location string) 3623 (parser location string)
3660 (string?) 3624 (string?)
3661 (make-music 3625 (make-music
3662 'TextScriptEvent 3626 'TextScriptEvent
3663 'direction UP 3627 'direction UP
3664 'text (markup #:bold (#:box string)))) 3628 'text (markup #:bold (#:box string))))
3665 3629
3666 \relative c'' { 3630 \relative c'' {
3667 \tempo 4=50 3631 \tempo 4=50
3668 a4.\mpdolce d8 cis4--\glissando a 3632 a4.\mpdolce d8 cis4--\glissando a |
3669 b4 bes a2 3633 b4 bes a2 |
3670 \inst "Clarinet" 3634 \inst "Clarinet"
3671 cis4.\< d8 e4 fis 3635 cis4.\< d8 e4 fis |
3672 g8(\! fis)-. e( d)-. cis2 3636 g8(\! fis)-. e( d)-. cis2 |
3673 } 3637 }
3674 @end lilypond 3638 @end lilypond
3675 3639
3676 There are some problems with overlapping output; we'll fix those using 3640 There are some problems with overlapping output; we'll fix those using
3677 the techniques in @ref{Moving objects}. But let's also 3641 the techniques in @ref{Moving objects}. But let's also
3678 do something about the @code{mpdolce} and @code{inst} 3642 do something about the @code{mpdolce} and @code{inst}
3679 definitions. They produce the output we desire, but we might want 3643 definitions. They produce the output we desire, but we might want
3680 to use them in another piece. We could simply copy-and-paste them 3644 to use them in another piece. We could simply copy-and-paste them
3681 at the top of every file, but that's an annoyance. It also leaves 3645 at the top of every file, but that's an annoyance. It also leaves
3682 those definitions in our input files, and I personally find all 3646 those definitions in our input files, and I personally find all
(...skipping 25 matching lines...) Expand all
3708 Now let's modify our music (let's save this file as @file{"music.ly"}). 3672 Now let's modify our music (let's save this file as @file{"music.ly"}).
3709 3673
3710 @c We have to do this awkward example/lilypond-non-verbatim 3674 @c We have to do this awkward example/lilypond-non-verbatim
3711 @c because we can't do the \include stuff in the manual. 3675 @c because we can't do the \include stuff in the manual.
3712 3676
3713 @example 3677 @example
3714 \include "definitions.ily" 3678 \include "definitions.ily"
3715 3679
3716 \relative c'' @{ 3680 \relative c'' @{
3717 \tempo 4=50 3681 \tempo 4=50
3718 a4.\mpdolce d8 cis4--\glissando a 3682 a4.\mpdolce d8 cis4--\glissando a |
3719 b4 bes a2 3683 b4 bes a2 |
3720 \inst "Clarinet" 3684 \inst "Clarinet"
3721 cis4.\< d8 e4 fis 3685 cis4.\< d8 e4 fis |
3722 g8(\! fis)-. e( d)-. cis2 3686 g8(\! fis)-. e( d)-. cis2 |
3723 @} 3687 @}
3724 @end example 3688 @end example
3725 3689
3726 @lilypond[quote,ragged-right] 3690 @lilypond[quote,ragged-right]
3727 mpdolce = 3691 mpdolce =
3728 #(make-dynamic-script 3692 #(make-dynamic-script
3729 (markup #:hspace 0 3693 (markup #:hspace 0
3730 #:translate '(5 . 0) 3694 #:translate '(5 . 0)
3731 #:line (#:dynamic "mp" 3695 #:line (#:dynamic "mp"
3732 #:text #:italic "dolce"))) 3696 #:text #:italic "dolce")))
3733 3697
3734 inst = 3698 inst =
3735 #(define-music-function 3699 #(define-music-function
3736 (parser location string) 3700 (parser location string)
3737 (string?) 3701 (string?)
3738 (make-music 3702 (make-music
3739 'TextScriptEvent 3703 'TextScriptEvent
3740 'direction UP 3704 'direction UP
3741 'text (markup #:bold (#:box string)))) 3705 'text (markup #:bold (#:box string))))
3742 3706
3743 \relative c'' { 3707 \relative c'' {
3744 \tempo 4=50 3708 \tempo 4=50
3745 a4.\mpdolce d8 cis4--\glissando a 3709 a4.\mpdolce d8 cis4--\glissando a |
3746 b4 bes a2 3710 b4 bes a2 |
3747 \inst "Clarinet" 3711 \inst "Clarinet"
3748 cis4.\< d8 e4 fis 3712 cis4.\< d8 e4 fis |
3749 g8(\! fis)-. e( d)-. cis2 3713 g8(\! fis)-. e( d)-. cis2 |
3750 } 3714 }
3751 @end lilypond 3715 @end lilypond
3752 3716
3753 That looks better, but let's make a few changes. The glissando is hard 3717 That looks better, but let's make a few changes. The glissando is hard
3754 to see, so let's make it thicker and closer to the note heads. Let's 3718 to see, so let's make it thicker and closer to the note heads. Let's
3755 put the metronome marking above the clef, instead of over the first 3719 put the metronome marking above the clef, instead of over the first
3756 note. And finally, my composition professor hates @q{C} time signatures, 3720 note. And finally, my composition professor hates @q{C} time signatures,
3757 so we'd better make that @q{4/4} instead. 3721 so we'd better make that @q{4/4} instead.
3758 3722
3759 Don't change @file{music.ly}, though. Replace our @file{definitions.ily} 3723 Don't change @file{music.ly}, though. Replace our @file{definitions.ily}
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3824 } 3788 }
3825 \context { 3789 \context {
3826 \Voice 3790 \Voice
3827 \override Glissando #'thickness = #3 3791 \override Glissando #'thickness = #3
3828 \override Glissando #'gap = #0.1 3792 \override Glissando #'gap = #0.1
3829 } 3793 }
3830 } 3794 }
3831 3795
3832 \relative c'' { 3796 \relative c'' {
3833 \tempo 4=50 3797 \tempo 4=50
3834 a4.\mpdolce d8 cis4--\glissando a 3798 a4.\mpdolce d8 cis4--\glissando a |
3835 b4 bes a2 3799 b4 bes a2 |
3836 \inst "Clarinet" 3800 \inst "Clarinet"
3837 cis4.\< d8 e4 fis 3801 cis4.\< d8 e4 fis |
3838 g8(\! fis)-. e( d)-. cis2 3802 g8(\! fis)-. e( d)-. cis2 |
3839 } 3803 }
3840 @end lilypond 3804 @end lilypond
3841 3805
3842 That looks nicer! But now suppose that I want to publish this 3806 That looks nicer! But now suppose that I want to publish this
3843 piece. My composition professor doesn't like @q{C} time 3807 piece. My composition professor doesn't like @q{C} time
3844 signatures, but I'm somewhat fond of them. Let's copy the 3808 signatures, but I'm somewhat fond of them. Let's copy the
3845 current @file{definitions.ily} to @file{web-publish.ily} and 3809 current @file{definitions.ily} to @file{web-publish.ily} and
3846 modify that. Since this music is aimed at producing a pdf which 3810 modify that. Since this music is aimed at producing a pdf which
3847 will be displayed on the screen, we'll also increase the 3811 will be displayed on the screen, we'll also increase the
3848 overall size of the output. 3812 overall size of the output.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3909 \override MetronomeMark #'padding = #'3 3873 \override MetronomeMark #'padding = #'3
3910 } 3874 }
3911 \context { \Voice 3875 \context { \Voice
3912 \override Glissando #'thickness = #3 3876 \override Glissando #'thickness = #3
3913 \override Glissando #'gap = #0.1 3877 \override Glissando #'gap = #0.1
3914 } 3878 }
3915 } 3879 }
3916 3880
3917 \relative c'' { 3881 \relative c'' {
3918 \tempo 4=50 3882 \tempo 4=50
3919 a4.\mpdolce d8 cis4--\glissando a 3883 a4.\mpdolce d8 cis4--\glissando a |
3920 b4 bes a2 3884 b4 bes a2 |
3921 \inst "Clarinet" 3885 \inst "Clarinet"
3922 cis4.\< d8 e4 fis 3886 cis4.\< d8 e4 fis |
3923 g8(\! fis)-. e( d)-. cis2 3887 g8(\! fis)-. e( d)-. cis2 |
3924 } 3888 }
3925 @end lilypond 3889 @end lilypond
3926 3890
3927 Now in our music, I simply replace 3891 Now in our music, I simply replace
3928 @code{\include "definitions.ily"} with 3892 @code{\include "definitions.ily"} with
3929 @code{\include "web-publish.ily"}. Of course, we could make this 3893 @code{\include "web-publish.ily"}. Of course, we could make this
3930 even more convenient. We could make a @file{definitions.ily} file which 3894 even more convenient. We could make a @file{definitions.ily} file which
3931 contains only the definitions of @code{mpdolce} and @code{inst}, a 3895 contains only the definitions of @code{mpdolce} and @code{inst}, a
3932 @file{web-publish.ily} file which contains only the @code{\layout} 3896 @file{web-publish.ily} file which contains only the @code{\layout}
3933 section listed above, and a @file{university.ily} file which 3897 section listed above, and a @file{university.ily} file which
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 @cindex NoteHead, example of overriding 4102 @cindex NoteHead, example of overriding
4139 @cindex color property, setting to Scheme procedure 4103 @cindex color property, setting to Scheme procedure
4140 4104
4141 @lilypond[quote,verbatim,ragged-right] 4105 @lilypond[quote,verbatim,ragged-right]
4142 #(define (color-notehead grob) 4106 #(define (color-notehead grob)
4143 "Color the notehead according to its position on the staff." 4107 "Color the notehead according to its position on the staff."
4144 (let ((mod-position (modulo (ly:grob-property grob 'staff-position) 4108 (let ((mod-position (modulo (ly:grob-property grob 'staff-position)
4145 7))) 4109 7)))
4146 (case mod-position 4110 (case mod-position
4147 ;; Return rainbow colors 4111 ;; Return rainbow colors
4148 ((1) (x11-color 'red )) ; for C 4112 ((1) (x11-color 'red )) ; for C
4149 ((2) (x11-color 'orange )) ; for D 4113 ((2) (x11-color 'orange )) ; for D
4150 ((3) (x11-color 'yellow )) ; for E 4114 ((3) (x11-color 'yellow )) ; for E
4151 ((4) (x11-color 'green )) ; for F 4115 ((4) (x11-color 'green )) ; for F
4152 ((5) (x11-color 'blue )) ; for G 4116 ((5) (x11-color 'blue )) ; for G
4153 ((6) (x11-color 'purple )) ; for A 4117 ((6) (x11-color 'purple )) ; for A
4154 ((0) (x11-color 'violet ))))) ; for B 4118 ((0) (x11-color 'violet )) ; for B
4119 )))
4155 4120
4156 \relative c' { 4121 \relative c' {
4157 % Arrange to obtain color from color-notehead procedure 4122 % Arrange to obtain color from color-notehead procedure
4158 \override NoteHead #'color = #color-notehead 4123 \override NoteHead #'color = #color-notehead
4159 a2 b 4124 a2 b | c2 d | e2 f | g2 a |
4160 c2 d
4161 e2 f
4162 g2 a
4163 } 4125 }
4164 @end lilypond 4126 @end lilypond
4165 4127
4166 Further examples showing the use of these programmable interfaces 4128 Further examples showing the use of these programmable interfaces
4167 can be found in @rextend{Callback functions}. 4129 can be found in @rextend{Callback functions}.
4168 4130
4169 4131
4170 4132
LEFTRIGHT

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