X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fhorizontally-aligning-custom-dynamics-e.g.-sempre-pp%2C-piu-f%2C-subito-p.ly;h=0457dcfcb0b6d8b2f79b5e316889f3ddfe80d385;hb=b97565a9af1c13369ac7e7e9ea80c2638dbc0e51;hp=ed761990aa106f75f57bc5fa8271690b321cd4f3;hpb=99552330a45304e455f547bd0f668aaf7b09a558;p=lilypond.git diff --git a/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly b/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly index ed761990aa..0457dcfcb0 100644 --- a/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly +++ b/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly @@ -1,6 +1,6 @@ %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it %% This file is in the public domain. -\version "2.13.0" +\version "2.13.1" \header { lsrtags = "expressive-marks, tweaks-and-overrides" @@ -49,70 +49,113 @@ not at the center of pp. } % begin verbatim \header { title = "Horizontally aligning custom dynamics" } -\layout { ragged-right = ##t } + +\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 etc. will have no effect +% Drawback: It's a markup, not a dynamic command, so \dynamicDown +% etc. will have no effect semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" } -% Solution 2: Using a dynamic script and shifting with \once\override ... #'X-offset = .. -% Drawback: \once\override needed for every invocation -semppK = #(make-dynamic-script (markup #:line( #:normal-text #:italic "sempre" #:dynamic "pp"))) - -% Solution 3: Padding the dynamic script so the center-alignment puts it to the correct position +% Solution 2: Using a dynamic script & shifting with +% \once \override ... #'X-offset = .. +% Drawback: \once \override needed for every invocation +semppK = +#(make-dynamic-script + (markup #:line + (#:normal-text + #:italic "sempre" + #:dynamic "pp"))) + +% Solution 3: Padding the dynamic script so the center-alignment +% puts it at the correct position % Drawback: the padding really reserves the space, nothing else can be there -semppT = #( - make-dynamic-script ( - markup #:line ( - #:normal-text #:italic "sempre" #:dynamic "pp" #:hspace 7.1 - ) - ) -) +semppT = +#(make-dynamic-script + (markup #:line + (#: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 other stuff there => collisions -% Drawback: Also, there seems to be some spacing, so it's not exactly the +% Drawback: To lilypond "sempre" has no extent, so it might put +% other stuff there => collisions +% Drawback: Also, there seems to be some spacing, so it's not exactly the % 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"))) +semppM = +#(make-dynamic-script + (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 +semppG = +#(make-dynamic-script (markup - #:hspace 0 #:translate (cons -18.85 0 ) - #:line( #:normal-text #:italic "sempre" #:dynamic "pp")) -) + #: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"))) - +semppMII = +#(make-dynamic-script (markup #:line(#:right-align + #:normal-text #:italic "sempre" #:dynamic "pp"))) \context StaffGroup << - \context Staff="s" << \set Staff.instrumentName = "Normal" - \relative c'' { \key es \major c4\pp c\p c c | c\ff c c\pp c } + \context Staff = "s" << + \set Staff.instrumentName = "Normal" + \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"} - \relative c'' { \key es \major c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c} + \context Staff = "sMarkup" << + \set Staff.instrumentName = \markup \column { Normal markup } + \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"} - \relative c'' { \key es \major - \once \override DynamicText #'X-offset = #-9.2 c4\semppK c\p c c | - c\ff c \once \override DynamicText #'X-offset = #-9.2 c\semppK c } + \context Staff = "sK" << + \set Staff.instrumentName = \markup \column { Explicit shifting } + \relative c'' { + \key es \major + \once \override DynamicText #'X-offset = #-9.2 + c4\semppK c\p c c + c4\ff c + \once \override DynamicText #'X-offset = #-9.2 + c4\semppK c + } >> - \context Staff="sT" << \set Staff.instrumentName = \markup\column{"Right" "padding"} - \relative c'' { \key es \major c4\semppT c\p c c | c\ff c c\semppT c } + \context Staff = "sT" << + \set Staff.instrumentName = \markup \column { Right padding } + \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"} - \relative c'' { \key es \major c4\semppM c\p c c | c\ff c c\semppM c } + \context Staff = "sM" << + \set Staff.instrumentName = \markup \column { Setting dimension "to zero" } + \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"} - \relative c'' { \key es \major c4\semppG c\p c c | c\ff c c\semppG c} + \context Staff = "sG" << + \set Staff.instrumentName = \markup \column { Shifting inside dynamics } + \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 } + \relative c'' { + \key es \major + % Setting to ##f (false) gives the same result + \override DynamicText #'X-offset = #0 + c4\semppMII c\p c c | c\ff c c\semppMII c + } >> - \context Staff="sMII" << \set Staff.instrumentName = \markup\column{"Alignment" "inside" "dynamics"} - \relative c'' { \key es \major - \override DynamicText #'X-offset = #0 % Setting to ##f (false) gives the same resul - c4\semppMII c\p c c | c\ff c c\semppMII c } - >> >> -