]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly
Release: update news.
[lilypond.git] / Documentation / snippets / horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly
index 34cc269cc019b80b9939516f253d9e24280241ab..b515ee328279c9894bd436a52f41de9208266815 100644 (file)
@@ -1,13 +1,14 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.14.2"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.19.56
+\version "2.19.56"
 
 \header {
 
 \header {
-  lsrtags = "correction-wanted, expressive-marks, tweaks-and-overrides, version-specific"
+  lsrtags = "expressive-marks, tweaks-and-overrides, version-specific"
 
   texidoc = "
 Some dynamic expressions involve additional text, like @qq{sempre pp}.
 
   texidoc = "
 Some dynamic expressions involve additional text, like @qq{sempre pp}.
@@ -17,16 +18,18 @@ displayed way after the note it applies to.
 To correctly align the @qq{sempre pp} horizontally, so that it is
 aligned as if it were only the \\pp, there are several approaches:
 
 To correctly align the @qq{sempre pp} horizontally, so that it is
 aligned as if it were only the \\pp, there are several approaches:
 
-* Simply use @code{\\once\\override DynamicText #'X-offset = #-9.2}
+* Simply use @code{\\once\\override DynamicText.X-offset = #-9.2}
 before the note with the dynamics to manually shift it to the correct
 position. Drawback: This has to be done manually each time you use that
 before the note with the dynamics to manually shift it to the correct
 position. Drawback: This has to be done manually each time you use that
-dynamic markup... * Add some padding (@code{#:hspace 7.1}) into the
-definition of your custom dynamic mark, so that after lilypond
-center-aligns it, it is already correctly aligned. Drawback: The
-padding really takes up that space and does not allow any other markup
-or dynamics to be shown in that position.
+dynamic markup...
 
 
-* Shift the dynamic script @code{\\once\\override ... #'X-offset = ..}.
+* Add some padding (@code{#:hspace 7.1}) into the definition of your
+custom dynamic mark, so that after lilypond center-aligns it, it is
+already correctly aligned. Drawback: The padding really takes up that
+space and does not allow any other markup or dynamics to be shown in
+that position.
+
+* Shift the dynamic script @code{\\once\\override ... .X-offset = ..}.
 Drawback: @code{\\once\\override} is needed for every invocation!
 
 * Set the dimensions of the additional text to 0 (using
 Drawback: @code{\\once\\override} is needed for every invocation!
 
 * Set the dimensions of the additional text to 0 (using
@@ -41,7 +44,7 @@ dynamic-script.
 
 * Set an explicit alignment inside the dynamic-script. By default, this
 won't have any effect, only if one sets X-offset! Drawback: One needs
 
 * Set an explicit alignment inside the dynamic-script. By default, this
 won't have any effect, only if one sets X-offset! Drawback: One needs
-to set @code{DynamicText #'X-offset}, which will apply to all dynamic
+to set @code{DynamicText.X-offset}, which will apply to all dynamic
 texts! Also, it is aligned at the right edge of the additional text,
 not at the center of pp.
 
 texts! Also, it is aligned at the right edge of the additional text,
 not at the center of pp.
 
@@ -52,10 +55,11 @@ not at the center of pp.
   doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\" \"piu f\" \"subito p\")"
 } % begin verbatim
 
   doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\" \"piu f\" \"subito p\")"
 } % begin verbatim
 
+\paper {
+  ragged-right = ##f
+  indent = 2.5\cm
+} % begin verbatim
 
 
-\header { title = "Horizontally aligning custom dynamics" }
-
-\paper { ragged-right = ##f }
 
 % Solution 1: Using a simple markup with a particular halign value
 % Drawback: It's a markup, not a dynamic command, so \dynamicDown
 
 % Solution 1: Using a simple markup with a particular halign value
 % Drawback: It's a markup, not a dynamic command, so \dynamicDown
@@ -63,7 +67,7 @@ not at the center of pp.
 semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" }
 
 % Solution 2: Using a dynamic script & shifting with
 semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" }
 
 % Solution 2: Using a dynamic script & shifting with
-%             \once \override ... #'X-offset = ..
+%             \once \override ...X-offset = ..
 % Drawback: \once \override needed for every invocation
 semppK =
 #(make-dynamic-script
 % Drawback: \once \override needed for every invocation
 semppK =
 #(make-dynamic-script
@@ -108,7 +112,7 @@ semppG =
 
 % Solution 6: Dynamic with explicit alignment. This has only effect
 %             if one sets X-offset!
 
 % Solution 6: Dynamic with explicit alignment. This has only effect
 %             if one sets X-offset!
-% Drawback: One needs to set DynamicText #'X-offset!
+% Drawback: One needs to set DynamicText.X-offset!
 % Drawback: Aligned at the right edge of the additional text,
 %           not at the center of pp
 semppMII =
 % Drawback: Aligned at the right edge of the additional text,
 %           not at the center of pp
 semppMII =
@@ -118,60 +122,74 @@ semppMII =
                   #:italic "sempre"
                   #:dynamic "pp")))
 
                   #:italic "sempre"
                   #:dynamic "pp")))
 
-\context StaffGroup <<
-  \context Staff = "s" <<
-    \set Staff.instrumentName = #"Normal"
+\new StaffGroup <<
+  \new Staff = "s" \with { instrumentName = \markup \column { Normal } }
+  <<
     \relative c'' {
       \key es \major
       c4\pp c\p c c | c\ff c c\pp c
     }
   >>
     \relative c'' {
       \key es \major
       c4\pp c\p c c | c\ff c c\pp c
     }
   >>
-  \context Staff = "sMarkup" <<
-    \set Staff.instrumentName = \markup \column { Normal markup }
+  \new Staff = "sMarkup" \with {
+    instrumentName = \markup \column { Normal markup }
+  }
+  <<
     \relative c'' {
       \key es \major
       c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c
     }
   >>
     \relative c'' {
       \key es \major
       c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c
     }
   >>
-  \context Staff = "sK" <<
-    \set Staff.instrumentName = \markup \column { Explicit shifting }
+  \new Staff = "sK" \with {
+    instrumentName = \markup \column { Explicit shifting }
+  }
+  <<
     \relative c'' {
       \key es \major
     \relative c'' {
       \key es \major
-      \once \override DynamicText #'X-offset = #-9.2
+      \once \override DynamicText.X-offset = #-9.2
       c4\semppK c\p c c
       c4\ff c
       c4\semppK c\p c c
       c4\ff c
-      \once \override DynamicText #'X-offset = #-9.2
+      \once \override DynamicText.X-offset = #-9.2
       c4\semppK c
     }
   >>
       c4\semppK c
     }
   >>
-  \context Staff = "sT" <<
-    \set Staff.instrumentName = \markup \column { Right padding }
+  \new Staff = "sT" \with {
+    instrumentName = \markup \column { Right padding }
+  }
+  <<
     \relative c'' {
       \key es \major
       c4\semppT c\p c c | c\ff c c\semppT c
     }
   >>
     \relative c'' {
       \key es \major
       c4\semppT c\p c c | c\ff c c\semppT c
     }
   >>
-  \context Staff = "sM" <<
-    \set Staff.instrumentName = \markup \column { Setting dimension "to zero" }
+  \new Staff = "sM" \with {
+    instrumentName = \markup \column { Set dimension "to zero" }
+  }
+  <<
     \relative c'' {
       \key es \major
       c4\semppM c\p c c | c\ff c c\semppM c
     }
   >>
     \relative c'' {
       \key es \major
       c4\semppM c\p c c | c\ff c c\semppM c
     }
   >>
-  \context Staff = "sG" <<
-    \set Staff.instrumentName = \markup \column { Shifting inside dynamics }
+  \new Staff = "sG" \with {
+    instrumentName = \markup \column { Shift inside dynamics}
+  }
+  <<
     \relative c'' {
       \key es \major
       c4\semppG c\p c c | c\ff c c\semppG c
     }
   >>
     \relative c'' {
       \key es \major
       c4\semppG c\p c c | c\ff c c\semppG c
     }
   >>
-  \context Staff = "sMII" <<
-    \set Staff.instrumentName = \markup \column { Alignment inside dynamics }
+  \new Staff = "sMII" \with {
+    instrumentName = \markup \column { Alignment inside dynamics }
+  }
+  <<
     \relative c'' {
       \key es \major
       % Setting to ##f (false) gives the same result
     \relative c'' {
       \key es \major
       % Setting to ##f (false) gives the same result
-      \override DynamicText #'X-offset = #0
+      \override DynamicText.X-offset = #0
       c4\semppMII c\p c c | c\ff c c\semppMII c
     }
   >>
 >>
       c4\semppMII c\p c c | c\ff c c\semppMII c
     }
   >>
 >>
+
+\layout { \override Staff.InstrumentName.self-alignment-X = #LEFT }