MIDI to Arduino

How would you transfer and store a midi message on an arduino, to be later recalled to drive a series of motors? I couldn't find any resources for schematics or coding, so any links would also be appreciated. Thanks.

How would you transfer and store a midi message on an arduino,

Through the serial port and store it in a variable or an array.

I am not sure what you are having trouble understanding, can you be a bit more specific.

Grumpy_Mike:

How would you transfer and store a midi message on an arduino,

Through the serial port and store it in a variable or an array.

I am not sure what you are having trouble understanding, can you be a bit more specific.

I guess I'm having trouble choosing which direction I want to take my project. I know that, at least, (1) I have the option of storing midis on my computer and just feeding them from a DAW (is that correct?) to my arduino, which would act as a sequencer to control different servos with each note; and (2) I can also program my arduino to receive and store a midi from my computer, and without needing my computer anymore, have my arduino act as a sequencer to control different servos with each note based on the midi stored in its memory. Personally, I'd prefer the second option, but that ultimately depends on if both options are comparable in difficulty/complexity, or if one is considerably simpler. (Of course, any other possibility that's even simpler to pull off would be nice, too.) Thanks.

I can also program my arduino to receive and store a midi from my computer, and without needing my computer anymore, have my arduino act as a sequencer to control different servos with each note based on the midi stored in its memory.

Yes you can do this but you have a choice of where to store things. If you store them in variables then you loose the data when you remove the power. If you store them in EEPROM then they persist when the power is removed. Either are possible. Using EEPROM is quite easy:- http://arduino.cc/en/Reference/EEPROM It has a limited number of write cycles but in this application you are not going to exceed it so don't worry about that. Concentrate on devising a data structure that maximizes the efficiency of the EEPROM use because you only have 1K of it. So instead of storing the whole MIDI message for example just store the not on number and a single byte time. The granularity of the time will determine the length of your sequence. Or the time byte could be a time from the previous note.

All in all it is quite a doable project.

Thanks, Grumpy_Mike. I also believe this is all quite doable, but at the moment I'm have trouble finding the tutorials for it. I may see if I can get the code and/or schematics from the creators of the vibratron at carnegie mellon. Aside from that, I'll just continue my research online.

Would step 9 of this instructables page, http://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/step9/Receive-MIDI-Messages-with-Arduino/, be the correct instructions to follow to accomplish the first part of my objective (to save a 1.3 kb midi onto my arduino, which I want to program to control multiple servos according to the midi message)?

Or am I approaching this the wrong way by breaking down my objective into separate parts and then trying to link the parts together (i.e., 1. figure out how to save midi onto arduino, 2. figure out how to control multiple servos at once, 3. figure out how to coordinate servo activations with midi message)? Thanks.

That first code is fine, the third I woudn't go there. What arduino do you have? There is no room for storing 1.3K of information in a non volatile way on an Arduino without extra hardware.

Thanks, Grumpy_Mike. I'll probably use the arduino mega, but at this point, I've decided that involving midi input/output is probably not worth the trouble given my experience level, so I've decided to manually convert my midi of interest into servo code for my project, which I believe I can do with the tutorials I've seen.