[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] Intercepting midi events
From: |
Tom M. |
Subject: |
Re: [fluid-dev] Intercepting midi events |
Date: |
Mon, 04 Jun 2018 06:53:17 +0200 |
> #include "fluid_midi.h"
> #include "fluid_sfont.h"
I will never understand why people keep including fluidsynths private headers.
And I'm so tired of repeating that this way of programming is undefined
behaviour as there is no API / ABI stability guarantee for internal data types
and functions. That's why there are accessor functions of all kinds.
> new_fluid_midi_driver(settings, intercept, NULL);
You bascially asked for the synth instance being NULL. Have you read the API
doc of new_fluid_midi_driver() ?
http://www.fluidsynth.org/api/midi_8h.html#ad0971af69fb51398d468b151cba70bee
Also you are deleting the synth before deleting the midiDriver. This will cause
the midiDriver to call a deleted synth instance. You must always cleanup all
objects exactly in the reverse order you've created them.
And your `fluid_midi_driver_t* midiDriver` will be uninitialized if any of the
`goto cleanup` happens.
Tom