floretan/p150

wiring the keybed on teensy

Opened this issue · 17 comments

Hi i have a problem to connect wires from the keyboard matrix to the shift register and teensy. I'm new to it so i don't know how they works, i have your same diode matrix of 15 rows and 12c colums so i can use exactly your project but i don't understand how i have to connect rows to the shift register. do you have any schematics? thanks for the help! ps. my shift register is a sn74hc595n

It's been a while since I worked on this, and I can't open up the project at the moment, but looking at the code it's wired somewhat like this:

  • The 12 columns are connected to the inputs 1-12 on the teensy
  • The clockPin and dataPin are connected to the first shift register, the 8 outputs of that shift register are connected to rows 1-8
  • The second shift register is connected to the first (check the documentation for your chip, but it should be pretty straightforward). Since we only have 15 rows we only need 7 of the outputs for rows 9-15.

The code sends a single ground signal to the shift register, pulling each row down one by one, and at each step reading all of the 12 columns. Good luck with your project!

Thank you so much! now i'm working on the connections but i have only a little question enough, do you have powered the shift registers with the 3.3v pin or with an external 5v power source? thank you so much for your help, once I have connected everything I will let you know!

I just used the pin on the teensy, I'm pretty sure it was the 3.3v pin. The shift register doesn't use much power, and it's practical to have the whole project powered over USB by whatever device you plug your keyboard into.

Hi, i wired and connected the keybed to the teensy, the 12 colums from the pin 0 to 11 and the rows to the pins of the shift registers. However I ran into some problems:
the keys are not easily recognized all and in the higher octaves some keys when pressed give multiple inputs (for example A corresponds to all A on the piano) and the velocity is not recognized well. Sometimes when I press it seems that the sound is played backwards or in any case with some missing input from MIDI.
I wanted to ask if there is any setting in the code that could be changed to best fit my keybed( Has the yamaha p150 a Graded hammer standard keybed like my p35?).
there is only a part of your code that I did not understand correctly:
for (int row = 0; row < 15; row++) {
for (int col = 0; col < 6; col++) {
// (14 - row) because I wired things backwards.
// *6 because there are 6 columns in each matrix row
// -2 because the first row is incomplete
// (otherwise there would be 90 keys, not 88)
int key_index = (14 - row) * 6 + col - 2;

sorry for the long question(s) i hope that you could give to me some little advice to
to make everything work. Thank you very much!

I'm not familiar with other keybeds, it could also be that the wiring is different in your case. Do some debugging by using Serial.println in your code to make sure that you see which switches belong to one key. A velocity-sensitive key is just two switches that are slightly offset, the amount of time between the two switches closing will tell you how fast the key was pressed (shorter => louder). I had to do a good amount of fine-tuning to get something that felt right, but I guess this depends on the keyboard you have.

perhaps the problem is the shift register i'm using, i bought the 74ls138 but is a decoder demultiplexer and it isn't present in your project like the other project with the fatar keybed. Now i'm going to try with a 74hc164 that it could be powered with 3.3v pin of the teensy and it hasn't the latch pin
which is not declared in your code. I'll let you know, thanks for your time

Hi, i have created the circuit for my keybed and connected all the components to to the teensy. I've used 74hc164 shift registers and the inputs are now correct but i have some issues when i press many keys, the teensy detects a pression of some keys that are not pressed. I don't know what causes the issues if it could be the type of shift register or the code that is to modify for my keybed but if i press the single notes they works perfectly. Now i'm going to add a capacitor of 0.1uF to Vcc pin and see what happens

For godbless876, for now try to invert the connection of inputs and outputs: the colums of your matrix has to be connected from the pin 0 to 11 of the teensy, and then the rows to the inputs of shift registers. You have to connect RCLK and SRCLK together because the latch is not declared in the code, maybe you will not have correct outputs but try only to see if it works something

Ok.. which saw are u using?..am using t7 but no sound... It sees the teensy as a midi device but it doesn't recognize the key press.. what settings Should I have in the IDE... Do I need other programs?🤔

For testing inputs i'm using true pianos but any other program that reads midi data is fine, try with midi-ox that shows you just the midi data that comes from the input devices. If the IDE has compiled and you see the teensy in the Peripherals should be all right, check that there is serial + midi in the USB type in the settings. Do you grave photos of the connections you made and of the bus it takes the inputs from the keybed? Maybe I can give you some advice

give power the shift register directly from teensy 3.3v pin, don't use external power for the shift register because the digital pins of the teensy LC maybe aren't 5v tolerant and the teensy could be damaged

I'm giving up with this project, i have tried every different possibility, tried different shift registers but the keybed works with issues. The single inputs work perfectly but when i press more keys the inputs starts to be wrong and the teensy detects some keys that i have not pressed next to the keys pressed. I don't know how to correct this issue(maybe something wrong in my schematic or in shift register used) so for now i stop this project