Library to play .mid files on stm32

I've been trying to play .mid files on my stm32f103 for a long time, but without success, I know that there are several libraries that do this but they all only work with avr architecture, can anyone help me or indicate a way to play these .mid files from an sd card on a digital pin.

Stm32f103 mcu doesn't have a DAC, how do you intend to play music directly to the pin?
Please show an example of the libraries that able to play midi on avr

I don't think @gsmjas wants to play the music directly on that pin. It would mean to have a synthesizer on the MCU - what I think is impossible with that limited ressources. I think he wants to create the appropriate midi commands with the correct timing to play it on an external synthesizer.

sorry for not explaining it well, @MicroBahner is correct, I just want to process the midi file in the mcu and get the parameters of each note, I need to reproduce the midi in some digital pin of the mcu using the Tone() library, for that I need the frequency and the time of the notes

It should be possible on stm32. What is the library you used in avr?

O tried a lot of librarys, MD_MIDIFile and others, but ever received that is not compatible from compiler

That's still something different than I thought. So you really want to create tones directly? But that should be possible with very simple midifiles only. Usually a midifile contains commands for many instruments that are played in parallel to create polyphonic melodies.

yes, I want to play directly on the pins, but my midi file contains only 1 instrument and it's simple, I'm analyzing the HEX to see if I can do it easily, the problem is in calculating the time of each note that I haven't understood very well yet

Which stm32 core do you use and which sketch?

I installed the MD_MIDIFile library and tried to compile the example MD_MIDIFile:Loop.ino

With the core of RogerClark it compiles with only some minor warnings, but using the core of STM there are a lot of errors.

I am using STM core, i’ll try the other core and see what happens

Minor quibble, but "STM32F103" is strictly a microcontroller line, some of which have DACs. The stm32f103c8t6 that is usually the device from this line we associate with Arduino, because it's cheap and ubiquitous does not.

Good luck. I couldn't test, because I don't have the SD-Card hardware.

thanks for the help, with the core of RogerClark it worked perfectly!!!!

I'm glad to hear that :+1:. Happy that I could help