CyberGene Not sure if I explained it properly. Intuitively you could think of second switch starting a timer and third switch stopping the timer. But that’s not how it works. It could work this way if all switches are simultaneously wired to the CPU and if there were hardware interrupts. Or if the switches had their own timer for each key. But since here we have a single CPU that scans sequentially through switches through multiplexing, you don’t know when exactly the switch was activated. You only know that on previous scan cycle it was off and now it’s on. That means it could have been activated any time between right now and 9 microseconds ago. For low velocities (long duration) 9 microseconds inaccuracy is not significant. For a high velocity strike, hence short duration, 9 microseconds can be already a high enough offset. Well, in my case they lead to 0.5 points of MIDI velocity inaccuracy.
Thanks again everybody and particularly @CyberGene for this last clarification. So let's forget for a moment that you have many sensors, and concentrate on one: if my understanding is correct, you are "sampling" the on/off condition of that sensor with a 9us period, which is roughly 3 orders of magnitude faster than what the chip/sensors I got fixated with can do. And that is more or less the "sweet spot" for enough MIDI v1 resolution, so "mine" are too slow -- 'nuff said.
I was partly confused by the fact that the the chip/sensors I was looking have different aspects of the "timing" of measurements and I should not look at things that can be confusing when it's past my bedtime (yes, I go to sleep early, if Flarum tells that). In fact, there is the laser pulse (which can be as short as 50us), then there is the sampling time (which can be at most 8ms, which -- including additional overhead -- gives a mere 67 measurements/sec) and the I2C reading time (which at the highest I2C bus frequencies can be 100us). In any case, this is too slow. Yet, I like this sensor very much: the laser is highly directional, so there is little to no risk of sensing the neighbor key; the laser is pulsed and the pulse is matched in the receiver, so there is a very high rejection of other light sources; and a lot of other functionalities which instead I would need to design and implement myself.
On the other hand, 12-bit ADCs with sampling rate of 500kHz (i.e. sampling time of 2us) are not uncommon, even though if I want to implement (in hw or in sw) some of the stuff that these sensors provide I may need a higher frequency.
So, in conclusion, I will be ordering a few samples of QRE1113, EAITRCA6 and CNY70 run many tests and see which ones I like best. FWIW, the size of the CNY70 is problematic for the way I want to assemble the key sensors. To make my life easier, at this stage I will use a few RPi pico, each of which has 3x 12-bit ADCs @ 500kHz.
Obviously, I will report back here what I find (and probably make a PR on either or both Cybrid and piano-conversion github repos with the code and data which I'll get).