[Top][All Lists]

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

Re: MIDI dynamics parsing error

From: Knute Snortum
Subject: Re: MIDI dynamics parsing error
Date: Tue, 20 May 2014 06:41:26 -0700

(Note: the above code still emits a warning: Programming error: impossible or ambiguous (de) crescendo)

One of the things I really liked about LilyPond was the ability to compile sheet music and MIDI from the same source.  It seems to me that this behavior is getting away from that value.  I would think that in piano and choral music if you create a temporary voice, not only do you want the original dynamic to carry over into the temporary, you want any dynamic mark to carry over back into the original after the temporary is over.

If I understand you correctly, the only way to set a dynamic change while temporary voices are active is to set the mark on one voice, set and omit it on the other(s), and set and omit it on the original voice once the temporary voices are done.  This seems unnecessarily complex for a situation that I would think happens many times.

Knute Snortum
(via Gmail)

On Mon, May 19, 2014 at 12:34 PM, Heikki Tauriainen <address@hidden> wrote:
On Sun, 2014-05-18 at 10:40 -0700, Paul Morris wrote:
> Conor Cook wrote
> > It is my impression that a decrescendo starts where you are and gets
> > quieter.  Does Lilypond not have a default (e.g. mf) MIDI dynamic like
> > Sibelius?
> Good point.  Wouldn't it make sense to just use a default volume for MIDI,
> if it has not been specified in the score with a dynamics mark, rather than
> issuing this warning?
> -Paul

When this warning is shown, LilyPond will actually use the middle of the
available note velocity range as the starting velocity ("volume").

(This is an exception to most other MIDI settings, such as the MIDI
instrument, where no defaults are enforced if they are not set
explicitly.  However, for note velocities LilyPond likely needs to
always use *some* value for MIDI output, which is probably why a default
is used in this case.)

However, one purpose of the warning is to direct the user's attention to
input locations where the MIDI output is possibly not what the user
might expect: for example, since every Voice has by default a separate
dynamic performer for MIDI, the default volume can easily take effect
"accidentally" in temporary polyphonic passages such as follows:

\version "2.18.2"

\score {
  \new Staff {
    \new Voice {
      % ... a long monophonic passage
        \new Voice {
          c''2\> % starts at the default velocity, not \ppppp
        \new Voice {
          c'1    % this note also gets the default velocity
      % ... continue with a single Voice
  \layout { }
  \midi { }

In this case the warning could be helpful in signaling the user that
LilyPond may need some additional help in guessing the "correct" initial
note velocities for the Voices in the temporary polyphonic passage.

As to the original problem of including the \mf only in MIDI to suppress
the warning, one could of course also use tags as a workaround, however
at the cost of duplicating part of the music and the entire \score block
(personally I nevertheless usually use this approach since, after the
initial \score setup, it allows customizing MIDI output independently
from the layout whenever needed):

\version "2.18.2"
\language "english"

upper = \relative c'''' {
  | gf16-. \f ef-. df-. cf-. bf ( \sf df cf af )
    gf-. \sf ef-. df-. cf-. bf ( \sf df cf af )
    { \tag #'layout { bf4\< } \tag #'midi { bf4\mf\< } a16 ( \sf gf' f
ef ) bf4 %{ \mf %} \< a16 ( \sf gf' f ef ) }
    { <af, f>16 q q q a4 <af f>16 q q q a4 }

\score {
  \new Staff = "up" {
    \clef treble
    \keepWithTag #'layout \upper
  \layout {

\score {
  \new Staff = "up" {
    \keepWithTag #'midi \upper
  \midi {
    \tempo 4 = 120

Now that I looked at the original example, it looks like this example
also triggers the creation of separate dynamic performers for the upper
and lower parts of the << { ... } \\ { ... } >> passage.  Therefore the
crescendos in the upper part will probably have no effect on the notes
in the lower part, all of which will then sound with the "default"
volume (since no initial volume has been specified).  If this is not
what is intended (possibly not if looking at the typeset output), the
explicit initial volume and the crescendos should be repeated also in
the lower part to have them applied to these notes in MIDI...

Heikki Tauriainen

lilypond-user mailing list

reply via email to

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