https://github.com/adryzz/customfilter
Use any expression as a tablet driver filter!
https://github.com/adryzz/customfilter
fast filter gaomon huion math opentabletdriver pog tablet veikk wacom xp-pen
Last synced: 6 months ago
JSON representation
Use any expression as a tablet driver filter!
- Host: GitHub
- URL: https://github.com/adryzz/customfilter
- Owner: adryzz
- Created: 2022-02-05T12:32:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-13T14:26:20.000Z (about 2 years ago)
- Last Synced: 2025-03-20T01:11:34.769Z (7 months ago)
- Topics: fast, filter, gaomon, huion, math, opentabletdriver, pog, tablet, veikk, wacom, xp-pen
- Language: C#
- Homepage:
- Size: 36.1 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CustomFilter
The best [OpenTabletDriver](https://github.com/OpentabletDriver/OpenTabletDriver) filter to ever grace this planet](https://github.com/adryzz/CustomFilter/releases)
Allows you to use any mathematical expression that can be evaluated to a number as a filtering stage!
Uses [AngouriMath](https://github.com/asc-community/AngouriMath) to automatically compile your expressions into code at runtime, to achieve the best performance possible.
All the math is done on [complex numbers](https://en.wikipedia.org/wiki/Complex_number), but the end result is just the [real](https://docs.microsoft.com/en-us/dotnet/api/system.numerics.complex.real?view=net-6.0) part of it
## Simple mode

The Simple Mode is the fastest but is limited in the number of samples you can use.
Here's the supported parameters for both expressions:`x` = The X coordinate
`y` = The Y coordinate
`p` = The pressure
`tx` = The tilt X component
`ty` = The tilt Y component
`d` = The hover distance
`lx` = The last X coordinate
`ly` = The last Y coordinate
`lp` = The last pressure
`ltx` = The last tilt X component
`lty` = The last tilt Y component
`ld` = The last hover distance
`mx` = Max X coordinate
`my` = Max Y coordinate
`mp` = Max pressure
`cx` = Last computed X coordinate
`cy` = Last computed Y coordinate
`cp` = Last computed pressure
#### Example: EMA smoothing
> ## Multi-Sample mode (broken and disabled by default)
> > The Multi-Sample mode is slower than the Simple Mode, but it allows for more complex expressions.
> It will automatically store the last `n` samples from your tablet, so that you can retrieve them with ease.
> (e.g. the last X axis sample will be saved as `x0`, the one before as `x1` and so on, same goes with the Y axis).
> **Remember to tell the filter how many samples you are going to use, as storing more than what's needed will slow down execution.**
> As always, other than the last samples we've just seen, you can always access these values:
> - `x` = The X coordinate.
> - `y` = The Y coordinate.
> - `mx` = The max X coordinate.
> - `my` = The max Y coordinate.