Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to play MIDI files? #18

Open
robatron opened this issue Feb 29, 2020 · 2 comments
Open

Question: How to play MIDI files? #18

robatron opened this issue Feb 29, 2020 · 2 comments

Comments

@robatron
Copy link

robatron commented Feb 29, 2020

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!

@nathanRamaNoodles
Copy link
Owner

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 😓. 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.

@robatron
Copy link
Author

robatron commented Mar 2, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants