Accordion MIDI Controller  Project Problems

Hello,

I'm looking for some kind of a different code for my Accordion MIDI Controller Project. The software that I bought and try to use, misses half of the notes when, I hook up the Sound Module to Accordion MIDI Output. When I changed this initialization statement:

for (X=1; x<=4; x++){
digital Write (LedPin, High ) };
delay (300);

with replacing this x<=8; instead of x <+4; I got already fewer deaf notes coming form the Sound Module. So there must be wrong line in that sketch that doesn't know how to keep all switches in proper sequence.

The Matrix that I built consist of 8 data lines (represented by pins:2,3,4,5,6,7,8 and 9) and 9 (nine output lines represented by pins: 10,11,12, 14, 15, 16, 17, 18 and 19). Led Pin 13 is used to send the messages, I guess.

Incoming data starts coming from the first sector of the Matrix Grid
Starting at Switch 0, by pressing F that is connected to Pin 2, then Switch 1 – F# to pin 3, Sw. 2 – G to pin 4, Sw 3- G# to pin 5, Sw 4 – A to pin 6, Sw. 5 - A to pin 7, Sw 6- A# to pin 6, Sw. 7 – B to pin 8, and Sw. 8 – C to pin 9,
from the second octave on the accordion keyboard. Then second sector of a grid starts at C#, D, D#, E, F, F#, G, G# and so on till the treble sides gets to switch 40 at pin 2 or A6 or 93 or 5D h.

Every switch has a note assigned to it from first F3 which is 53 or 35 h, and the whole sequence of keys chromatically go up to note A6 note Nr. 93, 59 all divided on sectors of eight or less with disregarding the placement of notes in octaves. This was a plan fro that Matrix.
The ideal Matrix would be be a grid separated by notes in every octave, making 4 +2 x 12 Matrix grid, but since this is not a case in this project, I have to go according to the plan that I purchased, but the sketch as a part of this plan doesn't work at all, since it looses too many notes in counting and sending signals to the Sound Module. It works in a sense that the sketch can be compiled and send and recorded in the EEProm.

I cannot write here a code of this program, since I feel that it belongs to the supplier and it's too long and is too complicated. In this situation, I'm grateful that the supplier released the code for me. Probably, he knew in advance that this would not work.
Don't tell me to look for connections, wiring mistakes, etc. All of that was checked and rechecked every step the wires were soldered, and after all the PC Board works but not the way it suppose to. Basically, it's dysfunctional. It's a shame, that such nice looking Arduino clone and the best instructions, you can find on internet doesn't work.

I'm looking for much simpler solution written in a simpler sketch.
that would send the desired note when I push the key, stop sending the signal when I release the key and at the same time count the notes and do not mix signals or make those notes deaf.

Is there any sketch that would answer my problem.
I'm looking for a sample of a code that is written for Arduino regardless for a Matrix or the MIDI grid structure. It could be for accordion, piano or the guitar.

.I want to see how other people with the same interest like me figured out counting of notes, and sending those notes to proper switches, play them by the Sound Module without loosing the signals from the pressed keys.

Any idea that could be tried or implemented is graciously welcome. Yesterday, I thought that I solved the problem of counting the notes, but today are at the same spot, resigned and ready to quit this adventure. I spend on it a few weeks of hard work, dreaming and thinking about it even while sleeping. No help from the supplier as yet.

Any idea? I do not know C/C++ programming. Just barely understand it when I started to use Arduino PC Board - clone for this project. I'm willing and ready to learn.

Best Regards,
AccVlad

Just a short note here :slight_smile:

Are you aware that the delay function is a blocking function ?

Arduino can not do anything while the delay time passes. So each time after your for loop executes theres a 300 ms period where no switches are read, and nothing else happens.

Thats almost 1/3 of a second, in a musical context a lot can happen (and be missed) in 300 ms.

Thanks MikMo for reminding me about that. I have tried your suggestion but did not improved that much. On other hand, I wouldn't advice anybody to remove "delay(?) function, since this is a kind of protection to the board and EEProm.
I located the problem, but I do not understand at this point if this is a software problem or a hardware blockage. I have been loading that EEprom 128, for 50-60 times. Basically playing around with it for a few days. Making correction in sketch lines, and checking and rechecking again and again all wires, connectors, etc.
Indeed, it became to me a real devotion and the love to this Arduino clone over this last three weeks. At this point, I know that the situation has improved. Now, I have “only” 5 (five) deaf notes in the third matrix line coming from Pin D4 on the Input side. Those empty notes are as follows: G - 55, D# - 63, B -71 G – 78, D#- 87. So this is a symmetrical blockage and might be the software problem. The last test that I will try, will be to see if the EEProm sends the Input code from the sketch on Pin D4, that manages DC current of the third line going from D4. Yet, I do not know how to do this test. Replacing the EEProm is faster and cost only $5, but I have to order it and wait for it. So basically, I'm on the right track, yet I would like to read how other fellows would approach this to solve this problem to the end. The easiest way would be to buy the commercial Accordion MIDI controller from $500 up to $3M- $5M for the V7 Roland Reedless, “squeezebox.” Yet, doing such a project and accomplish the real thing makes the world go round. It's saving lots of cash too, and the pleasure of accomplishment is indescribable. Such a gadget is very hard to make, requires huge amount of free time and devotion, because it needs countless hours of work and in addition the extensive technical knowledge in repairs of this instrument. That's why Accordion MIDIs and Controllers are many, many times more expensive than piano MIDI units, however, the end of such work is what counts the most. One might smile all the way to the back with full pocket of saved cash. This is a real sense for me to keep working on such a project.

Enjoy the story,
AccVlad

I want to report to all, that I finished a major works on my project. Only some minor mechanical details remain to be finished.

Today, I got exactly what I wanted for all that time, while I was working tirelessly on this project. Yes, I was able to send every note from my MIDI Accordion to the Sound Module. I heard the every sound note chronologically, one after another, and even played some melody. Have experienced no problems when pressing every key from F-1 to a2 on the treble side. This is the way, an every project should end.

AccVlad

Cool!

Congratulations, it sounds like you succeded with a fairly complex project.

Now you have two options:

  1. play accordion
  2. find a new even more complex project

:wink:

Hi, I'm very pleased that you have sorted your problems, well done.
Could you remind me where you got the code from?
I am aiming to build an Arduino based melodeon, (button Accordion), mainly so that no one else has to suffer my practice sessions!
Any help would be most appreciated.

I had also lot of trouble before with non-Arduino commercial units, so those problems that I mentioned before about Arduino-Miduino clone should not be even called as problems. This was actually learning process, that everybody who wants to have MIDI controller must go through.

Yes, I worked on Arduino-Miduino clone designed by Tom Scarff from Ireland. His company is on the Arduino approved list of MIDI kits suppliers. Tom has the most informative web page you can find on internet when comes to MIDI projects. I spent "tons of hours" studying his web site out of curiosity.

If you have the Sound Module with the program changer dial this project will be all you need. If you don't have one, the MIDI Program Change unit has to be added to the whole thing.
I plan to do that on next accordion.

Warning! Anyway, you have to be very good accordion technician to embark on a project like this. There are more mechanical-technical fitting problems to be solved and "tons" of tinkering on th eway to sucess. There are much more other work that has to be done than with the the MIDI itself. Every squeezebox is built in a different way and it has many obstacles to go through. Best way is to buy Roland for $4M - $5M if you can afford it.
Good Luck!

Thanks for the advice I will check tom Scarff's stuff out.
I'm not trying to make a commercial box, I have an old accordion that was needing repairs which is going to be the donor instrument, and I will machine a new button board to take some switches.
Having a fully equipped machine shop at my disposal, along with electrical engineers and software engineers for colleagues may work in my favour I think!
Thanks again for the advice.