@AlexanderBunt Ah, doing a carillon is an interestingly different technical challenge.
Some of the key differences I see from doing a piano:
- Physically quite a bit larger per-note. Both the overall structure, and the individual keys. You have space to put things wherever you want, and to make keys that feel right you're going to end up with long, thick pieces of wood.
- You have fewer notes; presumably a max of 77, that being the largest real carillon?
- Your keys only do one interesting thing; they trigger the mechanism which strikes the bell. They don't then dampen it later. Right?
- Everything is made from scratch; you're not interested in pulling unused carillon consoles out and converting them?
But you still need to measure the instantaneous velocity as the key passes some triggering point?
I don't think using optical reflectance to measure distance is at all appropriate for you. That'll be a pain, and there's no reason you need to constrain yourself with physically small sensors.
My initial thoughts for you would be to use rotary encoders that can attach to existing shafts, like these https://www.cuidevices.com/catalog/motion/rotary-encoders and then measure the angular velocity at the shaft. You'll get clean values which directly correspond to physical motion you can understand. They're expensive, probably starting at $20/ea, likely more with limited availability of everything these days. But it might be possible to connect all the ones you'd need to a single sufficiently powerful microcontroller. That'd make your life quite a bit easier. But some design work, reviewing the interfaces available on those encoders, would be necessary.
Similarly, you could adapt some sort of fine-resolution rotary encoder like you already accidentally purchased to the task.
I'd shy away from potentiometers, if nothing else because you'd need to get a huge number of ADC channels and that is more of a pain in the ass than the casual observer realizes.
You could also apply optical reflectance sensors as they were originally intended to be used. Point one at the side of every key, and put a strip of alternating black and white lines on the key, such that as the key moves the sensor will swing between its minimum and maximum outputs. That'll get you a pulse train proportional to speed. You'd need a tiny bit of clean up on the signal and then it could go straight into a microcontroller. You could almost certainly get away with feeding 77 such signals into a single sufficiently powerful controller.