libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
401 stars 137 forks source link

[PATCH] native_midi_macosx: support SDL_SOUNDFONTS #290

Open SDLBugzilla opened 3 years ago

SDLBugzilla commented 3 years ago

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: unspecified Reported for operating system, platform: Mac OS X (All), All

Comments on the original bug report:

On 2020-11-24 22:07:14 +0000, wrote:

Created attachment 4542 native_midi_macosx: support SDL_SOUNDFONTS

Adds support for setting soundfont via SDL_SOUNDFONTS and friends in native_midi_macosx backend.

On 2020-12-01 21:49:22 +0000, Sam Lantinga wrote:

Fixed, thanks! https://hg.libsdl.org/SDL_mixer/rev/3189c67fb0d9

sezero commented 3 years ago

The FIXME note at line 156 is scary: https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/native_midi/native_midi_macosx.c#L156 @slouken, @icculus: what to do about it?

sezero commented 2 years ago

The FIXME note at line 156 is scary: https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/native_midi/native_midi_macosx.c#L156 @slouken, @icculus: what to do about it?

PING?

a-hurst commented 2 years ago

@sezero From how I'm reading the code, the issue is that if setting a soundfont fails and a) there's no default soundfont to revert to, or b) trying to set the default soundfont fails, the audio unit might not work somehow.

Based on this blogpost, it looks like you can retrieve the error string if there's a failure on that function, so a solution might be to raise an SDLError with the relevant error text if the block with that comment gets hit (or even before, since it would presumably be helpful to know why a given soundfont failed to load before attempting to reload a fallback).

slouken commented 2 years ago

I agree this is scary, but I'm not sure what can be done. @icculus, any ideas?