[Top][All Lists]

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

[fluid-dev] Should playback_callback receive MIDI file events?

From: Matt Giuca
Subject: [fluid-dev] Should playback_callback receive MIDI file events?
Date: Sun, 18 Sep 2011 21:26:59 +1000

This continues a discussion started in the bug ticket #101 (https://sourceforge.net/apps/trac/fluidsynth/ticket/101) (between myself and David Henningson).

Recently, a feature was added allowing the user of the FS API to register a custom playback_callback function, which is called every time a MIDI event fires.

At present, I *think*, this callback receives only MIDI channel and sysex events, not meta events.

As far as I understand (not 100%), there are three types of MIDI events: channel, sysex and meta. Channel events are the core MIDI events that get sent over the wire (e.g., from a MIDI keyboard to the computer). Sysex are sort of "custom" events that have a meaning determined by the individual application or file -- I believe these are also sent over the wire. Then we have meta events, which are found in MIDI files but are not part of the MIDI protocol. These are things like timing/tempo changes, "end of track" and metadata like copyright notices -- things that make sense to store in a file but wouldn't make sense to send as part of a performance.

My reading of the code at the moment is that NO meta events are sent to playback_callback, but it's a bit complicated. In src/midi/fluid_midi.c, the function fluid_midi_file_read_event reads events from a file and puts them into an in-memory data structure. Only the EOT (end-of-track) and SET_TEMPO events are loaded into the queue -- all of the others are ignored (or dealt with and then forgotten about). Then, in fluid_track_send_events, the EOT and SET_TEMPO events are explicitly *not* sent to playback_callback. (You need to update to r436 to see the new EOT handling.) So I believe that means no meta events will go through.

The question is: should they. The default callback will ignore them anyway, so it doesn't matter. But does anybody who's used their own custom callbacks have any opinion on this one way or another? Would you like to receive meta events such as copyright strings, and tempo changes? Will this break any existing callbacks?

reply via email to

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