lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different dynamic 1st and 2nd time in a repeat.


From: Ritchie Fraser
Subject: Re: Different dynamic 1st and 2nd time in a repeat.
Date: Fri, 20 Nov 2020 18:49:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Thanks Aaron,

That  look like a really useful wrapper. I shall steal with pride and add into my snippets :-)

Ritchie

On 18/11/2020 04:13, Aaron Hill wrote:
On 2020-11-17 4:42 pm, Ritchie Fraser wrote:
Hi Mark,

This wasn't quite what I was looking for, but thank you for your suggestion.

Knute was spot on what I was looking for.

  \repeat volta 2 {
    d'2.( -\markup { \dynamic "p - f" } |
    c4. bf) |
  }

If you do this sort of thing often enough, perhaps this wrapper function may be useful:

%%%%
\version "2.20.0"

#(define (dynamic-event? arg)
  (and (ly:music? arg)
       (music-is-of-type? arg 'dynamic-event)))

dynamicPair =
#(define-music-function
  (first second)
  (dynamic-event? dynamic-event?)
  #{ %% Use DynamicText alignment for TextScript
     -\tweak parent-alignment-X #CENTER
     -\tweak self-alignment-X #CENTER
     -\markup \concat {
       \dynamic #(ly:music-property first 'text)
       \pad-x #0.25 \char ##x2013 %% En Dash
       \dynamic #(ly:music-property second 'text)
     } #})

%% Can use \dynamicPair directly in music or to define
%% commonly-used dynamics.  Supports make-dynamic-script.

mp-ff = \dynamicPair \mp \ff
{ b'4 _\mp-ff ^\dynamicPair \sp #(make-dynamic-script "zzz") }
%%%%


-- Aaron Hill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]