mirror of
https://github.com/thestk/stk
synced 2026-01-13 21:11:53 +00:00
Version 2.01
This commit is contained in:
committed by
Stephen Sinclair
parent
6485746ee9
commit
ea749b71d2
10
BowTabl.cpp
10
BowTabl.cpp
@@ -7,9 +7,9 @@
|
||||
|
||||
BowTabl :: BowTabl()
|
||||
{
|
||||
offSet = 0.0; /* offset is a bias, really not needed unless */
|
||||
offSet = (MY_FLOAT) 0.0; /* offset is a bias, really not needed unless */
|
||||
/* friction is different in each direction */
|
||||
slope = 0.1; /* controls width of friction pulse, */
|
||||
slope = (MY_FLOAT) 0.1; /* controls width of friction pulse, */
|
||||
/* related to bowForce */
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@ MY_FLOAT BowTabl :: lookup(MY_FLOAT sample) /* Perform Table Lookup */
|
||||
MY_FLOAT input;
|
||||
input = sample + offSet; /* add bias to sample */
|
||||
input *= slope; /* scale it */
|
||||
lastOutput = fabs(input) + 0.75; /* below min delta, friction = 1 */
|
||||
lastOutput = pow(lastOutput,-4.0);
|
||||
lastOutput = (MY_FLOAT) fabs((double) input) + (MY_FLOAT) 0.75; /* below min delta, friction = 1 */
|
||||
lastOutput = (MY_FLOAT) pow(lastOutput,(MY_FLOAT) -4.0);
|
||||
// if (lastOutput < 0.0 ) lastOutput = 0.0; /* minimum friction is 0.0 */
|
||||
if (lastOutput > 1.0 ) lastOutput = 1.0; /* maximum friction is 1.0 */
|
||||
if (lastOutput > 1.0 ) lastOutput = (MY_FLOAT) 1.0; /* maximum friction is 1.0 */
|
||||
return lastOutput;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user