32 key input

Status
Not open for further replies.

VladimirSlavik

New member
Hello,
I am considering a project with Teensy and would be grateful for any comments or advice on feasibility. Basically, please read this as having question marks all over...

The idea is to make a MIDI organ pedalboard. This means 32 keys, not pressure/velocity sensitive, potentially any combination "on" in parallel, latency well under 100 ms (which includes the whole transmission and software stack until sound comes out).

For the Teensy model, the combination of relative buying power, shipping costs and what's in stock nearby means I'm railroaded into using the LC. I think that's sufficient... is it?

I see two choices for the inputs:

  • Hall sensors: Convenient integrated thingies. Provide built-in hysteresis + open collector output. The actual sensor would be TLE4905L but that's beside the point I think. As I'd get already digital quality signal from the sensors, I could use 4x 74hc153 (2x digital mux 4:1) to multiplex the 32 lines into 8.

  • Photo gates: This gives me free-floating analog bipolar transistors. And these can be arranged in a matrix like keyboards, and as transistors already rectify, no diodes needed in the matrix even. Given the sensor can be in a partially occluded state, and these transistors are fully analog, I'd need Schmitt triggers in front of the Teensy input pins, perhaps 74hc540 (8x non-inverting).

Comparing these two - the optical variant has half the chips compared to the previous choice, but requires more mechanical precision, so I think I'll rather live with the two more chips. I have verified with samples of the both sensors that they do more or less what I expect (no scope though). In both cases I think I can design the physical assembly to effectively eliminate bouncing, and electrical side has some sort of hysteresis so that should be "solved". There was even a welcome surprise as the hall device was activated by a (cheap) ferrite magnet at virtually identical distance as an (expensive) rare earth magnet. That said, if there is something I missed...?


There's still a ton of open questions:

  • I'm thinking I want to read as many bits as possible at once, using a port register (?) to conveniently read a byte at once looks an elegant thing to do. LC apparently has one. Or is "shifting in" a better choice somehow? I've seen it all over the internet, but to me it seems not relevant here as I have plenty pins free, so I better leverage them! I also imagine a one-way digital mux would have less internal stuff in signal path and be faster. And it's simpler to reason about as it's stateless...

  • I am not really sure how fast will the thing "scan". Given the latency budget, I'd be probably trying to go as fast as possible at first. I imagine Teensy could reach the limits of the HC chips easily, so no problem there. But I imagine switching so fast might run counter to the issue of EMI which might require slower switching instead? The sensors will be physically in a line some 60 cm / 2 ft long, which makes for lots of unintentional antenna. Also not sure if capacitance is going to be a problem if this need shielded cabling - does it?

  • Also, do I concern myself with power requirements? Both the hall sensors and LEDs need some 20 mA-ish each, so upwards of half an amp total. As this would be a very large static device that can fit even a laptop power brick inside easily, having the juice is not a problem. But the idea of burning that much in the sensors alone is not a particularly appealing one. Then again, if I power cycle the sensors, I am back to the EMI question, and need some driver there, and...?
 
Status
Not open for further replies.
Back
Top