From 8345a0305dcd0345e9e5fc49c0c4932bebe28f0e Mon Sep 17 00:00:00 2001 From: Martin Tarenskeen Date: Thu, 9 Apr 2009 10:34:42 +0200 Subject: [PATCH 1/1] Default MIDI Note-On/Off velocity output. Note-On: velocity=127 lowered to 90 = mezzoforte Note-Off: common practice in the MIDI world is to use Note-On messages with velocity=0 instead. (cherry picked from commit 7a63a88f2a3a1534dfcf7d1d50eea581b029a4c0) --- lily/midi-item.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lily/midi-item.cc b/lily/midi-item.cc index b6838215f5..63b6be6b11 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -169,7 +169,7 @@ Midi_time_signature::to_string () const Midi_note::Midi_note (Audio_note *a) { audio_ = a; - dynamic_byte_ = 0x7f; + dynamic_byte_ = 0x5a; } @@ -225,17 +225,14 @@ Midi_note_off::Midi_note_off (Midi_note *n) on_ = n; channel_ = n->channel_; - // Anybody who hears any difference, or knows how this works? - // 0 should definitely be avoided, notes stick on some sound cards. - // 64 is supposed to be neutral - - aftertouch_byte_ = 64; + // use note_on with velocity=0 instead of note_off + aftertouch_byte_ = 0; } string Midi_note_off::to_string () const { - Byte status_byte = (char) (0x80 + channel_); + Byte status_byte = (char) (0x90 + channel_); string str = ::to_string ((char)status_byte); str += ::to_string ((char) (get_semitone_pitch () + Midi_note::c0_pitch_)); -- 2.39.2