I'm building an instrument, which plays MIDI files. I'd like to control the instrument using my phone, so Arduino Cloud comes in mind. I'd like to choose tunes and playlists from my phone and control the playback from my phone. But instead of having all music data on the actual instrument, it could be more convenient to have the music data (the MIDI files) in the cloud. Maintaining the whole collection of music and adding music could happen with a computer, from the computer to the cloud. But could Arduino Cloud handle the MIDI files, or do I need to use some other file servers for them?
The Arduino IoT cloud is designed for telemetry data, control and configuration, not for storing large binary files or MIDI songs, so some external file storage will be needed.
Hi @Johan_Ha. I think the only way to do this with Arduino Cloud alone would be to encode the MIDI data in the Thing sketch. This means the data is compiled into the sketch that runs on the Arduino board, and thus you must upload the sketch to the board after each time you want to make a change to the MIDI data.
I don't know of any MIDI-specific examples, but this approach is definitely taken for image data. There are tools (example) you can use to convert an image file into a .h file that contains a C++ array of the image data. That file is then added to the Arduino sketch, which reads the data from the array.
Or another similar example is the data for a collection of LED matrix animations that is stored in a code file in the "Arduino_LED_Matrix" library:
That's what I do now. I have a reduced MIDI structure and it works fine. But in the long run it's much work, compared to just upload a MIDI file to a file server somewhere.