I am studying media engineering in Hamburg, Germany. We were given a cheap keyboard (music). We were asked to have the Arduino trigger notes on the keyboard and send out a MIDI signal.
Sadly we do not have much guidance and have to work a lot of things out on our own.
My group and me decided to have a melody pre-programmed on the Arduino. This worked pretty well. Our next goal is to make this melody transposable. So e.g. we have a simple triad: c, e, g. We would like to be able to read a potentiometers resistance. So when e.g. the potentiometer is turned half way the melody is transposed to: g, b, d.
Our situation is this:
- we can play notes already. So we have that out of the way.
- we were thinking of assigning an int number to every note. So e.g. C2 would be 0. C#2 would be 1, etc.
- the value that the Arduino reads from the potentiometer would simply be mapped to an interval of numbers (e.g. 0 to 255 would be mapped to 0 to 7). This mapped value would then be simply added to the value of the note in the existing melody.
Our problem currently is this:
- we had to use a matrix to send the appropriate signals to the keyboard. So every note has its own combination of row and column.
I tried this:
- assigning variables: "int F = 2;", "int F# = 3;"
- I did not have the opportunity to test this since I have no Arduino at home. But I hope that "var =F + 1" simply spits out "var = F#".
Maybe you can correct me on that already?
The problem is that e.g. the F# has row 2 and column 8 assigned to it. So I need to be able to add numbers to the existing note, therefore transposing it (say F to F#). And at the same time this new calculated note needs to refer to the row and column of this new note (F#, row 2, column 8).
Here comes my question finally: do you have any idea how to approach this problem?
We would be very happy for help!
Thanks in advance,