Hi Tom,

I went over the code that you mentioned at
http://www.fluidsynth.org/api/index.html#FileRenderer and had a question
regarding this; when we are looping over while (fluid_player_get_status
<http://www.fluidsynth.org/api/midi_8h.html#ad9b5bd5dcacaa1c967275f537e2add26>(player)
== FLUID_PLAYER_PLAYING
<http://www.fluidsynth.org/api/midi_8h.html#a5ec93766f61465dedbbac9bdb76ced83a98ece3a92210189eaad462edc8545bc5>),
does this mean that we will have to wait for the exact duration of playback
of the MIDI file before it is dumped as a file or is it a fast rendering
like through command line? Thank you.

Regards.
Swapnil.

On Wed, Apr 4, 2018 at 10:46 PM, Tom M. <tom.m...@googlemail.com> wrote:

> Just added example code for the file renderer:
> http://www.fluidsynth.org/api/index.html#FileRenderer
>
> (changes should be pulic on 5th April approx. 10 AM UTC... unless
> Element reads this and triggers the cron job)
>
>
> Tom
>
> 2018-04-04 16:26 GMT+02:00 Marcus Weseloh <mar...@weseloh.cc>:
> > Hi Swapnil,
> >
> > yes, it's possible via the API as well. Should work with something along
> > these lines (untested code, just for demonstration):
> >
> > fluid_player_t* player;
> > fluid_file_renderer_t* renderer;
> >
> > player = new_fluid_player(synth);
> > fluid_player_add(player, "/path/to/midifile.mid");
> >
> > fluid_settings_setint(settings, "synth.parallel-render", 1); /* needed
> for
> > fast-render */
> > fluid_settings_setstr(settings, "audio.file.name",
> "/path/to/output.wav");
> >
> > renderer = new_fluid_file_renderer (synth);
> >
> > while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING) {
> >   if (fluid_file_renderer_process_block(renderer)  !=  FLUID_OK) {
> >     break;
> >   }
> > }
> >
> > delete_fluid_file_renderer(renderer);
> > delete_fluid_player(player);
> >
> >
> > Not shown is the synth and settings setup. Please see the /doc/example.c
> on
> > how to create and destroy Fluidsynth instances and settings objects.
> >
> > Cheers,
> >
> >
> >    Marcus
> >
> >
> > _______________________________________________
> > fluid-dev mailing list
> > fluid-dev@nongnu.org
> > https://lists.nongnu.org/mailman/listinfo/fluid-dev
> >
>
> _______________________________________________
> fluid-dev mailing list
> fluid-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>



-- 
Swapnil Gupta
Music Technology Group.
Universitat Pompeu Fabra.
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to