]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/midi-item.cc
patch::: 1.3.37.jcn1
[lilypond.git] / lily / midi-item.cc
index b822a6655e51eb3fe97f2f242aee6596036945fb..a5921325e248607c02cadc7192891f4654467412 100644 (file)
@@ -476,8 +476,16 @@ Midi_dynamic::str () const
     07 MSB
     27 LSB
    */
+  static Real const full_scale = 127;
+  
+  int volume = (int)(audio_l_->volume_*full_scale);
+  if (volume <= 0)
+    volume = 1;
+  if (volume > full_scale)
+    volume = (int)full_scale;
+
   str += to_str ((char)0x07);
-  str += to_str ((char)audio_l_->volume_i_);
+  str += to_str ((char)volume);
   return str;
 }