From 766e64a52830a300841dae05235f5aa96fd330fa Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 15 Mar 2011 10:28:51 +0100 Subject: [PATCH] Midi: do not output midi volume settings next to note velocity. This can easily be made configureable in staff-performer now. --- lily/midi-item.cc | 3 +++ lily/staff-performer.cc | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 36234c4a9c..9168f11480 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -271,6 +271,9 @@ Midi_dynamic::Midi_dynamic (Audio_dynamic *a) string Midi_dynamic::to_string () const { + if (audio_->volume_ < 0) + return ""; + Byte status_byte = (char) (0xB0 + channel_); string str = ::to_string ((char)status_byte); diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index f98206c7a2..3ad276890b 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -264,8 +264,12 @@ Staff_performer::acknowledge_audio_element (Audio_element_info inf) } Audio_staff* audio_staff = get_audio_staff (voice); ai->channel_ = channel_; + // Output volume as velocity and disable Midi_dynamic output if (Audio_dynamic *d = dynamic_cast (inf.elem_)) - dynamic_map_[voice] = d->volume_; + { + dynamic_map_[voice] = d->volume_; + d->volume_ = -1; + } if (Real d = get_dynamic (voice)) if (Audio_note *n = dynamic_cast (inf.elem_)) n->volume_ = d; -- 2.39.2