Update Fluidsynth to v2.0.6-git

This commit is contained in:
Robin Gareus 2019-09-04 04:22:24 +02:00
parent 69a3b0b46e
commit fdcddc736b
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
19 changed files with 329 additions and 239 deletions

View file

@ -150,7 +150,7 @@ fluid_tc2sec_delay(fluid_real_t tc)
return (fluid_real_t) 0.0f;
};
if(tc < -12000.)
if(tc < -12000.f)
{
tc = (fluid_real_t) -12000.0f;
}
@ -160,7 +160,7 @@ fluid_tc2sec_delay(fluid_real_t tc)
tc = (fluid_real_t) 5000.0f;
}
return (fluid_real_t) pow(2.0, (double) tc / 1200.0);
return FLUID_POW(2.f, tc / 1200.f);
}
/*
@ -173,22 +173,22 @@ fluid_tc2sec_attack(fluid_real_t tc)
* SF2.01 section 8.1.3 items 26, 34
* The most negative number indicates a delay of 0
* Range is limited from -12000 to 8000 */
if(tc <= -32768.)
if(tc <= -32768.f)
{
return (fluid_real_t) 0.0;
return (fluid_real_t) 0.f;
};
if(tc < -12000.)
if(tc < -12000.f)
{
tc = (fluid_real_t) -12000.0;
tc = (fluid_real_t) -12000.f;
};
if(tc > 8000.)
if(tc > 8000.f)
{
tc = (fluid_real_t) 8000.0;
tc = (fluid_real_t) 8000.f;
};
return (fluid_real_t) pow(2.0, (double) tc / 1200.0);
return FLUID_POW(2.f, tc / 1200.f);
}
/*
@ -198,7 +198,7 @@ fluid_real_t
fluid_tc2sec(fluid_real_t tc)
{
/* No range checking here! */
return (fluid_real_t) pow(2.0, (double) tc / 1200.0);
return FLUID_POW(2.f, tc / 1200.f);
}
/*
@ -211,22 +211,22 @@ fluid_tc2sec_release(fluid_real_t tc)
* SF2.01 section 8.1.3 items 30, 38
* No 'most negative number' rule here!
* Range is limited from -12000 to 8000 */
if(tc <= -32768.)
if(tc <= -32768.f)
{
return (fluid_real_t) 0.0;
return (fluid_real_t) 0.f;
};
if(tc < -12000.)
if(tc < -12000.f)
{
tc = (fluid_real_t) -12000.0;
tc = (fluid_real_t) -12000.f;
};
if(tc > 8000.)
if(tc > 8000.f)
{
tc = (fluid_real_t) 8000.0;
tc = (fluid_real_t) 8000.f;
};
return (fluid_real_t) pow(2.0, (double) tc / 1200.0);
return FLUID_POW(2.f, tc / 1200.f);
}
/*
@ -238,13 +238,13 @@ fluid_tc2sec_release(fluid_real_t tc)
*
fluid_hz2ct(fluid_real_t f)
{
return (fluid_real_t)(6900 + (1200 / M_LN2) * log(f / 440.0));
return 6900.f + (1200.f / FLUID_M_LN2) * FLUID_LOGF(f / 440.0f));
}
*/
fluid_real_t
fluid_act2hz(fluid_real_t c)
{
return (fluid_real_t)(8.176 * pow(2.0, (double) c / 1200.0));
return 8.176f * FLUID_POW(2.f, c / 1200.f);
}
/*
@ -258,17 +258,17 @@ fluid_pan(fluid_real_t c, int left)
c = -c;
}
if(c <= -500)
if(c <= -500.f)
{
return (fluid_real_t) 0.0;
return (fluid_real_t) 0.f;
}
else if(c >= 500)
else if(c >= 500.f)
{
return (fluid_real_t) 1.0;
return (fluid_real_t) 1.f;
}
else
{
return fluid_pan_tab[(int)(c + 500)];
return fluid_pan_tab[(int)(c) + 500];
}
}
@ -284,17 +284,17 @@ fluid_pan(fluid_real_t c, int left)
fluid_real_t fluid_balance(fluid_real_t balance, int left)
{
/* This is the most common case */
if(balance == 0)
if(balance == 0.f)
{
return 1.0f;
}
if((left && balance < 0) || (!left && balance > 0))
if((left && balance < 0.f) || (!left && balance > 0.f))
{
return 1.0f;
}
if(balance < 0)
if(balance < 0.f)
{
balance = -balance;
}
@ -308,13 +308,13 @@ fluid_real_t fluid_balance(fluid_real_t balance, int left)
fluid_real_t
fluid_concave(fluid_real_t val)
{
if(val < 0)
if(val < 0.f)
{
return 0;
return 0.f;
}
else if(val >= FLUID_VEL_CB_SIZE)
else if(val >= (fluid_real_t)FLUID_VEL_CB_SIZE)
{
return 1;
return 1.f;
}
return fluid_concave_tab[(int) val];
@ -326,13 +326,13 @@ fluid_concave(fluid_real_t val)
fluid_real_t
fluid_convex(fluid_real_t val)
{
if(val < 0)
if(val < 0.f)
{
return 0;
return 0.f;
}
else if(val >= FLUID_VEL_CB_SIZE)
else if(val >= (fluid_real_t)FLUID_VEL_CB_SIZE)
{
return 1;
return 1.f;
}
return fluid_convex_tab[(int) val];