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))
{
}
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;