adding-beams,-slurs,-ties-etc.-when-using-tuplet-and-non-tuplet-rythms..ly
LilyPond syntax can involve many unusual placements for parentheses, brackets etc., which might sometimes have to be interleaved.For example, when entering a manual beam, the left square bracket has to be placed after the starting note and its duration, not before. Similarly, the right square bracket should directly follow the note which is to be at the end of the requested beaming, even if this note happens to be inside a tuplet section. This snippet demonstrates how to superpose manual beaming, manual slurs, ties, and phrasing slurs, while using tuplet sections (enclosed with curly braces).
{ r16[ g16 \times 2/3 {r16 e'8] } g16( a \times 2/3 {b d e') } g8[( a \times 2/3 {b d') e'~]} \times 4/5 {e'32\( a b d' e'} a'4.\) }
adding-parentheses-around-an-expressive-mark.ly
The parenthesize function is a special tweak that encloses objects in parentheses. The associated grob is Score.ParenthesesItem.
\relative { c4 -\parenthesize -. \override ParenthesesItem #'padding = #0.1 <d \parenthesize fis a> }
Breathing signs are available in different tastes: commas (default), ticks, vees and `railroad tracks' (caesura).
{ %% Modern notation: \new Staff { \relative c'' { \key es \major \time 3/4 %% this bar contains no \breathe << { g4 as g } \\ { es4 bes es } >> | %% by default, \breathe uses the rcomma, just as if saying: %% \override BreathingSign #'text = % #(make-musicglyph-markup "scripts.rcomma") << { g4 as g } \\ { es4 \breathe bes es } >> | %% rvarcomma and lvarcomma are variations of the default rcomma %% and lcomma %% N.B.: must use Staff context here, since we start a Voice below \override Staff.BreathingSign #'text = #(make-musicglyph-markup "scripts.rvarcomma") << { g4 as g } \\ { es4 \breathe bes es } >> | %% wedge \override BreathingSign #'text = #(make-musicglyph-markup "scripts.upbow") es8 d es f g8 \breathe f | %% caesura \override BreathingSign #'text = #(make-musicglyph-markup "scripts.caesura.curved") es8[ d] \breathe es[ f g f] | es2 r4 \bar "||" \break } } }
In order to make parts of a crescendo hairpin invisible, the following method is used: A white rectangle is drawn on top of the respective part of the crescendo hairpin, making it invisible. the rectangle is defined as postscript code within a text markup. In order to fine tune the position and size of the markup, the number preceding the "setgray" in the postscript definition can be set to a value <1 making it grey. The two numbes before the "scale" in the postscript code are responsible for the width and height of the rectangle, the two numbers before the "translate" change the x- and y-origin of the rectangle. Make sure to put the Hairpin in a lower layer than the Text Markup to actually draw the rectangle above the hairpin.
\score { \relative c' { << { \dynamicUp \override DynamicLineSpanner #'staff-padding = #4 r2 r16 c'8.\pp r4 } \\ { \override DynamicLineSpanner #'layer = #0 des,2~\mf \< \override TextScript #'layer = #2 des16_\markup { \postscript #"1.9 -4.5 translate 5 4 scale 1 setgray 0 0 moveto 0 1 lineto 1 1 lineto 1 0 lineto 0 0 lineto fill" } r8. des4~ des16-> \sff } >> } \layout { ragged-right = ##t} }
caesura-railtracks-with-fermata.ly
A caesura is sometimes denoted with a double "railtracks" breath mark with a fermata sign positioned over the top of the railtracks. This snippet should present an optically pleasing combination of railtracks and a fermata.
{ \context Voice { c''2. % use some scheme code to construct the symbol \override BreathingSign #'text = #(markup #:line (#:musicglyph "scripts.caesura.curved" #:translate (cons -1.75 1.6) #:musicglyph "scripts.ufermata" )) \breathe c''4 % set the breathe mark back to normal \revert BreathingSign #'text c''2. \breathe c''4 \bar "|." } }
center-text-below-hairpin-dynamics.ly
This example provides a function to typeset hairpin (de)crescendo with some additional text below it, such as "molto" or "poco".
The example also illustrates how to use modify the way an object normally is printed, using some Scheme code.
hairpinWithCenteredText = #(define-music-function (parser location text) (markup?) #{ \override Voice.Hairpin #'stencil = #(lambda (grob) (ly:stencil-aligned-to (ly:stencil-combine-at-edge (ly:stencil-aligned-to (ly:hairpin::print grob) X CENTER) Y DOWN (ly:stencil-aligned-to (ly:text-interface::print grob) X CENTER)) X LEFT)) \override Voice.Hairpin #'text = $text #}) hairpinMolto = \hairpinWithCenteredText \markup {\italic "molto"} hairpinMore = \hairpinWithCenteredText \markup {\bigger "moltissimo"} \new Staff { \hairpinMolto c'2\< c'2\f \hairpinMore c'2\< c'2\f }
changing--flageolet-mark-size.ly
To make the \flageolet circle smaller you can use the following scheme code (found in the Lilypond-user-archive)
F = #(let ((m (make-music 'ArticulationEvent 'articulation-type "flageolet"))) (set! (ly:music-property m 'tweaks) (acons 'font-size -3 (ly:music-property m 'tweaks))) m) \relative c'' { d4^\flageolet_\markup {"orginal \flageolet "} d4_\flageolet c4^\F_\markup {smaller } c4_\F }
changing-the-appearance-of-a-slur-from-solid-to-dotted-or-dashed.ly
The appearance of slurs may be changed from solid to dotted or dashed.
\score{ \relative c'{ c( d e c) | \slurDotted c( d e c) | \slurSolid c( d e c) | \slurDashed c( d e c) | \slurSolid c( d e c) | } \layout{ raggedright=##t } }
combining-dynamics-with-markup-texts.ly
Some dynamics may involve text indications (such as "più forte", "piano subito", etc.). They can be produced using a \markup bloc.
\layout{ragged-right = ##t} piuf = \markup { \italic "molto" \dynamic "f" } \relative c''{ c-\piuf c c2\< c2\! c2\< c2\! }
Use a glissando without final note. Contemporary glissando !
creating-real-parenthesized-dynamics.ly
Although the easiest way to add parenthesis to a dynamic mark is to use a \markup block, this method has a downside: the created objects will behave like text markups, and not like dynamics.
However, it is possible to create a similar object using the equivalent Scheme code (as described in "Markup programmer interface"), combined with the make-dynamic-script function. This way, the markup will be regarded as a dynamic, and therefore will remain compatible with commands such as \dynamicUp or \dynamicDown.
\paper { ragged-right = ##t } parenF = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:hspace -0.8 #:dynamic "f" #:normal-text #:italic #:fontsize 2 ")" ))) \score { { c''\parenF c'' c'' \dynamicUp c''\parenF } }
The <code>\startTextSpan</code> and <code>\stopTextSpan</code> commands give you the ability to create text spanners as easily as pedals indications or octavations. Override some properties of the <code>TextSpanner</code> object to modify its output.
\relative c''{ \override TextSpanner #'edge-text = #'("bla" . "blu") a \startTextSpan b c a \stopTextSpan \override TextSpanner #'dash-period = #2 \override TextSpanner #'dash-fraction = #0.0 a \startTextSpan b c a \stopTextSpan \revert TextSpanner #'style \override TextSpanner #'style = #'dashed-line \override TextSpanner #'bound-details #'left #'text = \markup { \draw-line #'(0 . 1) } \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -2) } a \startTextSpan b c a \stopTextSpan \set Staff.middleCPosition = #-13 \override TextSpanner #'dash-period = #10 \override TextSpanner #'dash-fraction = #.5 \override TextSpanner #'thickness = #10 a \startTextSpan b c a \stopTextSpan \set Staff.middleCPosition = #-6 }
Arrows can be applied to text-spanners and line-spanners (such as the Glissando)
\relative c'' { \override TextSpanner #'bound-padding = #1.0 \override TextSpanner #'dash-fraction = #'() \override TextSpanner #'bound-details #'right #'arrow = ##t \override TextSpanner #'bound-details #'left #'text = #"fof" \override TextSpanner #'bound-details #'right #'text = #"gag" \override TextSpanner #'bound-details #'right #'padding = #0.6 \override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #CENTER \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER \override Glissando #'bound-details #'right #'arrow = ##t \override Glissando #'arrow-length = #0.5 \override Glissando #'arrow-width = #0.25 a8\startTextSpan gis8 a4 b4\glissando b,4 | g' c\stopTextSpan c }
piano-template-with-centered-dynamics.ly
Many piano scores have the dynamics centered between the two staves. This requires a bit of tweaking to implement, but since the template is right here, you don't have to do the tweaking yourself.
upper = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } lower = \relative c { \clef bass \key c \major \time 4/4 a2 c } dynamics = { s2\fff\> s4 s\!\pp } pedal = { s2\sustainDown s2\sustainUp } \score { \new PianoStaff << \new Staff = "upper" \upper \new Dynamics = "dynamics" \dynamics \new Staff = "lower" << \clef bass \lower >> \new Dynamics = "pedal" \pedal >> \layout { \context { \type "Engraver_group" \name Dynamics \alias Voice % So that \cresc works, for example. \consists "Output_property_engraver" \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1) \override DynamicLineSpanner #'Y-offset = #0 pedalSustainStrings = #'("Ped." "*Ped." "*") pedalUnaCordaStrings = #'("una corda" "" "tre corde") \consists "Piano_pedal_engraver" \consists "Script_engraver" \consists "Dynamic_engraver" \consists "Text_engraver" \override TextScript #'font-size = #2 \override TextScript #'font-shape = #'italic \consists "Skip_event_swallow_translator" \consists "Axis_group_engraver" } \context { \PianoStaff \accepts Dynamics } } } \score { \new PianoStaff << \new Staff = "upper" << \upper \dynamics >> \new Staff = "lower" << \lower \dynamics >> \new Dynamics = "pedal" \pedal >> \midi { \context { \type "Performer_group" \name Dynamics \consists "Piano_pedal_performer" } \context { \PianoStaff \accepts Dynamics } } }
This page is for LilyPond-2.11.40 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.