So I wanted to have something as modular as possible. If you look at the pictures you can see all octaves are independant. How did I achieve that?
First I put in place a master/slave system. I want a master that in the end will play notes, so each octave need to bring its information to the master.
Given the tests from the touch board, I was thinking to use Arduino + MPR in each octave. I2C was taken by MPR, So I thought about using serial as my communication bus.
I will create 2 serials one up to the master, and one down to the slave, so that the master can drive leds. The arduino has only one serial so I'll use SoftwareSerial library for the second one.
BTW, I can also use less cheaper arduino with 2 hardware serials. I may do this for future ones.
For the communication to be as reliable as possible, I used Category 5 ethernet cable. between each octave and the master.
Instead of having all cable that start from the master to each slave, the serial bus is used to pass data from one octave to the next (or the prev depending the way data are flowing). I'll add picture of the workflow when I have more time.
The process is :
During the init phase, the master send a message to the bus. the first octave that respond will get n°0, then the master send the same message. the first octave already have an Id, so it passes the message to the next one that will answer it took number 1, and so on till there's no more answer.
At this time each octave has a number and know where it fits in the chain.
When master want to light a note, it will send a message on the down bus. this message will have a letter saying light note, the number of the octave (between 0 and 8), and the number of the note in the octave (between 0 and 11). A message looks like "L1310". L is for light, 1 is for on, the the 3 means octave 3, and finally, the 10 is for note 10.
The first octave will receive this message, look at octave number, it's not for it, so it will pass it to next till the message reach its destination and is processed accordingly.
For note playing it's the same but the other way. when a note is touched, the octave will send a message on up bus. this message will be something like "N1202" meaning N:Note, 1:On, Octave:2, Note:02.
It works pretty well even if I had to tweak speed on serial bus.
The master is also an arduino, with a midi board attached to it and a alphanumeric keyboard attached to it. Keyboard allow selection of music instrument and a few other stuff. but basically when it get the message as described, it process it by sending a midi code (So, Yes the big piano can also be used as a midi input and drive a full fledge midi synth).