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: Aaron Hill
Subject: Re: Different dynamic 1st and 2nd time in a repeat.
Date: Tue, 17 Nov 2020 20:13:00 -0800
User-agent: Roundcube Webmail/1.4.9

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

Attachment: multi-dyn.cropped.png
Description: PNG image


reply via email to

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