public unsafe void SetPlaybackCallback(MidiEventHandler handler) { LibFluidsynth.fluid_player_set_playback_callback(Handle, Utility.PassDelegatePointer <LibFluidsynth.handle_midi_event_func_t>( (d, e) => { using (var ev = new MidiEvent(e)) { return(handler(ev)); } }, out var b), null); _handler = b; }