Open spessasus opened 1 month ago
RMID is a different file format than MIDI, which is currently not supported. Hence, this is a feature request, not a bug. And to be frank, my personal motivation to support this is nearly non-existent. Fluidsynth's builtin MIDI player is very basic. Yet, I would probably accept a PR for this.
I wrote a complete and precise version of the SF2 RMIDI standard and I've updated the link in the issue.
Also, here's another test file: Field.rmi
I didn't look up any official RMID spec. But pls. keep in mind that RIFF usually has a 16-bit alignment requirement. The embedded SF probably fulfills this requirement. I'm not sure if the MID has to, but if is has, it won't be a simple "read MIDI from memory" operation. One would first has to get rid of the padding bytes.
I didn't look up any official RMID spec. But pls. keep in mind that RIFF usually has a 16-bit alignment requirement. The embedded SF probably fulfills this requirement. I'm not sure if the MID has to, but if is has, it won't be a simple "read MIDI from memory" operation. One would first has to get rid of the padding bytes.
The pad bytes aren't taken into account within the RIFF chunks. That's how the specification describes it and that's how Microsoft's RMIDIs are made as well.
As you can see, the chunk size is odd, while the actual chunk has bytes ad the end.
Also I've linked the specification for the SF2 RMIDI format, which is backwards compatible with the DLS version, so simply using that would work.
Ok. So then my preference of implementing this would be to teach both, the MIDI player and the soundfont loader to handle and accept rmid files (rather than memory mapping the file and loading from memory).
Ok. So then my preference of implementing this would be to teach both, the MIDI player and the soundfont loader to handle and accept rmid files (rather than memory mapping the file and loading from memory).
Yes, but the soundfont loader also has to load the DBNK chunk from the INFO chunk to set the bank offset correctly.
Okay, I think I need to clear things up:
So, here's the official doc from MMA (via internet archive): https://web.archive.org/web/20110610135604/http://www.midi.org/about-midi/rp29spec(rmid).pdf
This (official) version only supports DLS and poses a few issues:
This is why I propose to add the new SF2 Version that I created with help of Zoltán Bacskó from Falcosoft. This version solves all of the problems mentioned above:
Getting it supported in fluidsynth would help a lot in it getting more popular as fluid is a very well known sf2 synth. I also think that implementing it is rather easy as it's just:
data
chunk as SMF.RIFF
chunk as a soundfont bitstream.DBNK
chunk within.Bonus: this logic should also work for DLS files as they too have RIFF
but with DLS
instead of sfbk
. The thing about DLS is having to either assume one of the offsets or detect it like my program does.
FluidSynth version
Execute
fluidsynth --version
and provide the output.SF2 RMIDI specification
The feature request
Fluidsynth would be able to open RIFF midi (.rmi) files. Bonus points for also reading the embedded sf2 file and using it.
Simple solution
RIFF
instead ofMThd
RMID
data
. The data of the chunk is the MIDI file (complete with MThd, etc).'RIFF'
or'DLS '
. This is the embedded soundfont or dls. The provided file has an sf2 embedded, not dls.Steps to reproduce
Please explain the steps required to duplicate the issue, esp. if you are able to provide a sample application. E.g. how to start fluidsynth, what shell commands to enter, what midi events to send, etc.
fluidsynth soundfont.sf2 the_file.rmi