There seems to have been a few requests lately about midi tracks and being able to read more of midi events. What do you think of the following outline, would that fulfil your wishes?

* Let's add a midi event type named "MIDI_META" or similar. We use it to store all meta events we don't store currently. We'll dump the varlen of copyright, lyrics, etc in there - just like we do for sysex.

* We'll also add another callback to fluid_track_send_events, with more info in it. Preferrably here:

        track->ticks += event->dtime;

        /* Add callback here */

        if (!player || event->type == MIDI_EOT) {

The callback function could look like:

int handle_extended_playback_event(int track_index, const char* track_name, unsigned int ticks, fluid_midi_event_t* event, void* userdata)

(Is there more stuff we need?)

The callback can modify the current event if necessary, and could return FLUID_OK for fluidsynth to continue to process the event, or FLUID_FAILED to ignore the current event.

If we like, we could also add the same type of callback at parsing time (I think Pedro suggested something like this a while ago?) for players to be able to pick up lyric information etc ahead of time, which could be useful for some midi players.

What do you think?

// David


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

Reply via email to