sinshu / meltysynth

A SoundFont MIDI synthesizer for .NET
Other
136 stars 16 forks source link

Feature request: Support for SF2 RMIDI format #53

Open spessasus opened 1 month ago

spessasus commented 1 month ago

Hi,

I am writing to propose the addition of support for a new version of the RMIDI (.rmi) format that bundles both soundfonts and MIDI files into a single file. This format, though still quite new, offers a streamlined way to package and distribute soundfonts alongside MIDI data as one file.

As this format gains traction, support from widely-used soundfont synthesizers would be highly valuable. Specifically, adding support for this format to Meltysynth (a popular C# soundfont synth) and Rustysynth (a notable Rust-based synth also made by you) would greatly enhance their utility and appeal.

The RMIDI format wraps MIDI data and soundfonts into a RIFF container, which means that it should be relatively easy to implement.

For detailed information on the format, please refer to the specification here (feel free to reach out if you have any questions, I'll be happy to explain everything):

https://github.com/spessasus/sf2-rmidi-specification#readme

Your consideration of this feature would be greatly appreciated and would contribute significantly to the format's adoption 🙂

Thank you!

sinshu commented 5 days ago

Thank you for your suggestion. However, I have decided not to support anything other than pure SF2.

Let me explain.

What I value most in the development of MeltySynth is not the diversity of features but the simplicity of the code. When I first started developing MeltySynth, I naturally looked at various existing implementations. For example, FluidSynth is undoubtedly a great codebase. However, at the same time, FluidSynth is also large and complex. When I tried to understand its code, I often couldn't locate the specific code I was looking for despite searching through multiple directories.

For that reason, I wanted a SoundFont synthesizer with minimal functionality and simple code. TinySoundFont comes close to that, but it uses many C-language-specific tricks, making it difficult to port as-is. C# Synth, though truly a great project as (probably) the first SoundFont synthesizer in C#, seemed complicated in its design.

So, I created MeltySynth. In MeltySynth, all the code files are in a single directory. If you're interested in the implementation of the oscillator and open Oscillator.cs, you'll find the implementation of the oscillator there. That's the kind of simplicity I wanted to achieve.

If MeltySynth were to support RMIDI, it would require introducing some abstraction layer. However, for the reasons mentioned above, I don’t want to do that. I hope you can understand.

That said, I have thought it would be nice to have a format that combines SoundFont and MIDI files, similar to Tracker-style music formats. I also hope that such a format becomes widely used 👍