Example producing short random music with FluidSynth
#include <fluidsynth.h>
#if defined(WIN32)
#include <windows.h>
#define sleep(_t) Sleep(_t * 1000)
#else
#include <stdlib.h>
#endif
int main(int argc, char** argv)
{
int sfont_id;
int i, key;
srand(getpid());
for (i = 0; i < 12; i++) {
key = 60 + (int) (12.0f * rand() / (float) RAND_MAX);
sleep(1);
}
return 0;
}
FLUIDSYNTH_API int fluid_synth_noteon(fluid_synth_t *synth, int chan, int key, int vel)
Send a note-on event to a FluidSynth object.
Definition: fluid_synth.c:921
FLUIDSYNTH_API void delete_fluid_audio_driver(fluid_audio_driver_t *driver)
Deletes an audio driver instance.
Definition: fluid_adriver.c:403
struct _fluid_audio_driver_t fluid_audio_driver_t
Audio driver instance.
Definition: types.h:45
FLUIDSYNTH_API int fluid_synth_noteoff(fluid_synth_t *synth, int chan, int key)
Send a note-off event to a FluidSynth object.
Definition: fluid_synth.c:972
FLUIDSYNTH_API fluid_settings_t * new_fluid_settings(void)
Create a new settings object.
Definition: fluid_settings.c:235
struct _fluid_synth_t fluid_synth_t
Synthesizer instance.
Definition: types.h:37
FLUIDSYNTH_API 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:3250
FLUIDSYNTH_API 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:344
struct _fluid_hashtable_t fluid_settings_t
Configuration settings instance.
Definition: types.h:36
FLUIDSYNTH_API void delete_fluid_settings(fluid_settings_t *settings)
Delete the provided settings object.
Definition: fluid_settings.c:254
FLUIDSYNTH_API fluid_synth_t * new_fluid_synth(fluid_settings_t *settings)
Create new FluidSynth instance.
Definition: fluid_synth.c:550
FLUIDSYNTH_API int delete_fluid_synth(fluid_synth_t *synth)
Delete a FluidSynth instance.
Definition: fluid_synth.c:779
Generated for libfluidsynth by
1.8.17