Noodle-Synth icon indicating copy to clipboard operation
Noodle-Synth copied to clipboard

Question: How to play MIDI files?

Open robatron opened this issue 5 years ago • 2 comments

From the project description:

A User-friendly Arduino/Teensy/ESP8266 Library to play MIDI files

Sorry if I missed this, but how does one play MIDI files with this library? I saw the How to Write Music section, but didn't see anything about playing an existing MIDI file. Do the MIDI files need to be converted to this "RTTL" format or something?

Awesome project, BTW!

robatron avatar Feb 29 '20 18:02 robatron

In the MIDI example listed here, you must use a MIDI serial that sends data to the RX pin of the Arduino(If you want to use it with a computer, you must use Hairless-MIDI). Or you can use a Teensy as a USB-MIDI device shown at PJRC's site. Then simply plug the Arduino/Teensy to a computer and play the MIDI stream. I prefer teensy because it uses fewer wires :)

Here is a video of me playing my piano and using the USB host shield to convert USB MIDI to regular MIDI and then feeding them into the RX pin of the microcontroller. You can also use Anvil Studio to play many popular midi files to the Teensy. Here is a video of that too.

I intentionally had the idea to make a library that would play a MIDI char array, but I never got around to that :sweat:. I don't how to interpret MIDI rests and notes. But it is definitely possible to implement this feature.

So that's why I've been using a separate Arduino to stream the MIDI and using my Noodle synth to play it.

This was a hobby project back in freshmen year, so now that I look at my code, it looks so ugly XD.

nathanRamaNoodles avatar Feb 29 '20 19:02 nathanRamaNoodles

Thanks for the info! I don't know very much about MIDI... Do you know of any other projects that can play MIDI files on an Arduino? Also, could your library play MIDI files if first converted to RTTL format? Looks like there are various converters online.

robatron avatar Mar 02 '20 16:03 robatron