From the mailing list...
I think you'll have to look at fluid_player_set_midi_tempo and do something similar, as you're doing your own midi file parser, that is, combine PPQN with the MIDI_SET_TEMPO meta event.
I read up some more on SYSEX and found out what these meta events are. I now understand that the PPQN alone isn't enough even for the initial tempo so I need to handle this event. The problem is, as I mentioned before, there isn't a fluid_event function for tempo changes. I tried to work around this by dealing with it in a sequencer client callback but when I call fluid_sequencer_set_time_scale inside the callback, the game crashes with this horrific error.
GThread-ERROR **: file gthread-posix.c: line 385
(g_thread_join_posix_impl): error 'Resource deadlock avoided' during 'pthread_join (*(pthread_t*)thread,&ignore)'
aborting..
Nasty stuff. I've checked and it definitely happens during that function call. If I have to call this function myself, the callback is really the only place I could do it. This is probably something you'll have to fix on your end.
Reported by: jerseychewi
Original Ticket: fluidsynth/tickets/88
该提问来源于开源项目:FluidSynth/fluidsynth