diff options
Diffstat (limited to 'backends/midi/coreaudio.cpp')
-rw-r--r-- | backends/midi/coreaudio.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index c79454652d..e058e96f6f 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -178,22 +178,18 @@ void MidiDriver_CORE::send(uint32 b) { } void MidiDriver_CORE::sysEx(const byte *msg, uint16 length) { - assert(_auGraph != NULL); + unsigned char buf[256]; - // Add SysEx frame if missing - byte *buf = 0; - if (*msg != 0xF0) { - buf = (byte *)malloc(length + 2); - buf[0] = 0xF0; - memcpy(buf+1, msg, length); - buf[length+1] = 0xF7; - msg = buf; - length += 2; - } + assert(length + 2 <= 256); + assert(_auGraph != NULL); - MusicDeviceSysEx(_synth, msg, length); + // Add SysEx frame + buf[0] = 0xF0; + memcpy(buf + 1, msg, length); + buf[length + 1] = 0xF7; - free(buf); + // Send it + MusicDeviceSysEx(_synth, buf, length+2); } MidiDriver *MidiDriver_CORE_create() { |