2017-05-30 19:24 GMT+02:00 Kjetil Matheussen <k.s.matheus...@gmail.com>:

> Great! The patch + hack works perfectly as far as I can see (except [1]).
> Applied like this:
>
> patch -p1 < polyphonic_pressure.v1.patch
> patch -p1 < poly_to_att_hack.patch
> patch -p1 < lower_boundary_check.patch
>

Excellent, thanks a lot for testing it! Glad that it worked.

[1] When calling 'fluid_synth_key_pressure' I had to use 0 as full volume,
> and 127 as silent.
>

The reason is that the poly_to_att_hack patch defines the modulator with a
positive, unipolar mapping. That means that increasing amounts of poly
aftertouch values increase the initial attenuation. And "attenuation" is
actually a reduction in volume.

To get the behaviour that you want (0 poly aftertouch -> 0 volume), I think
you could change the direction of the modulator from FLUID_MOD_POSITIVE to
FLUID_MOD_NEGATIVE and change the amount from 960 to -960.

The poly_to_att_hack patch is so small that I don't see any reason why this
> can't be #ifdefed into the official repository. It's extremely nice for
> those of us who uses libfluidsynth in another program as a synthesizer.
>

I'm not really sure... I'm using libfluidsynth as an internal synth for a
musical instrument. And my need for the poly aftertouch is slightly
different to yours. I'm going to use it to control the volumes of two
samples playing simultaneously on a single note. At aftertouch of 64, both
samples play at the same volume. At 0, the first sample is silent, at 127
the other sample is silent. I'm implementing this as modulators on all
instruments in the soundfont I'm using, so no need to patch the source.

So my guess is that people who use the fluidsynth API will most likely have
special requirements and that the proposed Poly Pressure -> Initial
Attenuation probably won't be much use to most.

What would be very useful, though (also for me): if fluidsynth could
provide an API that allows easy modification of the default modulator list.
That way everybody can add, remove or change any of the default modulators
without patching anything. Adding your poly -> attenuation modulator would
be only a few function calls. I'll see if I can come up with a patch for
that, should be fairly straight forward, I think.

Or do any of the maintainers think that providing API functions to modify
the default modulator list is a bad idea?


> Another thing (not related to poly aftertourch), is there any particular
> reason this line:
>
> "FLUIDSYNTH_API void fluid_event_clear(fluid_event_t* evt);"
>
> isn't included in one of files in include/ ? (sorry if this has been asked
> before)
>

No idea... Maybe nobody needed it before?

Cheers,

    Marcus
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to