mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 23:11:41 +00:00
Cleanup indentation
This commit is contained in:
parent
94d436ae0b
commit
50b6e9462e
1 changed files with 36 additions and 36 deletions
|
@ -1558,50 +1558,50 @@ int fluid_voice_get_velocity(const fluid_voice_t* voice)
|
||||||
static fluid_real_t
|
static fluid_real_t
|
||||||
fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice)
|
fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
fluid_mod_t* mod;
|
fluid_mod_t* mod;
|
||||||
fluid_real_t possible_att_reduction_cB=0;
|
fluid_real_t possible_att_reduction_cB=0;
|
||||||
fluid_real_t lower_bound;
|
fluid_real_t lower_bound;
|
||||||
|
|
||||||
for (i = 0; i < voice->mod_count; i++) {
|
for (i = 0; i < voice->mod_count; i++) {
|
||||||
mod = &voice->mod[i];
|
mod = &voice->mod[i];
|
||||||
|
|
||||||
/* Modulator has attenuation as target and can change over time? */
|
/* Modulator has attenuation as target and can change over time? */
|
||||||
if ((mod->dest == GEN_ATTENUATION)
|
if ((mod->dest == GEN_ATTENUATION)
|
||||||
&& ((mod->flags1 & FLUID_MOD_CC) || (mod->flags2 & FLUID_MOD_CC))) {
|
&& ((mod->flags1 & FLUID_MOD_CC) || (mod->flags2 & FLUID_MOD_CC))) {
|
||||||
|
|
||||||
fluid_real_t current_val = fluid_mod_get_value(mod, voice->channel, voice);
|
fluid_real_t current_val = fluid_mod_get_value(mod, voice->channel, voice);
|
||||||
fluid_real_t v = fabs(mod->amount);
|
fluid_real_t v = fabs(mod->amount);
|
||||||
|
|
||||||
if ((mod->src1 == FLUID_MOD_PITCHWHEEL)
|
if ((mod->src1 == FLUID_MOD_PITCHWHEEL)
|
||||||
|| (mod->flags1 & FLUID_MOD_BIPOLAR)
|
|| (mod->flags1 & FLUID_MOD_BIPOLAR)
|
||||||
|| (mod->flags2 & FLUID_MOD_BIPOLAR)
|
|| (mod->flags2 & FLUID_MOD_BIPOLAR)
|
||||||
|| (mod->amount < 0)) {
|
|| (mod->amount < 0)) {
|
||||||
/* Can this modulator produce a negative contribution? */
|
/* Can this modulator produce a negative contribution? */
|
||||||
v *= -1.0;
|
v *= -1.0;
|
||||||
} else {
|
} else {
|
||||||
/* No negative value possible. But still, the minimum contribution is 0. */
|
/* No negative value possible. But still, the minimum contribution is 0. */
|
||||||
v = 0;
|
v = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For example:
|
/* For example:
|
||||||
* - current_val=100
|
* - current_val=100
|
||||||
* - min_val=-4000
|
* - min_val=-4000
|
||||||
* - possible_att_reduction_cB += 4100
|
* - possible_att_reduction_cB += 4100
|
||||||
*/
|
*/
|
||||||
if (current_val > v){
|
if (current_val > v){
|
||||||
possible_att_reduction_cB += (current_val - v);
|
possible_att_reduction_cB += (current_val - v);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
lower_bound = voice->attenuation-possible_att_reduction_cB;
|
lower_bound = voice->attenuation-possible_att_reduction_cB;
|
||||||
|
|
||||||
/* SF2.01 specs do not allow negative attenuation */
|
/* SF2.01 specs do not allow negative attenuation */
|
||||||
if (lower_bound < 0) {
|
if (lower_bound < 0) {
|
||||||
lower_bound = 0;
|
lower_bound = 0;
|
||||||
}
|
}
|
||||||
return lower_bound;
|
return lower_bound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue