I'm trying to create a device to essentially achieve something like drum trigger software.
An incoming audio signal is detected and sends midi information out.
The purpose is to use a mic'ed voice, or guitar, or drums, or any other instrument to control vsts, or ableton itself, or lighting equipment, etc...
The part were I'm stuck is how to effectively differentiate between velocities. I want to assign different velocity zones to different midi messages.
Let's say I have zone 1 from -70 to -50db, zone 2 from -50 to -20 db and zone 3 from -20 to 6 db.
If the incoming signal is -30db, then the midi message associated with zone 2 is triggered.
The basic structure is already working, but the problem is that every sound has an attack and decay, of course.
So a -30 db signal fades in from -inf to -30. At the moment my device first triggers zone 1 and THEN zone 2. And of course when the sound stops, it fades back out, triggering zone 1 again.
But I want it to only trigger zone 2.
So I was thinking to introduce some kind of delay, only evaluating the signal after x ms.
It would have to be short enough so it does not mess with the playability (like trying to play guitar with too much latency), but long enough to not misinterprete short sounds with a fast attack, or even miss them alltogether.
This could take care of the problem at the start of the sound, going up. But it would still fade out and go through zone 1 at the end.
Does anyone have any insights on how long the delay should be or how to fix the fading out problem?
Or any suggestions for a more efficient way to achieve my goal?