]> git.donarmstrong.com Git - lilypond.git/commitdiff
Default MIDI Note-On/Off velocity output.
authorMartin Tarenskeen <m.tarenskeen@zonnet.nl>
Thu, 9 Apr 2009 08:34:42 +0000 (10:34 +0200)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 17 Jul 2009 08:02:35 +0000 (01:02 -0700)
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

index b6838215f5c421c80936fec689a23fa93f660c5c..63b6be6b1103447ae02772b3090e9f90d5839c37 100644 (file)
@@ -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_));