X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Flearning%2Ftweaks.itely;h=9c0b98edba1b943022a5e66c9f6e408590d6f96f;hb=e9cea040855f3f40cb37b21c078ba1c90ea22714;hp=8097e0bb522e060776296ff8d88b9075aaba1355;hpb=1efdabf3b2349ea7fa3183dca5bba5104c347c36;p=lilypond.git diff --git a/Documentation/learning/tweaks.itely b/Documentation/learning/tweaks.itely index 8097e0bb52..9c0b98edba 100644 --- a/Documentation/learning/tweaks.itely +++ b/Documentation/learning/tweaks.itely @@ -816,8 +816,8 @@ LilyPond. Some of them are the names of properties, like @code{thickness} or @code{font-shape}, others are used as values that can be given to properties, like @code{italic}. Note the distinction from arbitrary text strings, which would appear as @code{"a text -string"}; for more details about symbols and strings, see @ref{Scheme -tutorial}. +string"}; for more details about symbols and strings, see +@rextend{Scheme tutorial}. So we see that the @code{\override} command needed to print the lyrics in italics is: @@ -882,7 +882,7 @@ the dot between the context name and the object name.} @seealso -Learning Manual: @ref{Scheme tutorial}. +Extending: @rextend{Scheme tutorial}. @node Types of properties @@ -954,7 +954,7 @@ by apostrophe-hash, @code{'#}. @seealso -Learning Manual: @ref{Scheme tutorial}. +Extending: @rextend{Scheme tutorial}. @node Appearance of objects @@ -1925,10 +1925,24 @@ The @code{outside-staff-priority} is defined in the @code{grob-interface} and so is a property of all layout objects. By default it is set to @code{#f} for all within-staff objects, and to a numerical value appropriate to each outside-staff object -when the object is created. The following table shows -the default numerical values for some of the commonest -outside-staff objects which are, by default, placed in the -@code{Staff} or @code{Voice} contexts. +when the object is created. The following table shows the default +numerical values for some of the commonest outside-staff objects +which are, by default, placed in the @code{Staff} or @code{Voice} +contexts. + +@cindex spanners + +Note the unusual names for some of the objects: spanner objects +are automatically created to control the vertical positioning of +grobs which (might) start and end at different musical moments, so +changing the @code{outside-staff-priority} of the underlying grob +will have no effect. For example, changing +@code{outside-staff-priority} of the @code{Hairpin} object will +have no effect on the vertical positioning of hairpins -- you must +change @code{outside-staff-priority} of the associated +@code{DynamicLineSpanner} object instead. This override must be +placed at the start of the spanner, which might include several +linked hairpins and dynamics. @multitable @columnfractions .3 .3 .3 @headitem Layout Object @@ -1980,14 +1994,13 @@ these. % Start Ottava Bracket \ottava #1 c' \startTextSpan -% Add Dynamic Text -c\pp -% Add Dynamic Line Spanner -c\< +% Add Dynamic Text and hairpin +c\pp\< +c % Add Text Script c^Text c c -% Add Dynamic Text +% Add Dynamic Text and terminate hairpin c\ff c \stopTextSpan % Stop Ottava Bracket \ottava #0 @@ -2594,24 +2607,10 @@ objects outside it are moved. The @code{right-padding} property affects the spacing between the accidental and the note to which it applies. It is not often -required, but the following example shows one situation where it -is needed. Suppose we wish to show a chord containing both -a B-natural and a B-flat. To avoid ambiguity we would like to -precede the notes with both a natural and a flat sign. Here -are a few attempts to do this: - -@lilypond[quote,fragment,ragged-right,verbatim,relative=2] - - - -@end lilypond - -None work, with the second two showing bad collisions between -the two signs. - -One way of achieving this is to override the accidental stencil -with a markup containing the natural and flat symbols in the -order we would like, like this: +required, but the default spacing may be wrong for certain special +accidental glyphs or combination of glyphs used in some microtonal +music. These have to be entered by overriding the accidental +stencil with a markup containing the desired symbol(s), like this: @cindex Accidental, example of overriding @cindex text property, example @@ -2620,13 +2619,20 @@ order we would like, like this: @cindex right-padding property, example @lilypond[quote,ragged-right,verbatim] -naturalplusflat = \markup { \natural \flat } +sesquisharp = \markup { \sesquisharp } \relative c'' { + c + % This prints a sesquisharp but the spacing is too small \once \override Accidental #'stencil = #ly:text-interface::print - \once \override Accidental #'text = #naturalplusflat - \once \override Score.AccidentalPlacement #'right-padding = #1.5 - + \once \override Accidental #'text = #sesquisharp + cis c + % This improves the spacing + \once \override Score.AccidentalPlacement #'right-padding = #0.6 + \once \override Accidental + #'stencil = #ly:text-interface::print + \once \override Accidental #'text = #sesquisharp + cis } @end lilypond @@ -2634,9 +2640,9 @@ naturalplusflat = \markup { \natural \flat } This necessarily uses an override for the accidental stencil which will not be covered until later. The stencil type must be a procedure, here changed to print the contents of the @code{text} -property of @code{Accidental}, which itself is set to be a natural -sign followed by a flat sign. These are then moved further away -from the note head by overriding @code{right-padding}. +property of @code{Accidental}, which itself is set to be a +sesquisharp sign. This sign is then moved further away from the +note head by overriding @code{right-padding}. @noindent @@ -2903,7 +2909,8 @@ dynamics, fingering and pedalling. @c The following should appear as music without code @c This example should not be indexed -@lilypond[quote,ragged-right] +@c line-width ensures no break +@lilypond[quote,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | @@ -2915,7 +2922,7 @@ rhMusic = \relative c'' { \mergeDifferentlyDottedOn bes2.^\markup {\bold "Moderato"} r8 << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ % Reposition the c2 to the right of the merged note {c,8~ \once \override NoteColumn #'force-hshift = #1.0 @@ -2966,7 +2973,8 @@ by entering the notes as two variables and setting up the staff structure in a score block, and see what LilyPond produces by default: -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,verbatim,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4. g8 | bes1~ | @@ -3007,15 +3015,15 @@ lhMusic = \relative c' { } @end lilypond -All the notes are right, but the appearance is far from satisfactory. -The tie clashes with the change in time signature, the beaming in the -third bar is wrong, the notes are not merged together, and several -notation elements are missing. Let's first deal with the easier -things. We can correct the beaming by inserting a beam manually, and -we can easily add the left hand slur and the right hand phrasing slur, +All the notes are right, but the appearance is far from +satisfactory. The tie clashes with the change in time signature, +the notes are not merged together, and several notation elements +are missing. Let's first deal with the easier things. We can +easily add the left hand slur and the right hand phrasing slur, since these were all covered in the Tutorial. Doing this gives: -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,verbatim,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | bes1~ | @@ -3023,7 +3031,7 @@ rhMusic = \relative c'' { bes2. r8 % Start polyphonic section of four voices << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ {c,8~ c2 | } \\ @@ -3076,7 +3084,8 @@ to 3.5 half staff spaces above the center line: This completes bar two, giving: -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,verbatim,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 @@ -3086,7 +3095,7 @@ rhMusic = \relative c'' { bes2. r8 % Start polyphonic section of four voices << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ {c,8~ c2 | } \\ @@ -3122,9 +3131,9 @@ lhMusic = \relative c' { On to bar three and the start of the Moderato section. The tutorial showed how to add embolded text with the @code{\markup} command, so adding @q{Moderato} in bold is easy. But how do we merge notes in -different voices together? This is where we need to turn to the -Notation Reference for help. A search for @qq{merge} in the Notation -Reference index quickly leads us to the commands for merging +different voices together? This is where we need to turn again to +the Notation Reference for help. A search for @qq{merge} in the +Notation Reference index quickly leads us to the commands for merging differently headed and differently dotted notes in @ruser{Collision resolution}. In our example we need to merge both types of note for the duration of the polyphonic section in bar 3, so using the @@ -3146,7 +3155,8 @@ to the start of that section and @noindent to the end, giving: -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 @@ -3158,7 +3168,7 @@ rhMusic = \relative c'' { \mergeDifferentlyDottedOn % Start polyphonic section of four voices << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ {c,8~ c2 | } \\ @@ -3211,7 +3221,8 @@ Applying these changes gives: @cindex Tie, example of overriding @cindex staff-position property, example -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,verbatim,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 @@ -3223,7 +3234,7 @@ rhMusic = \relative c'' { \mergeDifferentlyDottedOn % Start polyphonic section of four voices << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ % Move the c2 out of the main note column so the merge will work {c,8~ \shiftOnn c2 | } @@ -3271,7 +3282,8 @@ the @code{force-hshift} property. Here's the final result: @cindex Stem, example of overriding @cindex transparent property, example -@lilypond[quote,verbatim,ragged-right] +@c line-width ensures no break +@lilypond[quote,verbatim,ragged-right,line-width=5.5\in] rhMusic = \relative c'' { r2 c4.\( g8 | @@ -3283,7 +3295,7 @@ rhMusic = \relative c'' { \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn << - {c,8[ d fis bes a] | } + {c,8 d fis bes a | } \\ % Reposition the c2 to the right of the merged note {c,8~ \once \override NoteColumn #'force-hshift = #1.0 @@ -3901,7 +3913,7 @@ LilyPond internal operation. Further explanation of these files is currently outside the scope of this manual, as a knowledge of the Scheme language is required. Users should be warned that a substantial amount of technical knowledge or time is required -to understand Scheme and these files (see @ref{Scheme tutorial}). +to understand Scheme and these files (see @rextend{Scheme tutorial}). If you have this knowledge, the Scheme files which may be of interest are: @@ -3962,7 +3974,7 @@ interface to the LilyPond internal operation. Code written in the Scheme programming language can be incorporated directly in the internal operation of LilyPond. Of course, at least a basic knowledge of programming in Scheme is required to do this, and an -introduction is provided in the @ref{Scheme tutorial}. +introduction is provided in the @rextend{Scheme tutorial}. As an illustration of one of the many possibilities, instead of setting a property to a constant it can be set to a Scheme @@ -4007,7 +4019,7 @@ the staff. @end lilypond Further examples showing the use of these programmable interfaces -can be found in @ref{Tweaking with Scheme}. +can be found in @rextend{Tweaking with Scheme}.