I think I've seen this question already 4 years ago. I didn't know back then 
why it was done that way, neither do I know now. I assumed that this function 
wasn't made public because fluidsynth is not supposed to be a MIDI parser. 
Particularly, there is an internal MIDI parser, but this one has a limited 
buffer, causing potentially too long SysEx messages to be cut off:

https://github.com/FluidSynth/fluidsynth/blob/1fc6f0935bacc6fb3e38b7bebe8b24f6cf110dab/src/midi/fluid_midi.c#L2744-L2749

This "parser" may or may not be used depending on where the fluid_midi_event_t 
is coming from.

I understand that there is a corresponding setter function 
fluid_midi_event_set_sysex(), but unfortunately, this function is broken by 
design: A dynamically malloc()ed and user provided buffer could be freed 
internally by fluidsynth's version of free(). Allocating some data in one 
domain, carrying it in a different domain and freeing it with different means 
could lead to heap corruption, when two different memory runtimes are in use. 
This is a common problem on Windows.

So my question would be, for what purpose you intend to use 
fluid_midi_event_get_sysex()? And whether or not you would be happy only 
getting the first 1024 bytes of the SysEx message?

Tom

_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to