]> git.donarmstrong.com Git - lilypond.git/commit
Make midiMaximumVolume take effect without initial dynamic
authorAnders Pilegaard <arrowyard@gmail.com>
Fri, 22 Feb 2013 08:32:18 +0000 (09:32 +0100)
committerJames Lowe <pkx166h@gmail.com>
Sun, 17 Mar 2013 12:48:18 +0000 (12:48 +0000)
commita970166b725ea78a1b3866e0a0bd208155193222
treed3650e19c3bc872a4f64c81e4a8ba6883ea5ff22
parentb6aa3f865112a03c0d9c4632985c009944a2a48f
Make midiMaximumVolume take effect without initial dynamic

Issue 3234

My idea is to ensure that the volume is *always* initialised in
Dynamic_performer::process_music.  The code to do that is mostly
copied from what happens if there is an actual script event.

The constant 0.71 was obtained by calculating backwards from the
default velocity value (0x5a) in the Midi_note constructor,
midi-item.cc line 179.

I found that I had to create and announce an Audio_element_info for
the change to take effect.

Backward compatibility notes
----------------------------

As far as the music itself goes there are a few cases:

 - Music that doesn't set midiMaximumVolume or midiMinimumVolume will
   be unchanged, as the default dynamic setting is chosen so the
   calculated midi velocity is the same as the current default when no
   volume is set.

 - Music that sets midiMaximumVolume or midiMinimumVolume and has
   initial dynamic expressions will be unchanged - the explicit
   dynamic takes effect before the first midi note is created.

 - Music that sets midiMaximumVolume or midiMinimumVolume but doesn't
   have an initial dynamic expression will change.  In the current
   version such would be an error, so I don't expect many of those.
lily/dynamic-performer.cc