mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
Minor coding changes
This commit is contained in:
parent
dc38ba7bc5
commit
219ae7556b
1 changed files with 15 additions and 16 deletions
|
@ -239,6 +239,14 @@ fluid_comb_getfeedback(fluid_comb* comb)
|
|||
#define numcombs 8
|
||||
#define numallpasses 4
|
||||
#define fixedgain 0.015f
|
||||
/* scale_wet_width is a compensation weigth factor to get an output
|
||||
amplitude (wet) rather independent of width setting.
|
||||
0: the output amplitude is fully dependant of width setting.
|
||||
>0: the output amplitude is less dependant of width setting.
|
||||
With a scale_wet_width of 0.2 the output amplitude is rather
|
||||
independent of width setting.(see fluid_revmodel_update()).
|
||||
*/
|
||||
#define scale_wet_width 0.2f
|
||||
#define scalewet 3.0f
|
||||
#define scaledamp 1.0f
|
||||
#define scaleroom 0.28f
|
||||
|
@ -284,7 +292,7 @@ fluid_comb_getfeedback(fluid_comb* comb)
|
|||
struct _fluid_revmodel_t {
|
||||
fluid_real_t roomsize;
|
||||
fluid_real_t damp;
|
||||
fluid_real_t level, wet, wet1, wet2;
|
||||
fluid_real_t level, wet1, wet2;
|
||||
fluid_real_t width;
|
||||
fluid_real_t gain;
|
||||
/*
|
||||
|
@ -481,33 +489,24 @@ fluid_revmodel_processmix(fluid_revmodel_t* rev, fluid_real_t *in,
|
|||
}
|
||||
|
||||
static void
|
||||
/* scalelevelwidth is compensation weigth factor to get output
|
||||
amplitude rather independent of width setting.
|
||||
0: the output amplitude is fully dependant of width setting.
|
||||
>0: the output amplitude is less dependant of width setting.
|
||||
With a scalelevelwidthof of 0.2 the output amplitude is
|
||||
rather independent of width setting.
|
||||
*/
|
||||
#define scalelevelwidth 0.2f
|
||||
fluid_revmodel_update(fluid_revmodel_t* rev)
|
||||
{
|
||||
/* Recalculate internal values after parameter change */
|
||||
int i;
|
||||
|
||||
/* The stereo amplitude equation (wet1 and wet1 below) have a
|
||||
tendency to produce high amplitude with high width value ( 1 < width < 100).
|
||||
This result in a unwanted output clipped by the audio card.
|
||||
To avoid this dependency, we divide by (1 + rev->width * scalelevelwidth)
|
||||
Actually, with a scalelevelwidthof 0.2, (regardless of level setting),
|
||||
To avoid this dependency, we divide by (1 + rev->width * scale_wet_width)
|
||||
Actually, with a scale_wet_width of 0.2, (regardless of level setting),
|
||||
the output amplitude (wet) seems rather independent of width setting */
|
||||
rev->wet = (rev->level * scalewet) /
|
||||
(1.0f + rev->width * scalelevelwidth);
|
||||
fluid_real_t wet = (rev->level * scalewet) /
|
||||
(1.0f + rev->width * scale_wet_width);
|
||||
|
||||
/* wet1 and wet2 are used by the stereo effect controled by the width setting
|
||||
for producing a stereo ouptput from a monophonic reverbered signal.
|
||||
Please see the note above about a side effect tendency */
|
||||
rev->wet1 = rev->wet * (rev->width / 2.0f + 0.5f);
|
||||
rev->wet2 = rev->wet * ((1.0f - rev->width) / 2.0f);
|
||||
rev->wet1 = wet * (rev->width / 2.0f + 0.5f);
|
||||
rev->wet2 = wet * ((1.0f - rev->width) / 2.0f);
|
||||
|
||||
for (i = 0; i < numcombs; i++) {
|
||||
fluid_comb_setfeedback(&rev->combL[i], rev->roomsize);
|
||||
|
|
Loading…
Reference in a new issue