-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Feature Request: Midi audio rendering #158
Comments
Maybe this is what you are looking for: https://github.com/schellingb/TinySoundFont, it's a library just like this one but to render SoundFont files. It's really good. I'm using it in together with MiniAudio and they work well. |
midi is a sequenced audio format, miniaudio is about sampled sound. you need a midisynth, and plug that into miniaudio. |
Thanks for the request! Lets not prematurely write this idea off - this isn't the first time I've had a request for this. Just to be clear, you're only concerned about the playback of MIDI streams? You just want to load a MIDI file, attach a SoundFont and then hear something out of the speakers? There's already the notion of a decoder in miniaudio ( That said, however, the The bad news: if this were to go ahead, it won't be happening any time soon as I personally don't really have much interest in MIDI and have a seemingly never ending list of other things to do... We're talking years before I'll even think about this, if at all. I can't speak for TinySoundFont - I've never used it, but maybe worth looking in to? |
I'm sorry, I'm not trying to be dismissive, the request is a valid and a nice-to-have one. I'm just trying to point out a solution I've for this. You can see it here https://youtu.be/FJNfw00HUgM. I'm using Miniaudio + TinySoundFont in all the music you are hearing in that video, which is in MIDI format. It works pretty well and I'm sure a better job can be done with more robust code. I like the idea of having a decoder (like you already have for WAV or MP3) that can load and play MIDI files. Here is the code if you are interested: https://github.com/acoto87/war1/blob/05b261aac3e3a4ee4dd3d27ad99098cd07b2cd26/src/war_audio.c#L178 |
Yeah there's a definite market for MIDI, and having basic support for MIDI via What will really accelerate integration of basic MIDI playback will be a high quality library I can plug in as a backend, just like I do with dr_wav, dr_flac, etc. |
@mackron I like the idea of wrapping TinySoundFont and even OpenSFZ with I guess the underlying question is: How deep should we go with MIDI if we start to support it? Since @acoto87 has already done work with the two libraries of these it might be worth asking for a proof-of-concept PR to add a few files in the What do you think? |
Nobody should put any work into any kind of PR right now as I haven't yet decided on whether or not I'll even support MIDI directly. That's a major project that, if I was to support it, would be years out from now. |
I've been pondering MIDI vs MiniAudio in the back of my mind for the past week and I have to agree that rendering probably should NOT be done directly inside of MiniAudio. There are too many backend possibilities (FluidSynth, TinySoundFont, OpenSFZ, etc.) and favoring one over the others hurts this library in a big way. There really needs to be more clarity on the best solution for MIDI... I'm wonder if the "right way" to handle things is to do MIDI routing in the effects chain and then providing "effects wrappers" to render MIDI from various backends. (essentially like modern DAW plugins) That seems more flexible than being married to any backend and could provide an entire solution for software synthesis.... (Not sure that's where you want to go... But...) MIDI needs a different ring buffer style because the MIDI clock and signal are very different from audio frames. Also MIDI is a vast specification and is getting more confusing! (Have you seen MIDI 2.0?) So that may be a good arguments for avoiding MIDI and letting another library handle things. Ultimately, I think a lot of this has to do with the final design of the effects chain system and how it handles side chains... Thus, we really need to wait for what @mackron does with 1.0 before integrating MIDI begins to make sense... |
My feeling is that you're right ~
I'm exploring that right now in my LabSound/LabMidi libraries, and am finding that a design for a flexible solution involves a lot of side work in voice allocations, priorities, channel interpretations, and huge inconsistencies between authored Midi files; it's not straight forward. I took a little side trip down Tracker emulation, just to clear the palette and get some nice sounding results without melting my brain :) |
I've considered this further and have decided that I'm not going to be adding built-in support for MIDI. It's just that it can be done as a layer on top of miniaudio, and an external implementation can implement it as a |
This feature request is about adding one of the oldest known general purpose audio formats. This can be split into 3 main features needed to accomplish the whole spec.
The text was updated successfully, but these errors were encountered: