iphone, macos, ios, sensors, midi, motion, movement, touchosc, touchosc mk2, osc, ableton live, protokol, touchosc bridge

How To

https://hexler.net/touchosc/manual/getting-started-midi

Documentations

https://hexler.net/touchosc/manual/complete

https://www.lua.org/manual/5.1/

TouchOSC Script

Kalman Filter Parameters

The parameters _KF_Q_ANGLE, _KF_Q_BIAS, and _KF_R_MEASURE are key components of the Kalman filter. They control the filter's behavior and performance.

_KF_Q_ANGLE - Process Noise Covariance for the Angle

Increasing Q_ANGLE will make the filter more responsive to changes in the accelerometer data but can also make it more sensitive to noise. Decreasing it will make the filter smoother and less responsive.

This is about how much you think your phone's angle might change unpredictably. If your phone is moving smoothly, you expect little unpredictability (small number). If your phone is shaking a lot, you expect more unpredictability (bigger number).

_KF_Q_ANGLE = 0.001 -- Default value, increase for more responsiveness, decrease for more smoothing

_KF_Q_BIAS - Process Noise Covariance for the Bias

Increasing _KF_Q_BIAS will allow the filter to correct bias errors more quickly but can introduce more noise into the estimates. Decreasing it will make the bias correction slower and smoother.

This is about how much you think your phone's sensors might have a drifting error. If the sensor error changes a lot, you need a bigger number. If the sensor error stays almost the same, you need a smaller number.

_KF_Q_BIAS = 0.003 -- Default value, increase for faster bias correction, decrease for smoother correction