fluid-dev
[Top][All Lists]
Advanced

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

[fluid-dev] Re: libsndfile support for file rendering


From: josh
Subject: [fluid-dev] Re: libsndfile support for file rendering
Date: Sat, 03 Oct 2009 11:56:14 -0700
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

I just committed libsndfile support for the fast file renderer and aufile driver. I decided to just add individual options for file type, audio format and endian byte order. These have corresponding settings audio.file.type/format/endian for use with the fluid_aufile.c driver.

Some examples:

# Render a 44.1KHz stereo 16 bit wav file
fluidsynth -F mysong.wav gs.sf2 mysong.mid

# Render a 48KHz stereo 16 bit aiff file
fluidsynth -F mysong.aiff -r 48000 gs.sf2 mysong.mid

# Render a 44.1KHz stereo 24 bit flac file
fluidsynth -F mysong.flac -O s24 gs.sf2 mysong.mid

# Render a 44.1KHz stereo double floating point big endian raw file
fluidsynth -F mysong.dat -T raw -O double -E big gs.sf2 mysong.mid


The new command line switches are:
-T, --audio-file-type: Audio file type (defaults to auto, which determines format from file extension, with fallback to wav) -O, --audio-file-format: Audio format, a fixed list of "s8 s16 s24 s32 u8 float double", defaults to "s16"
-E, --audio-file-endian: One of "auto little big cpu", defaults to "auto"

For each of these command line switches, "help" can be given which will list the available options.


Code details:

Added 3 new parameters to new_fluid_file_renderer() to specify the type, format and endian options.

Added 3 new public functions: fluid_file_render_get_type_names, fluid_file_renderer_get_format_names and fluid_file_renderer_get_endian_names.

Some other minor changes.


I realize that the file renderer could use even more options. For example, the ability to specify a time duration for the render or how much extra time to render after player ends. For this reason, I think it may be a good idea to use a mechanism where we can add additional options in a backwards compatible fashion.

What do you think about something like this:
fluid_file_renderer_config_t *new_fluid_file_renderer_config (void);

config = new_fluid_file_renderer_config ();
config->filename = "mysong.wav";
config->type = "wav";
config->format = "float";
config->endian = "auto";
config->period_size = 64;
config->duration_after_song_end = TRUE;
config->duration = seconds_after_song * (sample_rate / config->period_size);

renderer = new_fluid_file_renderer (synth, config);
delete_fluid_file_renderer_config (config);


I would like to add config file support and I think that will conclude the new features for FluidSynth 1.1.0. We will then enter a phase of testing, bug fixing and identifying any other multi-thread issues. Then release 1.1.0 :)


Regards,

Josh





reply via email to

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