Vertical alignment of custom dynamics

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Vertical alignment of custom dynamics

Gregor Smith
Hi everyone!

I have a repeated section of music with a different dynamic on each repeat. As such, I've used a markup object to create the text "mp - f" in the dynamic font. Because the music is piano music, my dynamics are in their own Dynamics context.

My problem is that my custom dynamics don't vertically align with my regular dynamics (see attached MWE and output). I've tried various techniques:
  • staff-padding doesn't work because the dynamics aren't attached to either staff
  • raise #1, using a \null object as an anchor point, doesn't work because there's no staff as a reference point

Does anybody know if there's a way to vertically align custom dynamics with regulat dynamics, or even if there's a LilyPond object for repeated dynamics?

Thanks

Gregor


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

dynamics.ly (778 bytes) Download Attachment
vertical alignment dynamics.png (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Vertical alignment of custom dynamics

Martin Neubauer


On 06/08/2017 00:19, Gregor Smith wrote:

> \version "2.16.0"
>
> \include "common.ly"
>
> upper = \relative c'' {
>   \clef treble
>   \key c \major
>   \time 2/4
>   c2
>   \repeat volta 2 {
>     d | e
>   }
> }
>
>
> lower = \relative c' {
>   \clef bass
>   \key c \major
>   \time 2/4
>   c2
>   \repeat volta 2 {
>     d | e
>   }
> }
>
> mpf = \markup  { \dynamic { mp } "-" \dynamic { f } }
mpf = #(make-dynamic-script "mp - f")

or a little more elaborate:

mpf = #(make-dynamic-script
        (markup #:dynamic "mp"
          #:normal-text #:italic #:bold "-"
          #:dynamic "f"))
(The latter form isn't necessarily preferable in this instance, but
gives you an example how to achieve more fine-grained control over the
formatting if needed.)

>
> dynamics = {
>   s2\mp
>   \repeat volta 2 {
>     s2-\mpf | R2
>   }
> }
>
>
>
> \score {
>
>   \new PianoStaff <<
>     \new Staff = "upper" \upper
>     \new Dynamics = "dynamics" \dynamics
>     \new Staff = "lower" \lower
>   >>
> }
--
Ceci n'est pas une signature.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Vertical alignment of custom dynamics

Gregor Smith
Thanks, that worked. Had to change the horizontal alignment but now I have exactly what I was looking for.

On 6 August 2017 at 00:46, Martin Neubauer <[hidden email]> wrote:


On 06/08/2017 00:19, Gregor Smith wrote:
> \version "2.16.0"
>
> \include "common.ly"
>
> upper = \relative c'' {
>   \clef treble
>   \key c \major
>   \time 2/4
>   c2
>   \repeat volta 2 {
>     d | e
>   }
> }
>
>
> lower = \relative c' {
>   \clef bass
>   \key c \major
>   \time 2/4
>   c2
>   \repeat volta 2 {
>     d | e
>   }
> }
>
> mpf = \markup  { \dynamic { mp } "-" \dynamic { f } }
mpf = #(make-dynamic-script "mp - f")

or a little more elaborate:

mpf = #(make-dynamic-script
        (markup #:dynamic "mp"
          #:normal-text #:italic #:bold "-"
          #:dynamic "f"))
(The latter form isn't necessarily preferable in this instance, but
gives you an example how to achieve more fine-grained control over the
formatting if needed.)
>
> dynamics = {
>   s2\mp
>   \repeat volta 2 {
>     s2-\mpf | R2
>   }
> }
>
>
>
> \score {
>
>   \new PianoStaff <<
>     \new Staff = "upper" \upper
>     \new Dynamics = "dynamics" \dynamics
>     \new Staff = "lower" \lower
>   >>
> }
--
Ceci n'est pas une signature.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Loading...