Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
513 stars 131 forks source link

SDL_sound-patched-hg vs SDL2_mixer, ideas and questions. #36

Closed hanetzer closed 10 years ago

hanetzer commented 10 years ago

Just doing a bit of reading around, and researching options for adding midi support to mkxp, and I keep on coming back to SDL2_mixer, which I had previously used for midi support in my prior abortive attempt at a native rgss player for linux, so I have to ask regarding the reasoning for using the patched sdl sound library.

Ancurio commented 10 years ago

The audio pipeline in mkxp looks like this: PhysFS(file IO) -> SDL_Sound / libvorbisfile(sample decoding) -> OpenAL(resampling / mixing) -> audio card. SDL2_mixer doesn't fit inside here because it does decoding, mixing and audio card submission in one. What I want is a pure decoding library, like fluidsynth.

hanetzer commented 10 years ago

ah, gotcha. I know SDL_mixer can do midi, as I've said and used before, was just wondering if there were some sort of say philosophical reason as to not want it. midi is a bit odd aint it...

Ancurio commented 10 years ago

No, there's no reasons why I'm not using SDL2_mixer besides technical ones. The library is too high level for my needs (I need to be able to manipulate buffers directly for eg. gapless vorbis looping in RGSS2), and its resampling support is atrocious. It's a good library if you just want very simple audio and "play this song" stuff (like SDL_Render), but for anything more sophisticated it is unsuited.

Besides, even if I was to use it, I still couldn't implement RGSS-exact midi looping with it without changing the source code.

hanetzer commented 10 years ago

Mayhaps one could work up our own midi library for mkxp.

Ancurio commented 10 years ago

You have to consider that midi is a huge specification with lots of fine details in it; writing yet another synthesizer implementation would probably be a bigger endeavor than mkxp itself. Fluidsynth already does most of what I need it to, I'd just have to write the midi event parsing code myself (I've experimented with this not long ago, with mixed results). Really, I just need to sit down with this again, bug the fluidsynth mailing list and figure out how to do this correctly.

hanetzer commented 10 years ago

yeah. sometimes you just gotta bug folks, lol. Hell I had to bug the mingw-w64 folks to patch their pthreads.h file :P