Skip to content
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

AGS 4: remove MIDI support #1942

Open
ericoporto opened this issue Mar 7, 2023 · 8 comments
Open

AGS 4: remove MIDI support #1942

ericoporto opened this issue Mar 7, 2023 · 8 comments
Labels

Comments

@ericoporto
Copy link
Member

Describe the problem
MIDI is a terrible format and there is no way for the game to ship their own soundfont when using it, so how it will sound depends on the player figuring a bunch of random things. Additionally, there is no reasonable MIDI playback library that is easy to use and has a license that allow us to integrate and use in any platform (including Apple platforms). When using MIDI you don't know exactly which sounds are used, so soundfonts are usually quite large.

Suggested change
We already support a good variety of module formats, which give a similar experience to midi, but they come with their own sound fonts embedded. My suggestion is to drop MIDI format in AGS 4 and keep only the module formats, as they have no burden on the players.

@i30817
Copy link

i30817 commented Mar 7, 2023

It's probably a unwelcome opinion, but i don't agree with this, because not all soundfonts are large, and the maker of the game can place a custom soundfont, as long as the interface / library used for that is stable.

Sure, some soundfonts are 128 mb, but i've seen one with <10 mb.

@AlanDrake
Copy link
Contributor

I have to agree that MIDI has been abandoned in the context of modern gamedev, as it's mostly used for music production rather than a ready-to-use format.

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Mar 8, 2023

Sure, some soundfonts are 128 mb, but i've seen one with <10 mb.

Timidity patches referenced in our manual is about 8 MB afaik.

I don't have a formed opinion on the feature removal myself. I believe that it's potentially possible to support, if we allow to load soundfonts from inside the game package.
But given we assume that ags4 breaks compatibility with old games, the question is mostly whether midi may be a desired by the contemporary game developers.

OTOH, from the code perspective, what does "remove support" would mean, since MIDI currently is loaded by the SDL_Sound lib and converted into a uniform soundwave format? Probably it means that we build SDL_Sound without some component. Which at the same time means, that someone may still theoretically make a custom engine build with this component turned back on.

@ericoporto
Copy link
Member Author

Remove support is removing it from the Editor e removing it from the build of SDL Sound. We more than 40 issues that have something to do with MIDI in this repository, it's always been problematic.

if we allow to load soundfonts from inside the game package.

I don't think "allow", but actually be this as the only way, forcing it to have no sound/be disabled if no soundfont is inside the game package. Also, this supposes icculus/SDL_sound#69 is implemented, but

MIDI has been abandoned in the context of modern gamedev

So I don't see anyone developing that feature unless one of us pushes this there ourselves.

Timidity patches referenced in our manual is about 8 MB

I think you can still be more efficient than this in any of the other mod formats we have available, and they don't come with the inconveniences that MIDI we have now forces us to.

@morganwillcock
Copy link
Member

there is no way for the game to ship their own soundfont when using it

I'm not sure this is correct. When I've tested that it worked it was only within the context of shipping everything within the game directory, including the audio samples and the timidity.cfg file, and not modifying anything externally (or setting environment variables). Possibly it can end up broken by doing things like setting environment variables though, which makes it less reliable than it should be.

Side note: On older versions of AGS, I've never been convinced the built-in MIDI playback on Windows was playing everything with the correct timing. I doubt anyone who was interested in using MIDI for game music would have been happy with the result.

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Mar 8, 2023

I'm not sure this is correct. When I've tested that it worked it was only within the context of shipping everything within the game directory, including the audio samples and the timidity.cfg file, and not modifying anything externally (or setting environment variables). Possibly it can end up broken by doing things like setting environment variables though, which makes it less reliable than it should be.

IMO if the goal is set to allow to ship soundfonts with the game, then the desired behavior should be to force (or at least to prioritize) the library to load directly from the game's asset paths; that is - including the game package.
Currently that's not possible using SDL_Sound's API, but that's a matter of extending the library, as in letting it use user-provided RWops to read stuff.

@demiguelmoreno
Copy link

What about raw output to midi interfaces? I have an SC55 and I'd like to use the Roland sounds embedded on it. I was surprised to see that you need to use an "external" soundfont to hear midi music...

@AlanDrake
Copy link
Contributor

@demiguelmoreno since we switched to SDL2, sending midi to midi interfaces is no longer supported, however there's still AGS 3.5 that can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants