Robbert van der Helm
45c141c394
Make smoothing styles Debug, Clone and Copy
2022-05-29 14:21:41 +02:00
Robbert van der Helm
e8764e7327
Use double precision for exponential step sizes
...
Otherwise you will get issues with rounding errors if someone ever tries
to have smoothing times over a second or so.
2022-05-12 13:50:45 +02:00
Robbert van der Helm
6a40cc9916
Remove debug print
2022-05-12 13:44:22 +02:00
Robbert van der Helm
f3d02f6210
Fix updated exponential smoothing
2022-05-12 13:44:01 +02:00
Robbert van der Helm
1fea9f94df
Deduplicate the smoother implementation
...
By introducing a new trait for conversion to and from floating point
numbers.
2022-05-12 13:34:02 +02:00
Robbert van der Helm
dc5dfb06c6
Reach 99.99% of target for exponential smoothing
...
Instead of 99.97%. Both numbers are not based on anything, but this
calculation makes more sense.
2022-05-12 13:21:32 +02:00
Robbert van der Helm
28c7ea4843
Rename ExponentialIIR -> Exponential
...
The suffix was added to denote that this could do some funny things
because of the snapping to the target value, but in practice that
snapping distance will likely be so tiny that it is likely not
noticeable.
2022-05-12 02:22:12 +02:00
Robbert van der Helm
222036b335
Get rid of unnecessary loop in ExponentialIIR
2022-05-12 01:56:16 +02:00
Robbert van der Helm
116d245149
Add an exponential smoothing style
...
Based on a one-pole IIR low pass filter that reaches 99.97% of the
target value in the designated time before snapping to that value. This
will be less efficient than the linear FIR smoothing style.
2022-05-12 01:35:01 +02:00
Robbert van der Helm
b89b4dfbb2
Add a .previous_value() method to the smoothers
2022-04-27 17:43:40 +02:00
Robbert van der Helm
98d725d24f
Add an Iterator implementation for smoothers
2022-04-04 17:58:25 +02:00
Robbert van der Helm
6f01097b03
Add mapped next_block() functions for smoothers
2022-04-04 17:44:49 +02:00
Robbert van der Helm
3d7a23c812
Expose steps_left on the smoothers
2022-03-23 16:50:09 +01:00
Robbert van der Helm
80457ac0f9
Fix doc links after prelude migration
2022-03-03 23:30:29 +01:00
Robbert van der Helm
f581294d7b
Update rustdoc formatting for links
...
Apparently it showed this text verbatim, and not in monospace.
2022-03-03 23:05:12 +01:00
Robbert van der Helm
fdda32696a
Remove unused import
2022-03-01 23:50:41 +01:00
Robbert van der Helm
8eafcebe62
Mention the panicking behavior of block smoothing
2022-03-01 20:23:04 +01:00
Robbert van der Helm
3e8b2b3759
Use AtomicRef instead of Mutexes for block smooth
2022-03-01 19:52:56 +01:00
Robbert van der Helm
3122c0cb41
Pass block references to the block smoother
...
So you can't mess this up by passing the maximum block size instead.
2022-03-01 17:33:22 +01:00
Robbert van der Helm
dffddfaf04
Implement the block smoothers
2022-03-01 17:29:09 +01:00
Robbert van der Helm
d470a1db5a
Add functions for allocating block smoothers
2022-03-01 17:07:03 +01:00
Robbert van der Helm
892aef7e37
Mark smoother functions as inline
2022-03-01 16:55:30 +01:00
Robbert van der Helm
fd3f4c2c48
Allow skipping steps in the smoothers
...
I'll need this for Diopser since it's going to have a parameter to
control the automation's granularity.
2022-02-13 18:33:05 +01:00
Robbert van der Helm
c99877ec05
Fix Smoother::is_smoothing()
2022-02-12 20:54:03 +01:00
Robbert van der Helm
f645b6a92f
Relicense under the ISC license
2022-02-12 16:04:46 +01:00
Robbert van der Helm
379c74e874
Remove spurious dbg!() calls
2022-02-10 23:41:04 +01:00
Robbert van der Helm
2486368d08
Use AtomicF32 for the smoothing
...
This should at least not have a big performance impact since we can use
relaxed memory ordering here. AtomicCell always uses acquire/release
ordering.
2022-02-06 03:43:59 +01:00
Robbert van der Helm
bf070fce5a
Use atomics in the smoother
...
This is needed so we can share the params with the editor, but it isn't
great, is there a better alternative?
2022-02-06 01:33:19 +01:00
Robbert van der Helm
b901dac012
Disambiguate rustdoc link references
2022-02-05 12:56:03 +01:00
Robbert van der Helm
63d30d33e4
Fix rustdoc links
2022-02-05 12:52:34 +01:00
Robbert van der Helm
073fe743c2
Split up set_target and reset in smoothers
...
This makes it a bit less awkward to use in user code, if you need a
separate smoother there.
2022-02-04 15:17:42 +01:00
Robbert van der Helm
30609c3ecd
Add an is_smoothing() check
2022-02-03 16:51:41 +01:00
Robbert van der Helm
2ca54d220d
Add logarithmic smoothing
2022-02-02 23:00:17 +01:00
Robbert van der Helm
1ad477ee4f
Add smoothing tests
2022-02-02 22:34:29 +01:00
Robbert van der Helm
da291175d1
Rename SmoothLinear to Linear
...
We'll rethink this when we get to sample accurate automation.
2022-02-02 22:00:00 +01:00
Robbert van der Helm
0ecec104fb
Completely reset smoothing on init or restore
2022-02-02 21:41:20 +01:00
Robbert van der Helm
ea7dc2ffa3
Implement smoothing for integers
2022-02-02 21:26:20 +01:00
Robbert van der Helm
8f89754ba5
Add simple linear parameter smoothing
2022-02-02 21:26:13 +01:00