X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fhorizontally-aligning-custom-dynamics-e.g.-sempre-pp%2C-piu-f%2C-subito-p.ly;h=5e43ce53338300b6439c4a5bdf407670af011a28;hb=1c7aa062c6cec594b68479b240db33399f80f4e6;hp=6d8b7036cc758fa02145d3955d3e5d15bc81258a;hpb=92782fde87fb68e945b9eb60cacab6c01d0397df;p=lilypond.git diff --git a/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly b/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly index 6d8b7036cc..5e43ce5333 100644 --- a/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly +++ b/Documentation/snippets/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly @@ -1,35 +1,40 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it +%% DO NOT EDIT this file manually; it is automatically +%% generated from LSR http://lsr.di.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.13.4" +\version "2.18.0" \header { - lsrtags = "expressive-marks, tweaks-and-overrides" + lsrtags = "expressive-marks, tweaks-and-overrides, version-specific" texidoc = " -Some dynamic expressions involve additional text, like \"sempre pp\". -Since lilypond aligns all dynamics centered on the note, the \\pp would -be displayed way after the note it applies to. +Some dynamic expressions involve additional text, like @qq{sempre pp}. +Since dynamics are usually centered under the note, the \\pp would be +displayed way after the note it applies to. -To correctly align the \"sempre \\pp\" horizontally, so that it is +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 -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 -@code{#:with-dimensions '(0 . 0) '(0 . 0)}). Drawback: To lilypond -\"sempre\" has no extent, so it might put other stuff there and create -collisions (which are not detected by the collision dection!). Also, +@code{#:with-dimensions '(0 . 0) '(0 . 0)}). Drawback: To LilyPond +@qq{sempre} has no extent, so it might put other stuff there and create +collisions (which are not detected by the collision detection!). Also, there seems to be some spacing, so it's not exactly the same alignment as without the additional text @@ -38,7 +43,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 -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. @@ -46,12 +51,13 @@ not at the center of pp. " - doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\", \"piu f\", \"subito p\")" + doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\" \"piu f\" \"subito p\")" } % begin verbatim -\header { title = "Horizontally aligning custom dynamics" } - -\paper { ragged-right = ##f } +\paper { + ragged-right = ##f + indent = 2.5\cm +} % Solution 1: Using a simple markup with a particular halign value % Drawback: It's a markup, not a dynamic command, so \dynamicDown @@ -59,14 +65,14 @@ not at the center of pp. 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 (markup #:line - (#:normal-text - #:italic "sempre" - #:dynamic "pp"))) + (#:normal-text + #:italic "sempre" + #:dynamic "pp"))) % Solution 3: Padding the dynamic script so the center-alignment % puts it at the correct position @@ -74,10 +80,10 @@ semppK = semppT = #(make-dynamic-script (markup #:line - (#:normal-text - #:italic "sempre" - #:dynamic "pp" - #:hspace 7.1))) + (#:normal-text + #:italic "sempre" + #:dynamic "pp" + #:hspace 7.1))) % Solution 4: Dynamic, setting the dimensions of the additional text to 0 % Drawback: To lilypond "sempre" has no extent, so it might put @@ -86,27 +92,39 @@ semppT = % same alignment as without the additional text semppM = #(make-dynamic-script - (markup #:line (#:with-dimensions '(0 . 0) '(0 . 0) - #:right-align #:normal-text #:italic "sempre" #:dynamic "pp"))) + (markup #:line + (#:with-dimensions '(0 . 0) '(0 . 0) + #:right-align + #:normal-text + #:italic "sempre" + #:dynamic "pp"))) % Solution 5: Dynamic with explicit shifting inside the scheme function semppG = #(make-dynamic-script - (markup - #:hspace 0 #:translate '(-18.85 . 0) - #:line( #:normal-text #:italic "sempre" #:dynamic "pp"))) - -% Solution 6: Dynamic with explicit alignment. This has only effect, if one sets 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 + (markup #:hspace 0 + #:translate '(-18.85 . 0) + #:line (#:normal-text + #:italic "sempre" + #:dynamic "pp"))) + +% Solution 6: Dynamic with explicit alignment. This has only effect +% if one sets 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 = -#(make-dynamic-script (markup #:line(#:right-align - #:normal-text #:italic "sempre" #:dynamic "pp"))) +#(make-dynamic-script + (markup #:line (#:right-align + #:normal-text + #:italic "sempre" + #:dynamic "pp"))) \context StaffGroup << \context Staff = "s" << - \set Staff.instrumentName = "Normal" + \set Staff.instrumentName = #"Normal" \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \key es \major c4\pp c\p c c | c\ff c c\pp c } @@ -114,6 +132,7 @@ semppMII = \context Staff = "sMarkup" << \set Staff.instrumentName = \markup \column { Normal markup } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \key es \major c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c } @@ -121,17 +140,19 @@ semppMII = \context Staff = "sK" << \set Staff.instrumentName = \markup \column { Explicit shifting } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \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 - \once \override DynamicText #'X-offset = #-9.2 + \once \override DynamicText.X-offset = #-9.2 c4\semppK c } >> \context Staff = "sT" << \set Staff.instrumentName = \markup \column { Right padding } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \key es \major c4\semppT c\p c c | c\ff c c\semppT c } @@ -139,6 +160,7 @@ semppMII = \context Staff = "sM" << \set Staff.instrumentName = \markup \column { Setting dimension "to zero" } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \key es \major c4\semppM c\p c c | c\ff c c\semppM c } @@ -146,6 +168,7 @@ semppMII = \context Staff = "sG" << \set Staff.instrumentName = \markup \column { Shifting inside dynamics } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \key es \major c4\semppG c\p c c | c\ff c c\semppG c } @@ -153,9 +176,10 @@ semppMII = \context Staff = "sMII" << \set Staff.instrumentName = \markup \column { Alignment inside dynamics } \relative c'' { + \override Staff.InstrumentName.self-alignment-X = #LEFT \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 } >>