LEFT | RIGHT |
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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 17 matching lines...) Expand all Loading... |
418 @cindex direction property, example | 418 @cindex direction property, example |
419 @cindex color property, example | 419 @cindex color property, example |
420 | 420 |
421 @lilypond[quote,ragged-right,verbatim,fragment,relative=2] | 421 @lilypond[quote,ragged-right,verbatim,fragment,relative=2] |
422 \tweak #'direction #up | 422 \tweak #'direction #up |
423 \times 4/3 { | 423 \times 4/3 { |
424 \tweak #'color #red | 424 \tweak #'color #red |
425 \times 2/3 { c8[ c c] } | 425 \times 2/3 { c8[ c c] } |
426 \times 2/3 { c8[ c c] } | 426 \times 2/3 { c8[ c c] } |
427 \times 2/3 { c8[ c c] } | 427 \times 2/3 { c8[ c c] } |
428 } | | 428 } |
429 @end lilypond | 429 @end lilypond |
430 | 430 |
431 If nested tuplets do not begin at the same moment, their | 431 If nested tuplets do not begin at the same moment, their |
432 appearance may be modified in the usual way with | 432 appearance may be modified in the usual way with |
433 @code{\override} commands: | 433 @code{\override} commands: |
434 | 434 |
435 @cindex text property, example | 435 @cindex text property, example |
436 @cindex tuplet-number function, example | 436 @cindex tuplet-number function, example |
437 @cindex transparent property, example | 437 @cindex transparent property, example |
438 @cindex TupletNumber, example of overriding | 438 @cindex TupletNumber, example of overriding |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
1069 @code{#f}. If this is the case, you can instead use the | 1069 @code{#f}. If this is the case, you can instead use the |
1070 @code{point-stencil} function, which sets the stencil to a object | 1070 @code{point-stencil} function, which sets the stencil to a object |
1071 with zero size: | 1071 with zero size: |
1072 | 1072 |
1073 @lilypond[quote,verbatim,relative=2] | 1073 @lilypond[quote,verbatim,relative=2] |
1074 { | 1074 { |
1075 c4 c | 1075 c4 c |
1076 \once \override NoteHead #'stencil = #point-stencil | 1076 \once \override NoteHead #'stencil = #point-stencil |
1077 c4 c | | 1077 c4 c |
1078 } | 1078 } |
1079 @end lilypond | 1079 @end lilypond |
1080 | 1080 |
1081 @subheading break-visibility | 1081 @subheading break-visibility |
1082 | 1082 |
1083 @cindex break-visibility property | 1083 @cindex break-visibility property |
1084 | 1084 |
1085 We see from the @code{BarLine} properties in the IR that the | 1085 We see from the @code{BarLine} properties in the IR that the |
1086 @code{break-visibility} property requires a vector of three booleans. | 1086 @code{break-visibility} property requires a vector of three booleans. |
1087 These control respectively whether bar lines are printed at the end of | 1087 These control respectively whether bar lines are printed at the end of |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 lines, so moving the left edge half a unit to the left and the | 2299 lines, so moving the left edge half a unit to the left and the |
2294 right edge half a unit to the right should do it: | 2300 right edge half a unit to the right should do it: |
2295 | 2301 |
2296 @cindex DynamicText, example of overriding | 2302 @cindex DynamicText, example of overriding |
2297 @cindex extra-spacing-width property, example | 2303 @cindex extra-spacing-width property, example |
2298 | 2304 |
2299 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] | 2305 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] |
2300 \dynamicUp | 2306 \dynamicUp |
2301 % Extend width by 1 staff space | 2307 % Extend width by 1 staff space |
2302 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) | 2308 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) |
2303 a4\f b\mf c\mp b\p | | 2309 a4\f b\mf c\mp b\p |
2304 @end lilypond | 2310 @end lilypond |
2305 | 2311 |
2306 @noindent | 2312 @noindent |
2307 This looks better, but maybe we would prefer the dynamic marks | 2313 This looks better, but maybe we would prefer the dynamic marks |
2308 to be aligned along the same baseline rather than going up and | 2314 to be aligned along the same baseline rather than going up and |
2309 down with the notes. The property to do this is | 2315 down with the notes. The property to do this is |
2310 @code{staff-padding} which is covered in the following section. | 2316 @code{staff-padding} which is covered in the following section. |
2311 | 2317 |
2312 | 2318 |
2313 @node Collisions of objects | 2319 @node Collisions of objects |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 The @code{padding} property can be set to increase | 2573 The @code{padding} property can be set to increase |
2568 (or decrease) the distance between symbols that are printed | 2574 (or decrease) the distance between symbols that are printed |
2569 above or below notes. | 2575 above or below notes. |
2570 | 2576 |
2571 @cindex Script, example of overriding | 2577 @cindex Script, example of overriding |
2572 @cindex padding property, example | 2578 @cindex padding property, example |
2573 | 2579 |
2574 @lilypond[quote,fragment,relative=1,verbatim] | 2580 @lilypond[quote,fragment,relative=1,verbatim] |
2575 c2\fermata | 2581 c2\fermata |
2576 \override Script #'padding = #3 | 2582 \override Script #'padding = #3 |
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 | |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2667 @cindex extra-spacing-width property, example | 2673 @cindex extra-spacing-width property, example |
2668 @cindex DynamicLineSpanner, example of overriding | 2674 @cindex DynamicLineSpanner, example of overriding |
2669 @cindex staff-padding property, example | 2675 @cindex staff-padding property, example |
2670 | 2676 |
2671 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] | 2677 @lilypond[quote,fragment,ragged-right,verbatim,relative=2] |
2672 \dynamicUp | 2678 \dynamicUp |
2673 % Extend width by 1 unit | 2679 % Extend width by 1 unit |
2674 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) | 2680 \override DynamicText #'extra-spacing-width = #'(-0.5 . 0.5) |
2675 % Align dynamics to a base line 2 units above staff | 2681 % Align dynamics to a base line 2 units above staff |
2676 \override DynamicLineSpanner #'staff-padding = #2 | 2682 \override DynamicLineSpanner #'staff-padding = #2 |
2677 a4\f b\mf c\mp b\p | | 2683 a4\f b\mf c\mp b\p |
2678 @end lilypond | 2684 @end lilypond |
2679 | 2685 |
2680 | 2686 |
2681 @subheading self-alignment-X property | 2687 @subheading self-alignment-X property |
2682 | 2688 |
2683 The following example shows how this can resolve the collision | 2689 The following example shows how this can resolve the collision |
2684 of a string fingering object with a note's stem by aligning the | 2690 of a string fingering object with a note's stem by aligning the |
2685 right edge with the reference point of the parent note: | 2691 right edge with the reference point of the parent note: |
2686 | 2692 |
2687 @cindex StringNumber, example of overriding | 2693 @cindex StringNumber, example of overriding |
(...skipping 30 matching lines...) Expand all Loading... |
2718 | 2724 |
2719 @cindex MultiMeasureRest, example of overriding | 2725 @cindex MultiMeasureRest, example of overriding |
2720 @cindex staff-position property, example | 2726 @cindex staff-position property, example |
2721 | 2727 |
2722 @lilypond[quote,verbatim,fragment,ragged-right, relative=1] | 2728 @lilypond[quote,verbatim,fragment,ragged-right, relative=1] |
2723 << | 2729 << |
2724 { c4 c c c } | 2730 { c4 c c c } |
2725 \\ | 2731 \\ |
2726 \override MultiMeasureRest #'staff-position = #-8 | 2732 \override MultiMeasureRest #'staff-position = #-8 |
2727 { R1 } | 2733 { R1 } |
2728 >> | | 2734 >> |
2729 @end lilypond | 2735 @end lilypond |
2730 | 2736 |
2731 This is better than using, for example, @code{extra-offset}, | 2737 This is better than using, for example, @code{extra-offset}, |
2732 because the ledger line above the rest is inserted automatically. | 2738 because the ledger line above the rest is inserted automatically. |
2733 | 2739 |
2734 @subheading extra-offset property | 2740 @subheading extra-offset property |
2735 | 2741 |
2736 @cindex positioning objects | 2742 @cindex positioning objects |
2737 @cindex positioning grobs | 2743 @cindex positioning grobs |
2738 @cindex objects, positioning | 2744 @cindex objects, positioning |
(...skipping 24 matching lines...) Expand all Loading... |
2763 @cindex slurs, controlling manually | 2769 @cindex slurs, controlling manually |
2764 @cindex phrasing slurs, controlling manually | 2770 @cindex phrasing slurs, controlling manually |
2765 @cindex beams, controlling manually | 2771 @cindex beams, controlling manually |
2766 | 2772 |
2767 The @code{positions} property allows the position and slope of | 2773 The @code{positions} property allows the position and slope of |
2768 tuplets, slurs, phrasing slurs and beams to be controlled manually. | 2774 tuplets, slurs, phrasing slurs and beams to be controlled manually. |
2769 Here's an example which has an ugly phrasing slur due to its trying to | 2775 Here's an example which has an ugly phrasing slur due to its trying to |
2770 avoid the slur on the acciaccatura. | 2776 avoid the slur on the acciaccatura. |
2771 | 2777 |
2772 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] | 2778 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] |
2773 r4 \acciaccatura e8\( d8 c~ c d c d\) | | 2779 r4 \acciaccatura e8\( d8 c~ c d c d\) |
2774 @end lilypond | 2780 @end lilypond |
2775 | 2781 |
2776 @noindent | 2782 @noindent |
2777 We could simply move the phrasing slur above the notes, and this | 2783 We could simply move the phrasing slur above the notes, and this |
2778 would be the preferred solution: | 2784 would be the preferred solution: |
2779 | 2785 |
2780 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] | 2786 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] |
2781 r4 | 2787 r4 |
2782 \phrasingSlurUp | 2788 \phrasingSlurUp |
2783 \acciaccatura e8\( d8 c~ c d c d\) | | 2789 \acciaccatura e8\( d8 c~ c d c d\) |
2784 @end lilypond | 2790 @end lilypond |
2785 | 2791 |
2786 @noindent | 2792 @noindent |
2787 But if there were some reason why this could not be done the | 2793 But if there were some reason why this could not be done the |
2788 other alternative would be to move the left end of the phrasing | 2794 other alternative would be to move the left end of the phrasing |
2789 slur down a little using the @code{positions} property. This | 2795 slur down a little using the @code{positions} property. This |
2790 also resolves the rather nasty shape. | 2796 also resolves the rather nasty shape. |
2791 | 2797 |
2792 @cindex PhrasingSlur, example of overriding | 2798 @cindex PhrasingSlur, example of overriding |
2793 @cindex positions property, example | 2799 @cindex positions property, example |
2794 | 2800 |
2795 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] | 2801 @lilypond[quote,verbatim,fragment,ragged-right,relative=1] |
2796 r4 | 2802 r4 |
2797 \once \override PhrasingSlur #'positions = #'(-4 . -3) | 2803 \once \override PhrasingSlur #'positions = #'(-4 . -3) |
2798 \acciaccatura e8\( d8 c~ c d c d\) | | 2804 \acciaccatura e8\( d8 c~ c d c d\) |
2799 @end lilypond | 2805 @end lilypond |
2800 | 2806 |
2801 Here's a further example taken from the opening of the left-hand | 2807 Here's a further example taken from the opening of the left-hand |
2802 staff of Chopin's Prelude Op 28 No. 2. We see that the beam | 2808 staff of Chopin's Prelude Op 28 No. 2. We see that the beam |
2803 collides with the upper notes: | 2809 collides with the upper notes: |
2804 | 2810 |
2805 @lilypond[quote,verbatim,fragment,ragged-right] | 2811 @lilypond[quote,verbatim,fragment,ragged-right] |
2806 { | 2812 { |
2807 \clef bass | 2813 \clef bass |
2808 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> | 2814 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> |
2809 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> | | 2815 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> |
2810 } | 2816 } |
2811 @end lilypond | 2817 @end lilypond |
2812 | 2818 |
2813 @noindent | 2819 @noindent |
2814 This can be resolved by manually moving both ends of the beam | 2820 This can be resolved by manually moving both ends of the beam |
2815 up from their position at 2 staff-spaces above the center line to, | 2821 up from their position at 2 staff-spaces above the center line to, |
2816 say, 3: | 2822 say, 3: |
2817 | 2823 |
2818 @cindex Beam, example of overriding | 2824 @cindex Beam, example of overriding |
2819 @cindex positions property, example | 2825 @cindex positions property, example |
2820 | 2826 |
2821 @lilypond[quote,verbatim,fragment,ragged-right] | 2827 @lilypond[quote,verbatim,fragment,ragged-right] |
2822 { | 2828 { |
2823 \clef bass | 2829 \clef bass |
2824 << | 2830 << |
2825 \override Beam #'positions = #'(3 . 3) | 2831 \override Beam #'positions = #'(3 . 3) |
2826 { b,8 ais, b, g, } | 2832 { b,8 ais, b, g, } |
2827 \\ | 2833 \\ |
2828 { e,8 g e, g } | 2834 { e,8 g e, g } |
2829 >> | 2835 >> |
2830 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> | | 2836 << { b,8 ais, b, g, } \\ { e,8 g e, g } >> |
2831 } | 2837 } |
2832 @end lilypond | 2838 @end lilypond |
2833 | 2839 |
2834 @noindent | 2840 @noindent |
2835 Note that the override continues to apply in the first voice of | 2841 Note that the override continues to apply in the first voice of |
2836 the second block of quavers, but not to any of the beams in the | 2842 the second block of quavers, but not to any of the beams in the |
2837 second voice. | 2843 second voice. |
2838 | 2844 |
2839 @subheading force-hshift property | 2845 @subheading force-hshift property |
2840 | 2846 |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 @cindex NoteHead, example of overriding | 4102 @cindex NoteHead, example of overriding |
4097 @cindex color property, setting to Scheme procedure | 4103 @cindex color property, setting to Scheme procedure |
4098 | 4104 |
4099 @lilypond[quote,verbatim,ragged-right] | 4105 @lilypond[quote,verbatim,ragged-right] |
4100 #(define (color-notehead grob) | 4106 #(define (color-notehead grob) |
4101 "Color the notehead according to its position on the staff." | 4107 "Color the notehead according to its position on the staff." |
4102 (let ((mod-position (modulo (ly:grob-property grob 'staff-position) | 4108 (let ((mod-position (modulo (ly:grob-property grob 'staff-position) |
4103 7))) | 4109 7))) |
4104 (case mod-position | 4110 (case mod-position |
4105 ;; Return rainbow colors | 4111 ;; Return rainbow colors |
4106 ((1) (x11-color 'red )) ; for C | 4112 ((1) (x11-color 'red )) ; for C |
4107 ((2) (x11-color 'orange )) ; for D | 4113 ((2) (x11-color 'orange )) ; for D |
4108 ((3) (x11-color 'yellow )) ; for E | 4114 ((3) (x11-color 'yellow )) ; for E |
4109 ((4) (x11-color 'green )) ; for F | 4115 ((4) (x11-color 'green )) ; for F |
4110 ((5) (x11-color 'blue )) ; for G | 4116 ((5) (x11-color 'blue )) ; for G |
4111 ((6) (x11-color 'purple )) ; for A | 4117 ((6) (x11-color 'purple )) ; for A |
4112 ((0) (x11-color 'violet ))))) ; for B | 4118 ((0) (x11-color 'violet )) ; for B |
| 4119 ))) |
4113 | 4120 |
4114 \relative c' { | 4121 \relative c' { |
4115 % Arrange to obtain color from color-notehead procedure | 4122 % Arrange to obtain color from color-notehead procedure |
4116 \override NoteHead #'color = #color-notehead | 4123 \override NoteHead #'color = #color-notehead |
4117 a2 b | c2 d | e2 f | g2 a | | 4124 a2 b | c2 d | e2 f | g2 a | |
4118 } | 4125 } |
4119 @end lilypond | 4126 @end lilypond |
4120 | 4127 |
4121 Further examples showing the use of these programmable interfaces | 4128 Further examples showing the use of these programmable interfaces |
4122 can be found in @rextend{Callback functions}. | 4129 can be found in @rextend{Callback functions}. |
4123 | 4130 |
4124 | 4131 |
4125 | 4132 |
LEFT | RIGHT |