Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC Patch: new public API to manipulate default modulators #164

Closed
derselbst opened this issue May 30, 2017 · 3 comments · Fixed by #205
Closed

RFC Patch: new public API to manipulate default modulators #164

derselbst opened this issue May 30, 2017 · 3 comments · Fixed by #205

Comments

@derselbst
Copy link
Member

When using FluidSynth as a custom synthesizer, developers sometimes need (or want) to use other default modulators than the standard ones defined in the SoundFont spec. Currently the only way to modify the default modulators is to write a custom soundfont loader or override the default modulators in all used soundfonts.

This patch proposes a new public API to manipulate the default modulators. I would be very grateful for feedback on this approach. Is opening up the default modulator list like this acceptable for you, the maintainers of fluidsynth?

Here is an example to use the new API (adding a new default modulator on Key Pressure, introduced in the patch for ticket #50):

   ...
  settings = new_fluid_settings();
  ...
  synth = new_fluid_synth(settings);
  // Add a Key Pressure to Initial Attenuation modulator
  mod = fluid_mod_new();
  fluid_mod_set_source1(mod,
          FLUID_MOD_KEYPRESSURE,
          FLUID_MOD_GC |
          FLUID_MOD_NEGATIVE |
          FLUID_MOD_UNIPOLAR |
          FLUID_MOD_CONCAVE);
  fluid_mod_set_source2(mod, 0, 0);
  fluid_mod_set_dest(mod, GEN_ATTENUATION);
  fluid_mod_set_amount(mod, 960.0);

  fluid_synth_add_default_mod(synth, mod, FLUID_SYNTH_ADD);
  adriver = new_fluid_audio_driver(settings, synth);
  ...

Reported by: mawe242

Original Ticket: fluidsynth/tickets/166

@derselbst
Copy link
Member Author

Just to be clear: the new API call is:

fluid_synth_add_default_mod(synth, mod, FLUID_SYNTH_ADD);

Original comment by: mawe242

@derselbst
Copy link
Member Author

Following up from the discussion on the fluid-dev mailing list, here is version 2 of the patch with the static list of modulators replaced with a dynamically allocated one.

Original comment by: mawe242

@derselbst
Copy link
Member Author

Addresses #71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants