Beginner trouble with coding MIDI transpose function (actually more Arduino code

Can we start with what Arduino you are using? From a quick look at the code you seem to be trying to use SoftwareSerial on the same pins 0 and 1 that the hardware Serial normally uses. And you've included both MIDI.h and MIDIUSB.h which is confusing. And then you don't actually use SoftwareSerial anywhere in the code.

Anyway from just a quick look it seems that your transposing function is based on a misunderstanding about how arrays work. You seem to have the idea that the noteFunction[] array entries will dynamically change value without your code having to do anything about it but it doesn't work like that. You defined e.g keyroot1 to have the value of currentroot AT COMPILE TIME i.e. 0 and then put it into the noteFunction[] array. But that value is now fixed. It will not change just because the value of currentroot is changed at some later time. If instead of just printing currentroot you print noteFunction[ i ] a few times you'll probably see what's happening.

You might find that passing something like (currentroot + noteFunction[ i ]) into NoteOn or NoteOff instead of just noteFunction[ i ] is nearer to what you want.

Steve