back

JavaScript

iirH:  high-pass IIR

Run once javascript code
root["low"] = 38;	// whatever initial value should be
const tc = 3;		// higher values increase sensitivity
function iirH(i) {
	i -= root["low"]; 
	root["low"] += i / tc;
	return i;
}

Javascript
// shifts and driven wheel longitudinal slips
return 10 * Math.abs(iirH(3000 * $prop('SpeedMph') / (1 + $prop('Rpms'))));

iirL:  low-pass IIR

Run once javascript code
root["low"] = 38;	// whatever initial value should be
const tc = 3;		// higher values decrease sensitivity
function iirL(i) {
	root["low"] += (i - root["low"]) / tc;
	return root["low"];
}

Javascript

Loaded wheel slip

Run once javascript code
function AbsAcc(a) { return 100 * Math.abs(.05 * a)**0.3 }
function SG(s, g) { return Math.abs(.5 * s / Math.max(.1, Math.abs(g))) - 5 };
function gate(s, g) { return 0.01 * Math.min(100, 35 * SG(s,g)) }
var s,d,L;

Javascript
// front left load
// proxyL
d = (0 > (s = $prop('AccelerationSway'))) ? 4 : -4;
L = 25 + AbsAcc(s) / d  // 0-50% left-right distribution
d = (0 < (s = $prop('AccelerationSurge'))) ? 100 : -100
// if both accel are 0, then no load shift and each corner gets 25%
L *= (1 + AbsAcc(s) / d); // 0-100% fore-aft distribution
s = $prop('ShakeITBSV3Plugin.Export.proxyS.FrontLeft');
return L * gate(s, $prop('GlobalAccelerationG'));

noise

Run once javascript code
const n = 3;		// fraction of range for random()
const f = n / (1 + n);
function SG(s, g) { return 100 - Math.min(100, Math.abs(.5*s/Math.max(.1,Math.abs(g)))) };
function noise(sg) { return f * (sg + Math.random() * (1 + sg / n)) };
var s;

Javascript
s = $prop('ShakeITBSV3Plugin.Export.proxyS.FrontLeft');
//return SG(s, $prop('GlobalAccelerationG'))
//return noise(0)
return noise(SG(s, $prop('GlobalAccelerationG')));

Tire haptic

Run once javascript code  
const low = 25;
const high = 1000;
const f = .01 * (high - low);

Javascript
return low + f * $prop('ShakeITBSV3Plugin.Export.noisy.FrontLeft')
maintained by blekenbleu