Go Down

Topic: Send CSV to Arduino (Read 660 times) previous topic - next topic

motomoto

Hi everyone,

I'm starting on my first Arduino project. Originally I wanted the arduino to receive a MIDI file through the serial port, decode the MIDI file, extract the drum notes, and output the drum sequence to different digital outputs.

I did some research and realized that it's not an easy task to decode MIDI files on Arduino. I found that it is a lot easier to use a tool like MIDICSV to convert the MIDI file to CSV format on my PC and then send the CSV to the arduino.

So what is a good way to send CSV files to my arduino and store its contents to arrays :~?


retrolefty

#1
Nov 22, 2012, 02:30 am Last Edit: Nov 22, 2012, 02:33 am by retrolefty Reason: 1

Hi everyone,

I'm starting on my first Arduino project. Originally I wanted the arduino to receive a MIDI file through the serial port, decode the MIDI file, extract the drum notes, and output the drum sequence to different digital outputs.

I did some research and realized that it's not an easy task to decode MIDI files on Arduino. I found that it is a lot easier to use a tool like MIDICSV to convert the MIDI file to CSV format on my PC and then send the CSV to the arduino.

So what is a good way to send CSV files to my arduino and store its contents to arrays :~?




Well to the best of my knowledge CSV are simple ascii text files where commas are used to separate the values being sent ( http://8help.osu.edu/1701.html ) and the end of line as a record marker. So as arduino serial commands are designed to read one character at a time, your sketch coding will have the responsibility to test for each new character being received by the arduino and store it into an array while also keeping track of comma characters and end of line characters. Perhaps there is some 3rd party library out there that can process and parse complete record lines for you?

Reply 7 in the following posting seem to describe the major steps your sketch needs to take:
http://arduino.cc/forum/index.php/topic,122955.0.html

Lefty

Go Up