-
Notifications
You must be signed in to change notification settings - Fork 196
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
MacOS Fixes #3148
MacOS Fixes #3148
Conversation
5a6aac7
to
d9dc94c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You inserted space instead of tab for the indent.
- Can you add this
NeedsSoftReset
to Decoder Fluidsynth? Has a similiar issue and your fix is more universal.
d9dc94c
to
f6d5c0c
Compare
src/audio_decoder_midi.cpp
Outdated
@@ -378,6 +402,10 @@ void AudioDecoderMidi::meta_event(int event, const void* data, std::size_t size) | |||
|
|||
void AudioDecoderMidi::reset() { | |||
// MIDI reset event | |||
if (mididec->NeedsSoftReset()) { | |||
// SoundOff every channel: necessary for synths like macOS which tend to get stuck | |||
SendMessageToAllChannels(midimsg_all_sound_off(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry have to ask you for another small change:
Can you move this new code block between the GM reset and the pitch bend block? (I hope this doesn't break macOS?)
Tested this again in fluidsynth and the all sound off will not work properly when executed before the GM reset (same audio glitch remains).
// GM system on (resets most parameters)
const unsigned char gm_reset[] = { 0xF0, 0x7E, 0x7F, 0x09, 0x01, 0xF7 };
mididec->SendSysExMessage(gm_reset, sizeof(gm_reset));
// MIDI reset event
if (mididec->NeedsSoftReset()) {
// SoundOff every channel: necessary for synths like macOS which tend to g>
SendMessageToAllChannels(midimsg_all_sound_off(0));
}
// Set the Pitch bend range to 256
for (int channel = 0; channel < 16; channel++) {
f6d5c0c
to
77b52c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, works now with fluidsynth 👍
Fixes three issues:
5-beatles-lustig.mid
from Unterwegs in Duesterburg causes a crash inMusicDeviceMIDIEvent
due to a bogus MIDI message. We're in some good company here, both VLC (at least on macOS) and Sekaiju also crash attempting to play it.midimsg_all_sound_off
from reset, to be more accurate with Harmony. Harmony never supported macOS, and the macOS synthesizer being prone to stuck notes is why those messages were there in the first place. I'm open to other solutions to fix this, but without it, MIDI is pretty scuffed on Macs.-G Xcode
generator in cmake will completely fail to build (at least on Xcode 15), due to a fundamental disconnect between cmake and Xcode when you have multiple code files with the same filename (likesrc/audio.cpp
vssrc/platform/sdl/audio.cpp
). Simplest workaround is to remove the duplication by renaming the two files that had duplicated names.Fix #3135