]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/midi-item.cc
MIDI: always output all midi events. Fixes #1593.
[lilypond.git] / lily / midi-item.cc
index ab67947d553e67e99c80acfe2d474ef0b4e5890e..a04553508fc660314c5d9a7452af6501ae0189b8 100644 (file)
@@ -181,7 +181,8 @@ Midi_time_signature::to_string () const
 Midi_note::Midi_note (Audio_note *a)
   : Midi_channel_item (a)
   , audio_ (a)
-  , dynamic_byte_ (0x5a)
+  , dynamic_byte_ (a->dynamic_ && a->dynamic_->volume_ > 0
+                  ? Byte (a->dynamic_->volume_ * 0x7f) : Byte (0x5a))
 {
 }
 
@@ -287,6 +288,10 @@ Midi_dynamic::to_string () const
   if (volume > full_scale)
     volume = (int)full_scale;
 
+  int const volume_default = 100;
+  if (audio_->volume_ < 0 || audio_->silent_)
+    volume = volume_default;
+  
   str += ::to_string ((char)0x07);
   str += ::to_string ((char)volume);
   return str;