Monday, September 22, 2008

Release Velocity

If you've spent time studying the MIDI specification, or ever looked at any MIDI data dumps, you probably know that a Note On message is sent by a MIDI keyboard whenver you press a key on the keyboard, and that the Note On message is three bytes long:
  1. The first byte indicates that the message is a Note On message, and contains the MIDI channel number.
  2. The second byte indicates which note was played.
  3. The third byte is a data byte that indicates the velocity, which is a measure of how quickly or slowly the key was pressed.

Each Note On message must, eventually, be balanced by a Note Off message that tells that note to stop sounding. (Otherwise you wind up with stuck notes.) The Note Off message is sent when you release the key -- let it up or take your finger off.

A Note Off message, like the Note On message, is three bytes long. The first two bytes are the same: the first byte contains the Note Off type code and the MIDI channel number, and the second byte indicates which note was released. So what does the third byte in a Note Off message do? It contains what is called the release velocity. The release velocity is a measure of how quickly the pressed key was allowed to come back up to its rest position.

Release velocity has been in the MIDI specification since the beginning. As it turns out, the most common mechanism used in scanned keyboards to measure velocity can also provide release velocity "for free"; the software which controls the keyboard scan just has to notice it. So it's a bit surprising that many velocity-sensing keyboards don't do anything with it. Of the synths that I own, only the Oberheims (Matrix-1000 and Matrix-6R) provide it as a routeable parameter. The JD-800 uses it for one purpose, which is providing a surrogate velocity value for a note that is retriggered in solo mode when a higher-priority note is released. I was surprised to find that the V-Synth, which I'm now using as my master keyboard, doesn't provide release velocity as a routeable parameter, or do anything at all with it as far as I can tell. However, it does output release velocity in the MIDI data it sends.

So why don't more synths use it? I'm not sure. One thought I had is that release velocity, as far as I know, does not have any significant effect on any non-electronic keyboard instrument that I can think of. It might make a slight difference on a pipe organ that has tracker (purely mechanical) action. On a piano, it would effect how quickly the dampers recontact the strings, but I doubt that there is any practical effect, as I've never heard any piano player mention it. Given this, it is probably true that few players have worked at developing any skill in controlling release velocity. I had never really done anything with it up until a couple of weeks ago, when I decided to use it to control envelope release time on a Matrix-1000 pad patch for something I was putting together. I found it rather difficult to control at first; it's odd, seemingly counter-intuitive, to think about release velocity.

I have put together a video demonstration of release velocity on the Matrix-1000 (using the V-Synth as a controller). When I put this together, I found something interesting and rather bizarre about the implementation on the 1000. Since release velocity is obviously not available until key release, I had assumed that the synth would use a default value of 0 for that parameter through all of the envelope phases prior to release. No so. What it actually does is this: at the time a note is released, the release velocity is obviously applied to the note through the release phase. However, that release velocity value is retained and applied to the next note played by that voice! The value of the release velocity parameter will be the value of the release velocity for the last note played on the same voice, until the next note is released. This can lead to some wild and hard-to-predict results, depending on which voice allocation method is selected. You can hear this particularly in the video's last segment, where some notes in a chord have wild pulse width modulation and some don't, depending on previous notes and how the voices were assigned to the chord. What you do with the previous note can effect the next note. It's a bit like having a demented version of polyphonic aftertouch.

(P.S.: I had to re-shoot part of the video due to problems with my camera. All complaints about continuity errors will be cheerfully ignored.)

No comments: