lilypond-user
[Top][All Lists]
Advanced

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

Re: Non-printing score-wide dynamics


From: H. S. Teoh
Subject: Re: Non-printing score-wide dynamics
Date: Tue, 3 Mar 2015 12:51:44 -0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Mar 03, 2015 at 04:12:23PM +0000, David Sumbler wrote:
> The first 2 bars of a score are as follows:
> 
> invP = \tweak stencil ##f \p
> 
> \parallelMusic #'(mid Vone Vtwo Va Vc) {
> % bar 0
>       \tempo 4 = 152 \partial 2 r2 |
>       \tempo "Allegro non troppo" 4 = 152 \partial 2 r2 |
>       \tempo "Allegro non troppo" 4 = 152 \partial 2 r2 |
>       \tempo "Allegro non troppo" 4 = 152 \partial 2 r8 a\f a a |
>       \tempo "Allegro non troppo" 4 = 152 \partial 2 r2 |
> % bar 1
>       r1 |
>       r2 r8 a\f a a |
>       r8 a\f a a b4-> a |
>       bf4-> a g8 f e d |
>       d8\f a' d f a f d a\invP |
> 
> The "mid" item is a dummy staff (there is no actual staff) which I use
> for tweaking tempi for the midi output: using this I can simulate
> rits, fermatas etc.  For the printed score and parts it is not
> referenced at all.
> 
> Also in bar 1 I have \invP, which as can be seen produces an invisible
> 'piano' marking: this is simply to avoid the articulate script's
> annoying warnings about ambiguous dynamics (which would be less
> annoying if they told you exactly where in the music the problem
> arose!)

This is a very nice idea! You just solved a problem that I've been
pulling out my hair over, and that is, when you have a <<...\\...>>
section inside a staff (common in piano music, where the number of
logical voices in a single staff change frequently), the midi output
doesn't understand that the dynamics inside the <<...>> should inherit
from the surrounding context. Instead, it defaults to \mf, which
produces horribly jarring output when the surrounding passage is \p. By
inserting invisible dynamics inside the <<...>> to match the surrounding
context, finally I can get some sane output!!

Thanks!!


> However, I have another dynamic problem which it would be nice to get
> around.  Later in the music there is a passage marked "dim."; in
> addition, each bar has hairpins < and >.  The interpretation of these
> up and down dynamics within a more general diminuendo is easy for
> musicians, but understandably opaque for articulate.ly.
> 
> I can get rid of the warnings about this by putting the "dim." into
> the parts as a markup, rather than as a dynamic.  But, although it is
> not of vital importance, I wondered if there is some way I could mimic
> the effect of the diminuendo (perhaps by using \f, \mf, \mp etc.
> successively) in much the same way as I can mimic a rallentando by
> using successive \tempo markings in the 'mid' context.

One idea I have that might help, is to define your own volume control
dynamic markings, e.g., "dyn10", "dyn20", "dyn30", ... "dyn100", and
override the Score.dynamicAbsoluteVolumeFunction to assign actual values
to these custom dynamics. Of course, these would be rendered invisible
so that they don't appear in your score. (See below for some actual code
snippets.)


> Actually, I am not really sure what kind of context 'mid' is anyway.
> I do not define it anywhere else: I simply include it with the four
> actual staves (which are defined with \new Staff etc.) in the \score
> block which precedes the \midi command.
> 
> How might I add dynamics to 'mid' which would affect all the voices,
> in the same way as \tempo changes do?
[...]

You could just "merge" the 'mid' context into each staff in your midi
score (I include the dynamicAbsoluteVolumeFunction override below, as
illustration):

        % This is the score for typesetting: don't use 'mid' at all
        \score {
                \new Staff { ... }
                \new Staff { ... }
                ... % and so on

                % This makes this score generate the typeset output.
                \layout{ }
        }

        % This defines a new Scheme function called 'customDyn' that
        % interprets new custom dynamics that we can use to control midi
        % dynamics beyond what the default set of dynamics give us.
        % Well, the below code doesn't actually give us anything more
        % than what we already have, but this is just to illustrate how
        % you can define your own arbitrary dynamic markings to refer to
        % whatever midi volume levels you want in the output.
        #(define (customDyn dynamic)
            (cond
                ((equal? dynamic "dyn10") 0.1)
                ((equal? dynamic "dyn20") 0.2)
                ((equal? dynamic "dyn30") 0.3)
                ((equal? dynamic "dyn40") 0.4)
                ((equal? dynamic "dyn50") 0.5)
                ((equal? dynamic "dyn60") 0.6)
                ((equal? dynamic "dyn70") 0.7)
                ((equal? dynamic "dyn80") 0.8)
                ((equal? dynamic "dyn90") 0.9)
                (else (default-dynamic-absolute-volume dynamic))
            )
        )

        % This is the score for midi output: it does *not* appear in the
        % output.
        \score {
                % Make the midi performer understand our new custom
                % dynamics
                \set Score.dynamicAbsoluteVolumeFunction = #customDyn

                \new Staff {
                        % Merge first voice with midi dynamics
                        << Vone \\ mid >>
                }
                \new Staff {
                        % Merge second voice with midi dynamics
                        << Vtwo \\ mid >>
                }
                \new Staff {
                        % Merge third voice with midi dynamics
                        << Va \\ mid >>
                }
                \new Staff {
                        % Merge fourth voice with midi dynamics
                        << Vc \\ mid >>
                }

                % This causes the score to have midi output. Note the
                % absence of a \layout block, which makes this score
                % produce no typeset output.
                \midi{ }
        }


T

-- 
Food and laptops don't mix.



reply via email to

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