Horizontally aligning custom dynamics like “più f”: Difference between revisions
Simplify |
mNo edit summary |
||
| Line 3: | Line 3: | ||
To correctly align the “sempre '''pp'''” horizontally so that it is aligned as if it were only the \pp, there are several approaches: | To correctly align the “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</code> 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... | * Simply use <code>\once \override DynamicText.X-offset = #-9.2</code> 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</code>) 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. | * Add some padding (<code>#:hspace 7.1</code>) 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 = ...</code>. Drawback: <code>\once\override</code> is needed for every invocation! | * Shift the dynamic script <code>\once \override ... .X-offset = ...</code>. Drawback: <code>\once \override</code> is needed for every invocation! | ||
* Set the dimensions of the additional text to 0 (using <code>#:with-dimensions '(0 . 0) '(0 . 0)</code>). Drawback: For LilyPond, “sempre” has no extent now. This means it might put other stuff there, causing collisions (which are not detected by LilyPond's collision detection algorithm!). There also seems to be some spacing, so it is not exactly the same alignment as without the additional text. | * Set the dimensions of the additional text to 0 (using <code>#:with-dimensions '(0 . 0) '(0 . 0)</code>). Drawback: For LilyPond, “sempre” has no extent now. This means it might put other stuff there, causing collisions (which are not detected by LilyPond's collision detection algorithm!). There also seems to be some spacing, so it is not exactly the same alignment as without the additional text. | ||
* Add an explicit shift directly inside the scheme function for the dynamic script. | * Add an explicit shift directly inside the scheme function for the dynamic script. | ||
* Set an explicit alignment inside the dynamic script. By default, this won't have any effect, only if one sets <code>X-offset</code>! Drawback: One needs to set <code>DynamicText.X-offset</code>, 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. | * Set an explicit alignment inside the dynamic script. By default, this won't have any effect, only if one sets <code>X-offset</code>! Drawback: One needs to set <code>DynamicText.X-offset</code>, 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. | ||