insane engine sound
This commit is contained in:
@@ -82,6 +82,7 @@ namespace FluidSim.Core
|
||||
{
|
||||
// 1. Monopole source: d(mdot)/dt
|
||||
double derivative = (massFlow - lastMassFlow) / dt;
|
||||
derivative = Math.Clamp(derivative, -500, 500);
|
||||
lastMassFlow = massFlow;
|
||||
float monopole = (float)(derivative * masterGain);
|
||||
|
||||
@@ -115,7 +116,7 @@ namespace FluidSim.Core
|
||||
|
||||
// 6. Dry/wet mix
|
||||
float output = resonant * 0.7f + wet * 0.3f;
|
||||
output = Math.Clamp(output, -1f, 1f);
|
||||
output = MathF.Tanh(output);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user