Some stuff that you take for granted as a performing musician is pretty complicated when you look under the bonnet. Like velocity curves.
I've been experimenting with generating Midi velocity from hall-effect sensors. (One of the Gullsonix boards.) It's getting there.
https://www.youtube.com/shorts/EkHxVErlW2Q
It works. But I'm trying to get to grips with velocity response.
One common approach to creating a velocity-sensitive keyboard is to create a mechanism whereby pressing a key operates two contacts consecutively. By looking at the time difference, you can figure out how fast the key was travelling.
I can't find any pics just now, but from pulling apart an assortment of synths I seem to remember that break-before-make is a common approach. As you press a key, a contact is broken. As you continue to press, another contact is made. On springy metal tine things.
Creating these mechanisms from scratch is difficult. You can find keys that have this mechanism built-in, but they're mainly a bit rubbish...I've never found one suitable for playing on. They also have names like "SPDT" (single-pole, double-throw).

You get the idea. But the reality is, you end up with something like this.

Very stiff, short travel.
*****************************
Another approach is to use analogue keys...like, hall-effect keys. You have a key which is basically a magnet on a spring...

...placed above a hall-effect sensor, which returns a continuous range of values as the magnet looms near. You can define two thresholds corresponding to the break/make contacts, and you're in business.
Then you have to deal with the response curves.
I've been experimenting with Lekker L45s paired with the OH49E-S, which isn't a bad combo (vid above), and wondering how to finesse the velocity response. I started by logging all the values as the key passed between two points, and considering the graphs.



The first thing you will notice is that these are not linear.
Each graph basically shows the output from the hall-effect sensor as the key is pressed. The non-linearity is a combination of the electronic properties of the sensor (proximity of magnet to sensor not necessarily having a linear relationship to output) and the the mechanics of the press (clumsy human stabbing a plastic key will result in some complex acceleration/deceleration etc).
The second thing you will notice is that the curves are not equal. The curviness changes at different physical velocities.
If we wanted to create a linear velocity response, how do we do that...? I don't think the curve of the particular presses is such an issue here...I think it's more a question of considering the change of curve between different velocities.
I think you'd probably want to start by making the number of samples in the data for each of the three curves equal - because they ain't. The nature of the sampling method (logging the values with an Arduino) means that you'll collect more samples for a slower press than a fast one. To make the lists of sample data equal length, you'd need to apply a best-fit-graph, then interpolate. All easily done with Excel of course. Providing you know Excel, and understand trendlines, or whatever.
Then you'd need to create a kind of curve of curves; you need to examine the nature of the change in the curve at different velocities. You'd take the ubercurve (yes, I'm making up the terminology as I go) and figure out a transformation to make it linear - or at least, I think so.
(I was hopeless at maths at school. I still remember the ignominy, if inevitability, of being demoted to the bottom set. I'm more interested in it now but I'm still no good at it.)
But...that's assuming you even want linear velocity response. And you might not.
At this point I Googled it and found a SOS article by Martin Walker, which was a flickering candlelight in the mental darkness.
https://www.soundonsound.com/sound-advi ... r-keyboard
I'm undecided whether to even try and address the issue, or just implement a bunch of velocity curves with a "choose your fave" disclaimer. I have a sneaking concern that it would be better to address it at a lower level, but I lack the insight.
Hey! What's your favourite velocity curve?!


