FluidSynth can be used to play MIDI files, using the MIDI File Player interface. It follows a high level implementation, though its implementation is currently incomplete. After initializing the synthesizer, create the player passing the synth instance to new_fluid_player(). Then, you can add some SMF file names to the player using fluid_player_add(), and finally call fluid_player_play() to start the playback. You can check if the player has finished by calling fluid_player_get_status(), or wait for the player to terminate using fluid_player_join().
#include <fluidsynth.h>
int main(int argc, char** argv)
{
int i;
for (i = 1; i < argc; i++) {
}
}
}
return 0;
}
struct _fluid_hashtable_t fluid_settings_t
Configuration settings instance.
Definition: types.h:38
struct _fluid_audio_driver_t fluid_audio_driver_t
Audio driver instance.
Definition: types.h:46
struct _fluid_synth_t fluid_synth_t
Synthesizer instance.
Definition: types.h:39
struct _fluid_player_t fluid_player_t
MIDI player instance.
Definition: types.h:48
fluid_audio_driver_t * new_fluid_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth)
Create a new audio driver.
Definition: fluid_adriver.c:350
void delete_fluid_audio_driver(fluid_audio_driver_t *driver)
Deletes an audio driver instance.
Definition: fluid_adriver.c:443
int fluid_player_join(fluid_player_t *player)
Wait for a MIDI player until the playback has been stopped.
Definition: fluid_midi.c:2590
int fluid_player_play(fluid_player_t *player)
Activates play mode for a MIDI player if not already playing.
Definition: fluid_midi.c:2295
void delete_fluid_player(fluid_player_t *player)
Delete a MIDI player instance.
Definition: fluid_midi.c:1769
fluid_player_t * new_fluid_player(fluid_synth_t *synth)
Create a new MIDI player.
Definition: fluid_midi.c:1679
int fluid_player_add(fluid_player_t *player, const char *midifile)
Add a MIDI file to a player queue.
Definition: fluid_midi.c:1915
int fluid_is_midifile(const char *filename)
Check if a file is a MIDI file.
Definition: fluid_midi.c:89
int fluid_is_soundfont(const char *filename)
Check if a file is a SoundFont file.
Definition: fluid_sffile.c:263
fluid_settings_t * new_fluid_settings(void)
Create a new settings object.
Definition: fluid_settings.c:262
void delete_fluid_settings(fluid_settings_t *settings)
Delete the provided settings object.
Definition: fluid_settings.c:286
int fluid_synth_sfload(fluid_synth_t *synth, const char *filename, int reset_presets)
Load a SoundFont file (filename is interpreted by SoundFont loaders).
Definition: fluid_synth.c:5402
fluid_synth_t * new_fluid_synth(fluid_settings_t *settings)
Create new FluidSynth instance.
Definition: fluid_synth.c:645
void delete_fluid_synth(fluid_synth_t *synth)
Delete a FluidSynth instance.
Definition: fluid_synth.c:1044