Robbert van der Helm
be4bbd4400
Allow nested parameter structs
...
See the Parameters docstring for the caveats.
2022-03-03 20:38:28 +01:00
Robbert van der Helm
76369ad1e1
💥 Rework FloatParam and IntParam
...
They are now two separate types with slightly different options. I had
these merged initially because they're 95% the same, and I thought it
would be fun to have weird distributions for integer parameters, but
that doesn't really work because hosts and the plugin APIs expect the
steps to be linear. And if you're going to have an unstepped integer
parameter, might as well use FloatParam with rounding.
Because non-linear ranges are no longer possible with IntParam, the
types have been split up to make everything much more readable instead
of adding a parameterizing the range type with another type family.
2022-03-03 19:24:40 +01:00
Robbert van der Helm
c0f03a97fc
Add a todo about removing skewed integer ranges
2022-03-03 18:36:36 +01:00
Robbert van der Helm
fa01d3bfeb
Generate most of ParamPtr with a macro
2022-03-03 14:28:52 +01:00
Robbert van der Helm
b5a471747f
Add name, unit, and step count functions to Param
...
Now we can simplify ParamPtr by generating all of these accessors.
2022-03-03 13:55:54 +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
f103e1e14c
Reorder Param methods
...
Moving the things that are only used internally to the bottom.
2022-03-01 16:53:18 +01:00
Robbert van der Helm
0fd80330bb
Move parameter step count to ParamPtr
2022-03-01 01:53:48 +01:00
Robbert van der Helm
ae212962a3
Add a todo for nested params objects
2022-02-28 22:16:46 +01:00
Robbert van der Helm
5d9f268d4c
Don't doctest the enum example
2022-02-14 16:21:34 +01:00
Robbert van der Helm
ecd1be8965
Add a derive macro for Enum parameters
2022-02-14 16:16:05 +01:00
Robbert van der Helm
4f0e2b70b5
Rework EnumParam to be a whole lot less sketchy
...
Now it no longer needs to do any unsound type punning. The internal
parameter that the wrapper has access to has been completely type
erased, and only the outer parameter knows about enum T. This also gets
rid of strum and replaces it with a custom trait.
2022-02-14 15:34:46 +01:00
Robbert van der Helm
0e930668f2
Move EnumParam to its own module
2022-02-14 14:35:57 +01:00
Robbert van der Helm
5a26756765
Move BoolParam to its own module
2022-02-14 14:27:40 +01:00
Robbert van der Helm
70da6209fc
Move PlainParam to its own module
2022-02-14 14:19:46 +01:00
Robbert van der Helm
847887db9d
Allow custom names for enum variants
2022-02-14 02:26:11 +01:00
Robbert van der Helm
39e8dfc83c
Add somewhat shady enum parameters
2022-02-14 02:04:17 +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
99fe9e865b
Fix decimals in snapping test
2022-02-13 18:07:19 +01:00
Robbert van der Helm
19d2dc0a67
Implement step snapping for parameters
2022-02-13 17:52:54 +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
640fe0ebd7
Make parameter pointers hashable
...
So we can use have generic APIs that take a `Param` implementation and
know how to map those to the parameter IDs used by the plugin API.
2022-02-05 17:43:15 +01:00
Robbert van der Helm
0bc8f9b5b1
Move preview_{normalized,plain} to Param
...
We're going to need this for setting parameter values with a gneric API.
2022-02-05 17:32:06 +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
4c0031d7b3
Fix clippy lints
2022-02-04 18:42:42 +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
c1f435d909
Refer to the gain plugin in the Params trait
2022-02-03 17:05:38 +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
1336139a65
Update smoothers on init and state restore
...
Otherwise this would be filled with default values.
2022-02-02 21:33:20 +01:00
Robbert van der Helm
e30a72888a
Add an update_smoother() parameter method
2022-02-02 21:26:34 +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
Robbert van der Helm
63e4a54d7c
Center skewed parameters around the skew center
...
It's a bit awkward and you can completely lose some parts of the range
if you don't do this.
2022-02-02 00:06:07 +01:00
Robbert van der Helm
7752ce6771
Add symmetrically and asymmetrically skewed ranges
...
This is super useful. I'm sure the symmetrical implementation can be
optimized a lot, but my math-fu was not strong enough today.
2022-02-01 23:37:28 +01:00
Robbert van der Helm
740868a10c
Move parameter ranges to their own module
...
This module was too difficult to navigate with parameter types + ranges
+ implementation details.
2022-02-01 21:06:13 +01:00