Read Midi File From Built-In SD Slot, Teensy 4.1

Status
Not open for further replies.

grinch

Well-known member
Hi, I am working on a project where I would like the functionality of my Teensy 4.1 to be controllable either by USB midi input from a laptop, or by a prerecorded midi file on an SD card read by the Teensy 4.1's built-in SD card slot. I have the USB side of the project working well, I'm now moving on to the SD.

It seems like reading a midi file from an SD card should be a solved problem at this point, and I'd rather not reinvent the wheel here if I don't have to. Some online posts have pointed me towards this library for Midi file parsing, but it seems that it works with an SD library that's different from the one the Teensy normally uses, and I'm not sure how the two will interact: https://github.com/MajicDesigns/MD_MIDIFile

Has anyone else used this library with the built-in SD card reader? If so, what modifications were necessary to get it to work? Are there any other libraries out there that might better suit my purpose?

Thanks!
 
Hi @grinch, did you solve your problem ? :) I'm exactly in the same situation right now and looking around for alternatives, if you have some clues I would be very grateful
 
I have now tested with the original files from
https://github.com/MajicDesigns/MD_MIDIFile

and used

SMF.begin(&(SdFat &)SD);
as Paul said
https://forum.pjrc.com/threads/6627...ilt-In-SD-Slot?p=270432&viewfull=1#post270432


It's sending the midi data to the PC using usbMIDI
and received in FL Studio without any problem.


I did create a separate repository
https://github.com/manicken/MD_MIDIFile_Test

It's also working with Arduino IDE
just copy all files in src to your new sketch folder
and rename the MAIN.ino to match your sketch name
then restart the IDE (easiest)
 
Status
Not open for further replies.
Back
Top