fluid-dev
[Top][All Lists]
Advanced

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

[fluid-dev] Tuning and sysex messages


From: josh
Subject: [fluid-dev] Tuning and sysex messages
Date: Thu, 24 Sep 2009 21:16:51 -0700
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

Some more FluidSynth commits. Seems I've had a bit of free time as of late. A bad economy can be a good thing! ;)

The tuning system is now thread safe and additionally now does tuning adjustments in real time to existing voices (as per the MIDI tuning standard).

I'm now looking into implementing SYSEX message handling, for the MIDI tuning standard in particular, though other things could be added, such as a MIDI interface to the FluidSynth command shell. So, for example, any FluidSynth shell command could be embedded in a MIDI file! :)

At the moment I'm thinking of adding a function like below, which will take a buffer containing the body of a SYSEX message and a pointer to a response buffer which might get filled with return SYSEX data (if its a query for example). Its a little awkward having to guess the maximum size of the response buffer, but prevents the need to do a malloc (for use in a high priority MIDI thread for example). It might make sense to also add a friendlier version which allocates the response. At the moment, I don't think there are any FluidSynth MIDI drivers which send MIDI data, so this feature may require some changes to MIDI drivers.

Comments?  Thoughts?

Regards,
Josh


Function prototype:

/**
 * Process a MIDI SYSEX (system exclusive) message.
 * @param synth FluidSynth instance
 * @param data Buffer containing SYSEX data (not including 0xF0 and 0x7F)
 * @param len Length of data in buffer
 * @param response Buffer to store response in or NULL to ignore (0xF0
 *   and 0x7F not stored)
 * @param response_len IN/OUT parameter, in: size of response buffer, out:
 *   amount of data written to response buffer
 * @param handled Optional location to store boolean value if message was
 *   recognized and handled or not (set to TRUE if it was handled)
 * @return FLUID_OK on success, FLUID_FAILED otherwise
 */
int
fluid_synth_sysex(fluid_synth_t *synth, char *data, int len,
                  char *response, int *response_len, int *handled)




reply via email to

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