fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] New patch: polyphonic key pressure (aftertouch)


From: Ceresa Jean-Jacques
Subject: Re: [fluid-dev] New patch: polyphonic key pressure (aftertouch)
Date: Wed, 31 May 2017 19:08:09 +0200 (CEST)

Hi, Marcus

 

 

>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?
 
I'm not a maintainer but this idea seems good as far it doesn't break or remove any intial behavior possibility.
To give an example, this idea has been implemented partialy in a previous patch called "Poly/mono patch" (Ticket 160).
As this patch adds intensive Poly/mono functionality , the "MIDI CC Breath to control InitialAttenuation" has been taken
in consideration. The documentation (PatchFluidPolyMono-0003.pdf) chapters 3.4.4, 3.4.5, 3.8 explains the API implementation
and (also shell commands) relative to "Breath Mode".
In this patch you will find similarity with your needs (i.e Channel pressure or Poly key pressure to InitialAttenuation).
 
The good new that the effect of this kind of patches (i.e Poly/mono patch, or an others  patches API or  shell commands that changes/adds default modulator behavior) are always canceled on noteOn event, when the soundfont contains identicals modulators. This way, the initial behavior chosen by the sound designer is never breaked.
 
As the PatchFluidPolyMono-0003.pdf, explains, this kind of patches are very useful and efficient when the soundfont doesn't contains the desired modulators .
Anyway at the end, the right way would be to add theses required modulators in the soundfont.
 
Have a good aftertouch !
 
jjc
 

 

 

> Message du 30/05/17 21:10
> De : "Marcus Weseloh" <address@hidden>
> A : "FluidSynth mailing list" <address@hidden>
> Copie à :
> Objet : Re: [fluid-dev] New patch: polyphonic key pressure (aftertouch)
>
>
2017-05-30 19:24 GMT+02:00 Kjetil Matheussen <address@hidden>:
>
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
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev


reply via email to

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