conclude drum hit strength from piezo signal

Hi all:

I'm working on a piezo trigger to midi converter. I wanted to know what is the best way to extract the drum hit strength ("Velocity"), out of the analog signal sourced out of the piezo sensor.

This is my second design generation. In the first generation I simply searched for the 'maximum' and that was the velocity byte sent out. This works fine, except for that the dynamic range is very poor. If I want ghost note to be heard, then normal hits are easily saturating to velocity=127 and vice versa...

I recently thought of other way to do it, by measuring the slope of the pulse. (some linear best fit or something...). In that way I shouldn't care less that the analog signal is clamped...

Do you people think this should work or am I missing something big time....

Do you people think this should work

I would think that measuring the slope of the waveform is going to be difficult and will probably not give you the information you want.

You could probably get better results with a hardware peak detector or envelope follower:-
http://www.andregoncalves.info/ag_blog/?page_id=61

I used a voltage follower analog circuit before sampling the signal. This was good to clean the hi-freq noise. It was built around band pass op-amp that is charging capacitor through a diode. The capacitor's voltage is sampled to the MCU. (Of course that a discharging resistor is connected in parallel to the capacitor).

the op-amp is gain controlled. BUT (as I explained before), small gain allows you to get dynamic range over the strong hits wheres lite strikes are not crossing the threshold. Increasing the gain easily results in a clamped signal.