fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] Midi track functions


From: David Henningsson
Subject: [fluid-dev] Midi track functions
Date: Mon, 05 Dec 2011 11:00:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]