(sorry for necroposting or whatever it's called, I just realllly wanna talk about this specific project)
Yo, this is definitely a diy lumatone replacement right? I'm actually in almost the exact same situation as I wanna build a big isomorphic keyboard with analog keyswitches
The way I would approach the massive amount of analog keys is by connecting the columns of the button matrix onto a chain of parallel-out shift registers, and the rows into an analog multiplexer. This should work (in theory, haven't tested yet), as only one switch is a part of a closed circuit at a time, so the shift register(s) shouldn't get fried by too much current
I wrote some "dummy" code to test the theoretical polling speed by executing the digitalWrite's and analogRead's as if I was polling the keyswitches and I got a polling rate of 250000/s??? (that can't be right)
int rows = 8*4;
int columns = 8;
int state;
long time;
long finaltime;
void setup() {
Serial.begin(9600);
}
void loop() {
time = micros();
for (int r = 0; r < 10000, r++;) { // testing how long it takes to poll the switches 10000 times
read();
}
finaltime = micros() - time;
Serial.println(finaltime);
}
void read() {
for (int j = 0; j < columns, j++;) {
digitalWrite(2, random(1)); // "selecting" the multiplexer row
digitalWrite(3, random(1));
digitalWrite(4, random(1));
for (int i = 0; i < rows, i++;) {
digitalWrite(5, "HIGH"); // pulsing the relevant shift register pins
digitalWrite(5, "LOW");
digitalWrite(6, "HIGH");
digitalWrite(6, "LOW");
state = analogRead(A0);
}
}
}
Also @fuzzybeverage I would really love to chat with you as our projects are so similar we could offer advice to each other (also MICROTONES!!!1!!)