Change velocity while MIDI note is playing

Hi guys,

I'm trying to make a midi controller that would take piezzo sensor as an input and output a midi message.
This means that I would like the following behavior:

  • Piezzo is hit, it sends a Note On message
  • After being hit, piezzo changes voltage in analog manner - I want the velocity of my MIDI note to change in accordance.
  • Piezzo's voltage is below threshold - Note Off is sent.

I cannot find an example where velocity would be changed while MIDI note is on.
Anyone knows how to handle this?

What you want is 'aftertouch'. You need to send Polyphonic Key Pressure events.

You can find more information in the MIDI specs, it's the same principle as note on/off events, just the first nibble is different.

Pieter

Ah, great! Thanks!
Didn't know what that was called..

Note that all MIDI sound generators do not respond to after touch and many of those that do only apply one value to all playing notes. A very few apply it separately to each individual note.

Hmm.. yes, now, when I think of it, I might throw away the idea of aftertouch.

I want to make a foot controller - you stomp on it and you get some kind of a drum sound (e.g. you play guitar, and stomp to get hihat, or cajon, or tambourine, or something similar to accompany your playing).

I wanted it to be able to play both sampled instruments and synthesized ones. And so I thought that I would need aftertouch to shape the sound. But now I realized that both samples and synthesizers do "attack/decay/sustain/release" thingy, and I have absolutely no need for aftertouch...

Damn.. Now it looks simple..