weixin_39987138 2020-11-20 21:02
浏览 0

Unable to change sequencer tempo with an event

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

  • 写回答

5条回答 默认 最新

  • weixin_39987138 2020-11-20 21:02
    关注

    After having dug into the code a little, I think the error comes from using the system timer. The system timer has to restarted with the new frequency (as result of changing the time scale), and killing the system timer inside an event ultimately triggered by the system timer probably leads to the crash.

    Since I can't see an easy way around this - have you tried using the sample timer instead? It seems more correct for game purposes anyway.

    Original comment by: diwic

    评论

报告相同问题?