RIP
Context: I'm trying to understand deeper the frequency requirements of my ADC, per discussion in https://pianoclack.com/forum/d/243-diy-piano-sensors and particularly https://pianoclack.com/forum/d/243-diy-piano-sensors/29 -- and related one in https://forum.modartt.com/viewtopic.php?id=8956
Back-of-the-envelope: at ff piano level, hammers move 3m/s, the let off is about 1mm from strings (sensor), so the hammers move from let off to string (sensor) hit in about 300us. I know you are using shank sensors, hence both the distance and the speed are different, but the time is the same. So we have to measure a time around 300us and translate it to a MIDI velocity of about 120. Now we want the system to be able to produce velocities of 121 or 119 (assuming MIDI v1 and ignoring MIDI v2). So we want around 1% resolution in the MIDI output. If the MIDI output is simply multiplicative or divisive of the measured time, that means we need 1% resolution of the measured time, i.e. 3us, i.e. 300kHz per channel.
Question: you mentioned a while back (I think it was on PW) that instead you needed an intense "mapping" to provide appropriate MIDI velocities from the measured times. Looking at your code a https://github.com/ekumanov/cybrid/blob/master/src/teensy/main/My_Hybrid_Piano_V1.2.ino#L220-L245 I think shows what you were talking about. I think I understand and can reverse engineer it, but I think a discussion is better. So the question is: how are you mapping from time to MIDI velocity, do you have a plot of the curve you are using with a range of parameter that you tried (and accepted or discarded) -- basically anything that is not already evident from the code section I linked and even anything that you'd like to add to explain about that code even if it's evident.
Thanks!