nice project !!, where the section of the code I must change if use pulldown resistor on the row pin ? I've been change digitalWrite(i,LOW); to digitalWrite(i,HIGH); but still no response from the piano.
The diodes are there to prevent ghost signals when scanning the keyboard as a matrix. Honestly, I don't know how your circuit is working without them. Unless somehow you unsuccessfully shorted their pins in your wiring scheme, and they are still preventing backflow of the current. Diodes are a necessary part of a circuit like this.
Hello, I am new to this but your video might help for my midi setup. I got Yamaha PSR 160 keyboard. And the cable inside I got 15 cables all together. Not like yours as 7 and 8 cables separated. In that way, how should I program?
Thanks for the video! I would like to ask if can I use the midi input of my keyboard to input midi signals, so that my keyboard can be played by the arduino
// CODE FOR 32 keys and using the resistor ladder on negative(gnd) instead of vcc and bugs fixed //works and tested for Casio SA-47A // works with keyboards with matrix 4x8 #define matrix1 4 // rows #define matrix2 8 // columns #include "MIDIUSB.h" int octave = 24; // add or subtract 12 for one octave bool currentState[matrix1 * matrix2]; bool requestState[matrix1 * matrix2]; void setup() { //-matrix1 number of pins- pinMode(10,INPUT); //1 pinMode(11,INPUT); //2 pinMode(12,INPUT); //3 pinMode(13,INPUT); //4 //-matrix2 number of pins- //each matrix2 pin must be one above the previous one pinMode(2,INPUT); //1 pinMode(3,INPUT); //2 pinMode(4,INPUT); //3 pinMode(5,INPUT); //4 pinMode(6,INPUT); //5 pinMode(7,INPUT); //6 pinMode(8,INPUT); //7 pinMode(9,INPUT); //8 } void loop() { readKeys(); writeKeys(); delay(1); } void readKeys() { for(int i=0; i
hello guys, I have recently bought an electric piano with 61 keys for 90$ and I want to turn it into a midi controller but the problem that I understand nothing about electronics and Arduino so I wonder if anyone can help me to turn my piano into a midi controller and thank you so much.
Not to waste any more of my time. If you don't know what the diodes are for... and I hit stop. Then I am reading in the comments about voltage steps and a matrix other than 6 which is half an octave. Got to look into Teensy projects not Arduino. You scan a matrix, on or off. By using voltages, dirty or worn contacts will mess up notes. Those single row rubber contacts are no longer made as I know.
Hello, I find your videos very successful. I want you to make a video about a project. In short, the Kontakt controller has LED guides. This manual is standard for local instrument midi keyboards, s49 mk2 midi keyboards, but we haven't found a resource we can do, there is a led guide for the piano, but I don't know if it is included in the program. I am waiting for your information on how to do this. I'm so sorry for my English. :) Thank you.
Hi. I don't want to make more videos about midi, because I don't use it and I don't want to learn a whole topic about midi only to make a video. I'm sorry, but midi and instruments aren't my hobby, so I won't make a video that explains perfectly aspects of midi and its usage.
wenn ich treffe kriegst du 6 euro von mir soll ich dir erklären wie velocoped funktiniert wwas fu funkt eigentlich inn deinen henes digga kühe auf der autobahn glaubst du an gott xtc
This was pretty interesting. Can you next do one where you put an lcd on your Leonardo, and add some sounds to it and a scroll button or 2, so you can have the sounds right on the arduino (not just a midi controller)? (Would be cool to use samples, but midi synth would also be cool I guess)
hey, first of all, thanks for the tutorial. i'm trying to get this to work since 2 days. I soldered everything correctly, resistor ladder and pins in order. What changes in the code should be made if the matrix is 8x6? ( the six pins are the numbered ones, the OTHER 8 pins are A3, A2, A1, A0, 15, 14, 16 and they are the ones connected to the resistor ladder)
@@GoodElectronics yeah, but i can't understand what currentstate[] does, and how is it finding the right notes if requeststate is always true or false, wouldnt it result in the same note no matter what key is pressed? how do bools with brackets work? i cannot find any info online
also, why is digitalWrite(i,low) ? it doesnt even work for me like that, if i want some output (but wrong notes playing together) i had to put digitalWrite (i+2,low).
Hi. These variables with brackets are arrays. currentstate is the variable that stores current notes playing, requeststates is containing notes that will be pressed in the next program cycle. The value will be true for the index of key pressed. Did you properly connect resistors to them and made the changes as I wrote in the code?
Yes. Unfortunately shorting these diodes limits it to 2 or a few keys at once (which I didn't know when I was making the video), but if you leave them, it's fully polyphonic
Hi. You need to figure out what matrix it's using, and change the code to match the matrix. I wrote instructions in code to be changed as easily as possible, I hope you'll understand how to change it :)
You can purchase the resistor ladder on internet. But if you don't want to, you can simply put normal resistors. The only difference is that the resistor ladder is smaller. Resistors are very cheap.
Finally made my MIDI keyboard today ! All thanks to you and your code. Just a little tweak in code made it work for my 32key keyboard 😊. There is no delay whatsoever 🐱.
@@sangrambhumia9320 Nice work! I dont have enough knowledge about programming. i have everything wired up Can you send a 61keys code? 8x8 matrix. my project is sitting for 1month now and cant seem to find the right code. any help will be appreciated :)
first of all, tks for the video :) I must say that i don't have any experience in arduino and electronics in general, but I got a question: I'm planning to create my own midi keyboard, but with two keybeds (2x49) from the same digital keyboard, would that be a problem with arduino pro micro? Tks
This would be a problem, because you need to connect all pins to Arduino, and you have 51 pins in total. Arduino pro micro has somewhere around 20pins.
Hi man, I found a method how we can play notes with different velocity, just use Piezo element, not simple buttons, so we will be able to play with different velocity. (price will be same)
@@vic2net but the piezos do not have continues playing ability. They can play sample wav based vstis continues but cant for digital vsts sound generators. And other problem is. Some piezos can be triggered even you dont hit if you play next piezos
For a velocity sensitive keyboard you need two switches per key at different heights. You can use the time difference between when each of them was pressed to calculate the velocity. It's called "double sensor keyboard". There are also "triple sensor keyboards" to better detect fast key presses where you don't lift them all the way up (e.g. trills), but you can do almost the same with only two.
Unfortunetly, not (as I have seen, there's not documentation), but you can always search in the web, maybe somebody has written one? (I responded before, but youtube maybe didn't post this comment, so sorry for that late respond)
No, only atmega 32u4 supports native USB. You can however test some drivers that are designed to be supported with atmega328 and midi, but I haven't tested these and I won't help you with them
Been working on this for a while but can't get any midi output on my computer im using a 7x6 matrix and have altered the code accordingly im not sure how to do the resistor latter but im pretty sure everything else is right
@@GoodElectronics i found when i added my resistors on the one side and sorted it to raw I got 2 3rds of the keys working but I only got about 5 different notes I am trying to redo my wiring rn hopefully that will fix it and if not I will figure something out if it still doesn't work is there an email I would be able to communicate with you through to send pictures of my pin layout?
If they're chips on this button pcb and there's no visible connector like in my keyboard, the only way to connect it is to solder wires to these chips, which is hard.
Hey, great video. It really encouraged me to build my own midi keyboard. Just asking how should I code if I want the velocity sensitive keys because I might get access to another 49 key piano circuit. Thanks in advance, even if you can't help.
Hey, does the code also work for the leonardo board, a friend also wants to build and he already has the board and was wondering if there is anything to change for a different board
Firstly, you have to modify currentState, requestState, fixedKeys to be [60] instead of [56], in fixed keys write every number lower than 60 starting with 0 and increasing by 6, then starting from 1 and so on when you reach 59. Instead of "i
My Keyboard has only two ports one the output other the charging input 9.5v DC..... So Will I be able To Do This Project.....Also Can you Send The coding Script in a .txt File or Something Please....
@@GoodElectronics BRUH, You need both only arudino pro micro right?? And could you give me the when you have to type the code I mean the timestamp of it (The beginning one or the ones towards last) Please I don't have much idea about electronics... 😅 and How can I find out the matrix of my keyboard...Please Help me by sending the link to buy arudino pro micro..... Thanx for Replying to me...
Hi. You need to check the wiring inside the keyboard if there's a similar cable set as in my keyboard. I won't make a video, because there are plenty of keyboards and most of them are wired exactly the same (with different number of wires, which is exactly explained in the code)
I have another question: umm the keyboard I have has 61 keys, and also I have only one cable that comes from the keys' output, and it is 17 or 18 pins, so can I do it with that?
@@fl3ur_1nestimable I think it's also the same connection as I have, but you have these 2 cables joined as 1 cable, so you need to find in which place they're connected.
How to make a resistor ladder ? I can't find one.. Also can you share the picture of final version board?? (The main thing is the circuit so its logical to have the picture of it imo) And what board to select on arduino IDE
You can purchase the resistor ladder on internet. But if you don't want to, you can simply put normal resistors. The only difference is that the resistor ladder is smaller. Resistors are very cheap.
Hi. In my case half of the keyboard ribbon goes to matrix1 pins, the other one to matrix2 pins. The resistor ladder is connected to matrix1 and I believe connects to gnd. And that's all.
I recommend you learning basics of arduino programming, it will be enough to find out what's going on in this code :) I'm gettings tons of messages from people that pleases me to chenge the code, but I think it's simply explained in it. If you will still have some issues however, you can write to my gmail available in my channel and I will help you :)
does the keyboard need to be in proper working condition for this to work properly? Actually a couple of keys in my keyboard are not in proper condition, so will the midi functioning be affected or does it only depends on pressing of key ?
If some keys aren't working, there's a chance that it's broken inside microcontroller which is replaced with arduino, but it can be also a broken cable. Arduino requires a slight signal to detect it, so even weared contacts could work. If it works, the key condition won't be distinguishable (if it is, try a higher resistance resistor ladder).
hello , pretty nice tutorial, but i have a problem, when connecting the pins to the right inputs, i get only few of the keys working, when i short the pins at the beggining of the keyboard i get the sounds, but cant seem to get them when pressing the buttons, might it be because of resistance? im not using resistor ladder, but normal 5k resistors in parallel.
Right, resistor ladder is resistors in parallel. You can try with some other resistance. I also recommend you to short each input with each output with a wire to check if it's working, then measuring if the keyboard shorts one of inputs to one of outputs after pressing a key.
Hi! My ribbon cable has 17 pins but I bought the Arduino Pro Micro that has 16 inputs/outputs so that means i will lose 1 octave from my keyboard ? It has 61 keys.
In simple terms: something like that, but it depends of the both amounts of cables in both ribbons. It might be one octave, 6 keys or something similar.
@@GoodElectronics I have some questions about the keyboard matrix, I used the multimeter to measure the continuity between the pins and I managed to link the respective pins to all the keyboard notes but I don't know how to connect these pins to the arduino and how to change the code to make it work. I have some experience with C but could not make it work with the arduino.
Hi. The basic experience will be enough, I tried to explain everything in the code. Just change some numbers to the other numbers, maybe remove some lines I marked. (Sorry for long response, but youtube doesn't show reply notifications)
Can i plug a regular midi and this Arduino midi in same time to PC? İ just want to make a Arduino music box. İ plug it into PC like regular midi. And i try to play songs with regular midi and Arduino midi with diffrent enstrumants in same time.
Hi. You firstly have to check where these 2 sets of cables split. In my code there's an instruction about setting up different amounts of pins. Write if you have any other questions.
Yes, this connectrion allows for more than 1 key pressed. I made a mistake and I shorted these diodes. If you don't short them, you will be able to play as many notes as you want.
@@GoodElectronics Hello after testing the code which was ok, now I connect old yamaha keyboard to arduino and fl studio but no sound coming from it, i swipe matrix cable still no sound, do i need to short diodes like u do for it to work?
hi,thank you for the video,just one question the keyboard im using have two faders, can i add this two faders to this cofiguration? and if i could do it, how?
Hi. I don't know how MIDI uses faders, but I think it will be easy. Add digitalRead to a pin with connected fader and send midi command (you need to find how to handle faders in midi).
brother a question, I bought the pro micro and connect as it is in your video with your code (I have a 54-key keyboard so I suppose it's like in your video) the problem is that when I connect to a program all the keys become crazy, how to solve it?
Make sure you have your pins connected to proper Arduino pins. If they're connected properly and you have a multimeter, check if after pressing a button, one of rows shorts to one of columns (one of pins in the first set to one in the other one). If it does, check putting a wire directly between one of Arduino input pins and one of the output pins.
@@GoodElectronics If I have it well connected, I don't know how to do the check you said, but I connected it to the original board and they work, could you send me a connection diagram or something? I don't know why that happens, I have practically your same matrix
@@GoodElectronics I just tried it and if I listen to notes, I have it without the matrix and I listen to the program that uses (vmpx) noise like distortion, I suppose it will be the matrix although it is rare because it works on the original board
If there are sime chips, there's a chance that wires going out of this board won't work as in my keyboard, they will be connected to these chips and they will be sending signals in a more compex way.
Sir How Can I find out My Matrix.....Also Can You Tell me How to Make That Board You Made That Connects all Components........ Have Got 61 Keys Will It Work On That...Thank You .......Please Reply ASAP
Hi. I found my matrix by probing multimeter with continuity tester and checking which wires are able to short with the first wire. In your case it might me 7x6 matrix, so you only need to know where is this "split point" between 2 sets. To make a board you need to buy an universal board and solder resistor ladder to arduino (where it has a dot - connect 5v, other pins connect to input pins).
Hey nice video but I've been unsuccessful in getting the code and the resistor ladder... but I happen to have the keyboard and I would appreciate if you would send me the code
@@GoodElectronics i have found a several video on youtube. they using vs 1503 as a midi sound bank. but i dont really know if it can play multiple notes. because that module in my country has a high price.
// Here's the CODE:
// works with keyboards with matrix 7x8
#define matrix1 7
#define matrix2 8
#include "MIDIUSB.h"
int octave = 0; // add or subtract 8 for one octave
bool currentState[matrix1 * matrix2];
bool requestState[matrix1 * matrix2];
void setup()
{
//------matrix1 number of pins--------
pinMode(A0,INPUT); //1
pinMode(A1,INPUT); //2
pinMode(A2,INPUT); //3
pinMode(A3,INPUT); //4
pinMode(14,INPUT); //5
pinMode(15,INPUT); //6
pinMode(16,INPUT); //7
//------matrix2 number of pins--------
//each matrix2 pin must be one above the previous one
pinMode(2,INPUT); //1
pinMode(3,INPUT); //2
pinMode(4,INPUT); //3
pinMode(5,INPUT); //4
pinMode(6,INPUT); //5
pinMode(7,INPUT); //6
pinMode(8,INPUT); //7
pinMode(9,INPUT); //8
}
void loop()
{
readKeys();
writeKeys();
delay(1);
}
void readKeys()
{
for(int i=0; i
nice project !!, where the section of the code I must change if use pulldown resistor on the row pin ?
I've been change digitalWrite(i,LOW); to digitalWrite(i,HIGH); but still no response from the piano.
you need to change "!digitalRead" to "digitalRead"
Can i use this code with piano toys 32 keys ...
I think so, but you need to change matrix dimensions in this code
@@GoodElectronics
How...i can't handle it..i use board of piano toys 32 keys ... Can u connect me with Facebook or WhatsApp
The diodes are there to prevent notes ghosting
THIS. Seems that this guy has never assembled or looked at a mechanical keeb or any key matrix
@@oskrpnk666 Ohhh, I see now. I forgot that current can float through keys that aren't connected under specific circumstances
What do you mean by ghosting? Is it anything important for this purpose?
@@GoodElectronics What do you mean by ghosting? Is it anything important for this purpose(making my keyboard MIDI) ?
I hope you'll answer me soon.
Ghosting is wrong reading of multiple pressed keys at once, usually there can be additional key recognised as pressed.
This video becomes the one stop solution for me.
Because I want to make midi keyboard (Arduino based) from long time.
Thank you so much brother
Thank you
I'm understanding the code
With feeling
The diodes are there to prevent ghost signals when scanning the keyboard as a matrix. Honestly, I don't know how your circuit is working without them. Unless somehow you unsuccessfully shorted their pins in your wiring scheme, and they are still preventing backflow of the current. Diodes are a necessary part of a circuit like this.
Hello, I am new to this but your video might help for my midi setup. I got Yamaha PSR 160 keyboard. And the cable inside I got 15 cables all together. Not like yours as 7 and 8 cables separated. In that way, how should I program?
use a multimeter, look for other videos where u identify "keyboard matrix". ask here som1thing idk
fl studio beste:) will probably also do this for a project in university
is there any chance of getting the documentation for this? or the website link please??
Thanks for the video! I would like to ask if can I use the midi input of my keyboard to input midi signals, so that my keyboard can be played by the arduino
// CODE FOR 32 keys and using the resistor ladder on negative(gnd) instead of vcc and bugs fixed
//works and tested for Casio SA-47A
// works with keyboards with matrix 4x8
#define matrix1 4 // rows
#define matrix2 8 // columns
#include "MIDIUSB.h"
int octave = 24; // add or subtract 12 for one octave
bool currentState[matrix1 * matrix2];
bool requestState[matrix1 * matrix2];
void setup()
{
//-matrix1 number of pins-
pinMode(10,INPUT); //1
pinMode(11,INPUT); //2
pinMode(12,INPUT); //3
pinMode(13,INPUT); //4
//-matrix2 number of pins-
//each matrix2 pin must be one above the previous one
pinMode(2,INPUT); //1
pinMode(3,INPUT); //2
pinMode(4,INPUT); //3
pinMode(5,INPUT); //4
pinMode(6,INPUT); //5
pinMode(7,INPUT); //6
pinMode(8,INPUT); //7
pinMode(9,INPUT); //8
}
void loop()
{
readKeys();
writeKeys();
delay(1);
}
void readKeys()
{
for(int i=0; i
Thankyou very much for this
Wow bro , did you use resistor ladder for this code?
awesome work!! thanks ..it worked for me had 6x8 matrix, with some small changes.🙏🙏🙏👏👏👏
In Turkey, they are so expensive, you just cut my dream dude
Can it be done with nanoboard?
is it hard to make one by just following what you did and copy pasting the codes you've provided? I don't have basic knowledge about arduinos :3
Hi there. Awesome content my bru. Can you use the keyboard with synthesia also?
I don't know, you have to check if it supports midi, if so, then it will work.
Yes you can
I tested it
hello guys, I have recently bought an electric piano with 61 keys for 90$ and I want to turn it into a midi controller but the problem that I understand nothing about electronics and Arduino so I wonder if anyone can help me to turn my piano into a midi controller and thank you so much.
Not to waste any more of my time. If you don't know what the diodes are for... and I hit stop. Then I am reading in the comments about voltage steps and a matrix other than 6 which is half an octave. Got to look into Teensy projects not Arduino. You scan a matrix, on or off. By using voltages, dirty or worn contacts will mess up notes. Those single row rubber contacts are no longer made as I know.
Hello, I find your videos very successful. I want you to make a video about a project. In short, the Kontakt controller has LED guides. This manual is standard for local instrument midi keyboards, s49 mk2 midi keyboards, but we haven't found a resource we can do, there is a led guide for the piano, but I don't know if it is included in the program. I am waiting for your information on how to do this. I'm so sorry for my English. :) Thank you.
Hi. I don't want to make more videos about midi, because I don't use it and I don't want to learn a whole topic about midi only to make a video. I'm sorry, but midi and instruments aren't my hobby, so I won't make a video that explains perfectly aspects of midi and its usage.
@@GoodElectronics I got it, thank you very much.
Can you press multiple keys at once? Or is it the function of the diodes?
Can it be used in the org 2020 application, smartphone
wenn ich treffe kriegst du 6 euro von mir soll ich dir erklären wie velocoped funktiniert
wwas fu funkt eigentlich inn deinen henes
digga kühe auf der autobahn
glaubst du an gott
xtc
This was pretty interesting. Can you next do one where you put an lcd on your Leonardo, and add some sounds to it and a scroll button or 2, so you can have the sounds right on the arduino (not just a midi controller)? (Would be cool to use samples, but midi synth would also be cool I guess)
Arduino is really bad at playing sounds, you would need something more powerful, or some sound module for arduino
Hello, will it register more than one key pressed simultaneously? As in playing a chord on the piano?
Yes, I made this that way so it registers any amount of keys pressed at once.
fool fake! Links not code only fake and viruses
hey, first of all, thanks for the tutorial. i'm trying to get this to work since 2 days. I soldered everything correctly, resistor ladder and pins in order. What changes in the code should be made if the matrix is 8x6? ( the six pins are the numbered ones, the OTHER 8 pins are A3, A2, A1, A0, 15, 14, 16 and they are the ones connected to the resistor ladder)
Did you try to read these instructions in code and applying changes into it?
@@GoodElectronics yeah, but i can't understand what currentstate[] does, and how is it finding the right notes if requeststate is always true or false, wouldnt it result in the same note no matter what key is pressed? how do bools with brackets work? i cannot find any info online
also, why is digitalWrite(i,low) ? it doesnt even work for me like that, if i want some output (but wrong notes playing together) i had to put digitalWrite (i+2,low).
Hi. These variables with brackets are arrays. currentstate is the variable that stores current notes playing, requeststates is containing notes that will be pressed in the next program cycle. The value will be true for the index of key pressed. Did you properly connect resistors to them and made the changes as I wrote in the code?
@@GoodElectronics i made some changes and now It works perfectly. thanks a lot
Is It polyphonic?
Yes. Unfortunately shorting these diodes limits it to 2 or a few keys at once (which I didn't know when I was making the video), but if you leave them, it's fully polyphonic
@@GoodElectronics nice, thx
I have got 61 keys toy piano plz help me to code I'm really new at Arduino and matrix I will really appreciate that plz
Hi. You need to figure out what matrix it's using, and change the code to match the matrix. I wrote instructions in code to be changed as easily as possible, I hope you'll understand how to change it :)
can someone explain shorting the diodes and what the resistor ladder does and how I can get one or make one and how also how it's used?
You can purchase the resistor ladder on internet. But if you don't want to, you can simply put normal resistors. The only difference is that the resistor ladder is smaller. Resistors are very cheap.
is it essential to use resistor ladder
Yes, to pull up the keys pins so arduino can read them.
Finally made my MIDI keyboard today ! All thanks to you and your code. Just a little tweak in code made it work for my 32key keyboard 😊. There is no delay whatsoever 🐱.
could you send the code as I have 32 keys too, would save others time from making changes too
I have a 32 key matrix too(4*8)and my keyboard just keeps playing in the same octave can you send the code?pls
Should i send that here?
@@sangrambhumia9320 Nice work!
I dont have enough knowledge about programming.
i have everything wired up
Can you send a 61keys code? 8x8 matrix. my project is sitting for 1month now and cant seem to find the right code.
any help will be appreciated :)
@@andrewarguelles6945 I have code for 32 keys and I am not sure if it will work with 61 keys.
Can I still use the original speakers?
if you find a way to connect the pins to arduino still beeing able to connect them to the original board yes
Can we connect casio ctk2550 to arduino ? Pls reply
Hi. Most of keyboards are similar, so I think it will be possible
first of all, tks for the video :) I must say that i don't have any experience in arduino and electronics in general, but I got a question: I'm planning to create my own midi keyboard, but with two keybeds (2x49) from the same digital keyboard, would that be a problem with arduino pro micro?
Tks
This would be a problem, because you need to connect all pins to Arduino, and you have 51 pins in total. Arduino pro micro has somewhere around 20pins.
@@GoodElectronics alright, will study deeper on this.. tks for ur time :)
@@koozin69 use shift registers. You'll need to modify the code, but they aren't that hard to use
Will the arduino uno R3 SMD micro work?
No. Unless you find some software that works over serial and not with MIDI USB protocol
gr8 vid
i want to know the long code that you're writing .. :)
Hi. The code is in the pinned comment. It might be under other comments, it's not showing always, I don't know why.
@@GoodElectronics Thanx
@@GoodElectronics please put that code on discription box...
209 subscribe from me
Thank you very much for the video. Can you please tell me where I can buy a matrix button like in the video?
Hi, congrulations. And thanks for sharing. Do keys enable to play in velocity?
There's some velocity option in MIDI library, but I didn't test it, so i can't tell you anything about that.
Hi man, I found a method how we can play notes with different velocity, just use Piezo element, not simple buttons, so we will be able to play with different velocity. (price will be same)
@@vic2net but the piezos do not have continues playing ability. They can play sample wav based vstis continues but cant for digital vsts sound generators. And other problem is. Some piezos can be triggered even you dont hit if you play next piezos
For a velocity sensitive keyboard you need two switches per key at different heights. You can use the time difference between when each of them was pressed to calculate the velocity.
It's called "double sensor keyboard". There are also "triple sensor keyboards" to better detect fast key presses where you don't lift them all the way up (e.g. trills), but you can do almost the same with only two.
Nice.....
Is there any written documentation for the project ?
Unfortunetly, not (as I have seen, there's not documentation), but you can always search in the web, maybe somebody has written one?
(I responded before, but youtube maybe didn't post this comment, so sorry for that late respond)
Can i use ATMEGA328 Arduino Uno ?
No, only atmega 32u4 supports native USB. You can however test some drivers that are designed to be supported with atmega328 and midi, but I haven't tested these and I won't help you with them
@@GoodElectronics if i remove the atmega328 integrate will help ?
No, you need a chip with a native USB support, only atmega 32u4 supports that.
Been working on this for a while but can't get any midi output on my computer im using a 7x6 matrix and have altered the code accordingly im not sure how to do the resistor latter but im pretty sure everything else is right
Did you try to short the inputs with outputs by hand? Maybe the keyboard isn't working well with this circuit
@@GoodElectronics i found when i added my resistors on the one side and sorted it to raw I got 2 3rds of the keys working but I only got about 5 different notes I am trying to redo my wiring rn hopefully that will fix it and if not I will figure something out if it still doesn't work is there an email I would be able to communicate with you through to send pictures of my pin layout?
It must have some millisecond delay right
This delay is only for clarity and to not overload usb, but otherwise it will work without this delay.
delay of real piano is near 80ms
So what I am I supposed to do if I have the same chips in the circuit
If they're chips on this button pcb and there's no visible connector like in my keyboard, the only way to connect it is to solder wires to these chips, which is hard.
Sure: matszwe02@gmail.com
i looked up this video trying to remember Evan Kale's name hahaha prefect shoutout. What great videos he had
Hey Good Electronics , it is a very informative video ... Thanks ! ... and congratulation on reaching 500 subscribers, me being the 500th one ! :)
Does it have touch response
Do you mean if I touch a key, Arduino will send data? In most cases no - because keyboards have a membrane which you have to press for response.
can i use other programs?
Yes, that's midi protocol which is compatible with many programs
Hey, great video. It really encouraged me to build my own midi keyboard. Just asking how should I code if I want the velocity sensitive keys because I might get access to another 49 key piano circuit. Thanks in advance, even if you can't help.
That will be much harder to code, you will have to make some sort of voltage divider, but the code will be more complex
Hey, does the code also work for the leonardo board, a friend also wants to build and he already has the board and was wondering if there is anything to change for a different board
@@joemjaveevelaylo2327 yes. It's the same chip.
Good video sir please giw me the code please i can not find that
thanks, you save my keyboard life :D.... 100% working... I can't buy a resistor ladder so I make one.
How u made it ??
@@ti7adahab799 Just connects a resistor in parallel and I use (680 Ω ±5% (J)) Resistor.
@Albert Reveche How many resistors is needed to make one?? I cant buy a resistor ladder too, if possible can you share the pic of your board.
@@loveandlearn592 use same amount in the video. 7 resistor
please please help me write code for 32 keys keyboard
can you provide download link of your code
It's in a pinned comment, just copy and paste
@@GoodElectronics Thankyou I found your code in comments but its not pinned 👍
@@dharmeshsolanki4354 weird, i pin it and it unpins
i have a 10*6 matrix for my keyboard How to change the code ?
Firstly, you have to modify currentState, requestState, fixedKeys to be [60] instead of [56], in fixed keys write every number lower than 60 starting with 0 and increasing by 6, then starting from 1 and so on when you reach 59. Instead of "i
@@GoodElectronics k thx i'll try
I edited the code, so all you need is change your dimenstions, pinModes and digitalWrites as I explained in my code
Where I can Find the arduino Code?
In the pinned comment
I have a problem on the keys from D7 and above its not working when I unscrew it I saw unconnected wire but I dont know where is it connected
Check the place where these wires go into this keyboard buttons if all wires are connected.
Uhmmm... I kinda have a question. Can this circuit be used on mobile phone application? I have some applications that require a midi keyboard
If you find a way to connect via bluetooth or something to the mobile phone (maybe using an ESP32,) then yes, you can.
Sir So I Just Need To Copy And Paste This Code.......My Matrix is 7*6........How am I Supposed to do....
Yes, just replace matrix1 and matrix2 with your numbers everywhere that's shown in code
My Keyboard has only two ports one the output other the charging input 9.5v DC..... So Will I be able To Do This Project.....Also Can you Send The coding Script in a .txt File or Something Please....
These connectors are inside, you need to tear it down. Code is in a pinned comment.
@@GoodElectronics BRUH, You need both only arudino pro micro right?? And could you give me the when you have to type the code I mean the timestamp of it (The beginning one or the ones towards last) Please I don't have much idea about electronics... 😅 and How can I find out the matrix of my keyboard...Please Help me by sending the link to buy arudino pro micro.....
Thanx for Replying to me...
Midi Drum for Leonardo Please..
i can not find the code could somone give me the link?thanks
It's in the comment :)
how to make a midi keyboard using arduno nano for casio sa78 keyboard please make a video
Hi. I don't want to make a video for every keyboard, check how it this keyboard wired, if similar to my, you can connect it like I did
how to make a midi keyboard using arduno nano for casio sa78 keyboard please make a video
Hi. You need to check the wiring inside the keyboard if there's a similar cable set as in my keyboard. I won't make a video, because there are plenty of keyboards and most of them are wired exactly the same (with different number of wires, which is exactly explained in the code)
thank u soooo much this video help me a lot I'm a begginer and this help a lot
Modifed Pitch Bend and Modulation
Keyboard was 8x8 pin and my leonardo haven't 14 15 16 pin
14, 15 and 16 are the same as a0, a1, a2
Nice , but no velocity?
hey man ! thank for that video! i just wanna know where I can buy the arduino, the board and overall the resistance ladder
All these parts are available on eBay or your local electronics store.
@@GoodElectronics thanks !
I have another question: umm the keyboard I have has 61 keys, and also I have only one cable that comes from the keys' output, and it is 17 or 18 pins, so can I do it with that?
@@fl3ur_1nestimable I think it's also the same connection as I have, but you have these 2 cables joined as 1 cable, so you need to find in which place they're connected.
How to make a resistor ladder ? I can't find one..
Also can you share the picture of final version board?? (The main thing is the circuit so its logical to have the picture of it imo)
And what board to select on arduino IDE
You can purchase the resistor ladder on internet. But if you don't want to, you can simply put normal resistors. The only difference is that the resistor ladder is smaller. Resistors are very cheap.
great vid! helps alot! but could i use an ESP32 instead of an arduino pro micro for this?
I'm not sure, you have to check if it has native USB support and has arduino midi library
I like skema from yu ardoino
Awesome video bro!!! But where do i find that codes. And will it be same for a 32keys keyboard?
On the pinned comment (if it's not pinned, you need to scroll to find it, it unpins somehow), there's an explanation how to change pins inside it.
When i connect with piano to PC that piano was auto play so what should i do?
Make sure your resistors are connected properly
Great Video! can you upload the wiring diagram. i was wondering how your connections were wired.
Hi. In my case half of the keyboard ribbon goes to matrix1 pins, the other one to matrix2 pins. The resistor ladder is connected to matrix1 and I believe connects to gnd. And that's all.
Another question, which ICs did you use besides the Pro Micro?
Only pro micro, no other ics
pleasee do you have copy downloaded of video can you send me
Hi. Why do you need a copy of my video?
@@GoodElectronics actually I dont know about ardino never used and don't know to write code for 32key keyboard and more can you help me ?
@@GoodElectronics can you give me your insta I may ask there
I recommend you learning basics of arduino programming, it will be enough to find out what's going on in this code :) I'm gettings tons of messages from people that pleases me to chenge the code, but I think it's simply explained in it. If you will still have some issues however, you can write to my gmail available in my channel and I will help you :)
@@GoodElectronics thankyou very much i will definately learn
does the keyboard need to be in proper working condition for this to work properly? Actually a couple of keys in my keyboard are not in proper condition, so will the midi functioning be affected or does it only depends on pressing of key ?
If some keys aren't working, there's a chance that it's broken inside microcontroller which is replaced with arduino, but it can be also a broken cable. Arduino requires a slight signal to detect it, so even weared contacts could work. If it works, the key condition won't be distinguishable (if it is, try a higher resistance resistor ladder).
hello , pretty nice tutorial, but i have a problem, when connecting the pins to the right inputs, i get only few of the keys working, when i short the pins at the beggining of the keyboard i get the sounds, but cant seem to get them when pressing the buttons, might it be because of resistance? im not using resistor ladder, but normal 5k resistors in parallel.
Right, resistor ladder is resistors in parallel. You can try with some other resistance. I also recommend you to short each input with each output with a wire to check if it's working, then measuring if the keyboard shorts one of inputs to one of outputs after pressing a key.
Hi! My ribbon cable has 17 pins but I bought the Arduino Pro Micro that has 16 inputs/outputs so that means i will lose 1 octave from my keyboard ? It has 61 keys.
In simple terms: something like that, but it depends of the both amounts of cables in both ribbons. It might be one octave, 6 keys or something similar.
@@GoodElectronics Perfect, thanks for the answer! As soon as I receive the products I ordered I will start to work on the project!
@@GoodElectronics I have some questions about the keyboard matrix, I used the multimeter to measure the continuity between the pins and I managed to link the respective pins to all the keyboard notes but I don't know how to connect these pins to the arduino and how to change the code to make it work. I have some experience with C but could not make it work with the arduino.
Hi. The basic experience will be enough, I tried to explain everything in the code. Just change some numbers to the other numbers, maybe remove some lines I marked. (Sorry for long response, but youtube doesn't show reply notifications)
Can i plug a regular midi and this Arduino midi in same time to PC? İ just want to make a Arduino music box. İ plug it into PC like regular midi. And i try to play songs with regular midi and Arduino midi with diffrent enstrumants in same time.
I think that it will be possible without any issues.
@@GoodElectronics i will try and notice you
So how would I do this with a 6 x 11 matrix configuration? Would it be possible to change the matrix parameters to achieve the desired result?
Hi. You firstly have to check where these 2 sets of cables split. In my code there's an instruction about setting up different amounts of pins. Write if you have any other questions.
For midi ribbon controller
4:25 - So when we play notes We can play more than one note? but how much notes we can play at once?
Yes, this connectrion allows for more than 1 key pressed. I made a mistake and I shorted these diodes. If you don't short them, you will be able to play as many notes as you want.
What are the value for the resistor ladder?
Every value with k will be OK, so 1k ohm will be OK as well as 100 k ohm
@@GoodElectronics hi my matrix is 9x6 what i should be changed for the code? I have 49 keys on the board but only 15 pins coming out.
I think that you need to change things that are mentioned as matrix1 and matrix2 to your values, and the program will skip non existing keys.
@@GoodElectronics Hello after testing the code which was ok, now I connect old yamaha keyboard to arduino and fl studio but no sound coming from it, i swipe matrix cable still no sound, do i need to short diodes like u do for it to work?
hi,thank you for the video,just one question the keyboard im using have two faders, can i add this two faders to this cofiguration? and if i could do it, how?
Hi. I don't know how MIDI uses faders, but I think it will be easy. Add digitalRead to a pin with connected fader and send midi command (you need to find how to handle faders in midi).
brother a question, I bought the pro micro and connect as it is in your video with your code (I have a 54-key keyboard so I suppose it's like in your video) the problem is that when I connect to a program all the keys become crazy, how to solve it?
when I put the resistance that you show in the video it does it but only in one part but it doesn't let me use any key
Make sure you have your pins connected to proper Arduino pins. If they're connected properly and you have a multimeter, check if after pressing a button, one of rows shorts to one of columns (one of pins in the first set to one in the other one). If it does, check putting a wire directly between one of Arduino input pins and one of the output pins.
@@GoodElectronics If I have it well connected, I don't know how to do the check you said, but I connected it to the original board and they work, could you send me a connection diagram or something? I don't know why that happens, I have practically your same matrix
short one of the input pins to one of the output pins (for example 2 and A2), it should make a tone
@@GoodElectronics I just tried it and if I listen to notes, I have it without the matrix and I listen to the program that uses (vmpx) noise like distortion, I suppose it will be the matrix although it is rare because it works on the original board
What Do You Mean Complicated If There are Chips On My Piano Circuit... Please Answer...
If there are sime chips, there's a chance that wires going out of this board won't work as in my keyboard, they will be connected to these chips and they will be sending signals in a more compex way.
@@GoodElectronics in that case you would need to solder cables directly on the pcb, so it would be a more tedious job. But still doable.
How many pins is the resistor ladder supposed to pull?
Hi. All of the input pins connected to the keyboard. In the code they're marked as INPUT.
If you are using ONLY analog pins (like A0, A1, A2), you can simply write INPIT_PULLUP instead of INPUT and then arduino itself will pull them up.
@@GoodElectronics Thanks alot
What would you suggest I do if I cannot find a resistor ladder... It seems out of stock in my area or something
You can use resistors connected in parallel to 5v and pins
Sir How Can I find out My Matrix.....Also Can You Tell me How to Make That Board You Made That Connects all Components........ Have Got 61 Keys Will It Work On That...Thank You .......Please Reply ASAP
Hi. I found my matrix by probing multimeter with continuity tester and checking which wires are able to short with the first wire. In your case it might me 7x6 matrix, so you only need to know where is this "split point" between 2 sets. To make a board you need to buy an universal board and solder resistor ladder to arduino (where it has a dot - connect 5v, other pins connect to input pins).
Sir You Have Helped Me So Much Thank You
Da pottan pille veendaatha panikeert poovenda
Can you please provide codes?
It should appear in a pinned comment
crazy key result
it's a great Can I get your live support to make this midi?
We can try to type on this chat :)
@@GoodElectronics Great ! I will inform you when I will require your help.
Please code for 8x8 keyboard
Hi. I tried to write instruction in code the cleariest i can, so you will be able to change the code to work with your combination.
super cool
Where can I buy this type of body of keyboard and circuit?
I don't know, you can buy cheap used keyboard, it would contain the same connection.
Hey nice video but I've been unsuccessful in getting the code and the resistor ladder... but I happen to have the keyboard and I would appreciate if you would send me the code
The code is in the pinned comment. You can use resistors connected in parallel to 5v and to your pins instead of the resistor ladder.
I still can't find it
Here you are:
// Here's the CODE:
// works with keyboards with matrix 7x8
#define matrix1 7
#define matrix2 8
#include "MIDIUSB.h"
int octave = 0; // add or subtract 8 for one octave
bool currentState[matrix1 * matrix2];
bool requestState[matrix1 * matrix2];
void setup()
{
//-----matrix1 number of pins-------
pinMode(A0,INPUT); //1
pinMode(A1,INPUT); //2
pinMode(A2,INPUT); //3
pinMode(A3,INPUT); //4
pinMode(14,INPUT); //5
pinMode(15,INPUT); //6
pinMode(16,INPUT); //7
//-----matrix2 number of pins-------
//each matrix2 pin must be one above the previous one
pinMode(2,INPUT); //1
pinMode(3,INPUT); //2
pinMode(4,INPUT); //3
pinMode(5,INPUT); //4
pinMode(6,INPUT); //5
pinMode(7,INPUT); //6
pinMode(8,INPUT); //7
pinMode(9,INPUT); //8
}
void loop()
{
readKeys();
writeKeys();
delay(1);
}
void readKeys()
{
for(int i=0; i
Im indonesia y cen speec idonesia
Fantastic project.
Is adding a sustain available for this type of circuit?
I don't know, I think it's available in midi programs.
Bagaimana cara menambah pitchbend?
please can u make a next version by using somekind of mp3 shield or anything. so u can play it without pc. :)
Arduino is very limited, so playing audio on it will be hard and playing multiple notes will be impossible as far as I know
@@GoodElectronics i have found a several video on youtube. they using vs 1503 as a midi sound bank. but i dont really know if it can play multiple notes. because that module in my country has a high price.