1
0
Fork 0
Commit graph

66 commits

Author SHA1 Message Date
Robbert van der Helm
c566888fa3 💥 Use interior mutability for parameters
Instead of the previous technically-unsound approach. While it wouldn't
cause any issues in practice, it did break Rust's guarantees. That was a
design choice after adding support for editors in NIH-plug, but this is
probably the better long term solution.

The downside is that all uses of `param.value` now need to be changed to
`param.value()`.
2022-09-06 21:57:24 +02:00
Robbert van der Helm
35e584b3c8 Add a poly mod gain parameter to PolyModSynth 2022-07-06 19:18:49 +02:00
Robbert van der Helm
68cf0455ee Rework and optimize block smoothing API
You now need to bring your own buffer instead of the smoother having a
built in vector you would need to pre-allocate. This makes the API
simpler, and also much more flexible when doing polyphonic modulation.

In addition, the new API is much more efficient when there is no
smoothing going on anymore.
2022-07-06 14:29:29 +02:00
Robbert van der Helm
1424b98e38 Break PolyModulation into that and MonoAutomation
This is needed to properly support polyphonic modulation, since the
modulated value may still be automated in the meantime and the
polyphonic modulation must act as an offset for that value. This does
mean that the plugin must add the normalized value and normaliezd offset
by itself. The `PolyModulation` event now also contains a description of
how this can be used. It would have been nicer to be able to send
polyphonic automation-style events instead (like the PolyModulation was
doing before), but that's sadly not feasible without NIH-plug being
involved in the voice management.
2022-07-06 13:40:12 +02:00
Robbert van der Helm
992fcfe969 Add polyphonic modulation IDs to parameters
In a bit we should be able to use this with a new `PolyModulation` note
event to allow polyphonic modulation.
2022-07-05 19:39:50 +02:00
Robbert van der Helm
e1d4be2a03 Change NON_AUTOMATABLE semantics and add HIDDEN
This now lets you have parameters that cannot be automated but that are
still changeable through the generic UI.
2022-05-22 12:37:30 +02:00
Robbert van der Helm
06c5e4b04a Make parameter modulation stick after automation
This is how it's supposed to be implemented in CLAP.
2022-05-02 15:46:57 +02:00
Robbert van der Helm
ddbaffc0bb Add ParamMut method for setting modulation offset
This will be used in the CLAP wrapper to handle `CLAP_EVENT_PARAM_MOD`.
2022-05-01 19:03:04 +02:00
Robbert van der Helm
1d3ac1b2af Move param setting functions to new ParamMut trait
This makes things slightly less confusing because these functions should
never be called from user code.
2022-05-01 18:45:35 +02:00
Robbert van der Helm
a17c63bf71 Add parameter getters for unmodulated values
This is needed to be able to support modulation events in CLAP. There an
offset gets applied to the parameter's actual current value. That way
GUIs don't have to move around when parameters are being modulated and
save states cannot get influenced by modulation.
2022-05-01 18:30:30 +02:00
Robbert van der Helm
cd628e80ee Store normalized values on the param structs
This will be necessary to implement CLAP modulation later.
2022-05-01 17:34:59 +02:00
Robbert van der Helm
40b555bfbd Document how values work in the Param trait 2022-05-01 16:40:18 +02:00
Robbert van der Helm
48d0f87e4c Mark param value getters as inline 2022-05-01 16:40:16 +02:00
Robbert van der Helm
bb3175f68e Return -> Returns at the start of a docstring
The imperative tense doesn't make any sense when the function is a mere
getter and doesn't actually perform a nontrivial task.
2022-04-26 19:39:51 +02:00
Robbert van der Helm
9acd312768 Parmaeters are not real, they can't hurt you 2022-04-24 19:46:07 +02:00
Robbert van der Helm
3c69fb72cf Make parameter names owned
That way you can generate parameters with custom `Params`
implementations.
2022-04-11 23:27:36 +02:00
Robbert van der Helm
4e5afc152a Add a basic docstring to the Params module 2022-04-11 17:38:20 +02:00
Robbert van der Helm
8090d0ae41 Add explicit bypass parameter handling
Plugins can mark a `BoolParam` with `.is_bypass()`. Hosts can then link
use that parameter directly in their own UI.
2022-03-23 17:42:48 +01:00
Robbert van der Helm
a1be942d6d Add flags to control parameter visibility
For the host and in generic UIs. These aren't wired up to anything yet.
2022-03-23 13:04:14 +01:00
Robbert van der Helm
9e3149b931 Move ParamPtr to the prelude 2022-03-23 12:46:46 +01:00
Robbert van der Helm
40d99a5cb3 Automatically implement Param::set_normalized_value() 2022-03-21 13:28:59 +01:00
Robbert van der Helm
021d175264 Use a default implementation for Param::normalized_value() 2022-03-21 13:28:59 +01:00
Robbert van der Helm
a844051054 Store defaults on Param objects
And add methods for querying them.
2022-03-21 12:49:59 +01:00
Robbert van der Helm
4c5d61057e Fix typos 2022-03-19 19:24:08 +01:00
Robbert van der Helm
a6e35cfaa9 Add methods for normalized parameter stepping
This is mostly useful for GUIs.
2022-03-19 16:12:56 +01:00
Robbert van der Helm
95370667d7 Rearrange the Param methods 2022-03-19 16:09:31 +01:00
Robbert van der Helm
d9330628c0 Add stepping functions to Param
This can be useful for GUI widgets.
2022-03-19 16:06:20 +01:00
Robbert van der Helm
fb60f3a28b Remove unused Param::set_from_string
This method is a bit more efficient than converting the string to a
normalized value and then setting the parameter using that but it's not
used right now and it adds a form of redundancy.
2022-03-18 17:53:38 +01:00
Robbert van der Helm
03eef2c832 Require PartialEq on plain parameter types
So you can compare them in parameter widgets.
2022-03-05 19:50:12 +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
4c0b07c578 💥 Move re-exports to a prelude module
So you can import everything at once, because you're likely going to
need at least 90% of it anyways.
2022-03-03 23:23:51 +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
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
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
d470a1db5a Add functions for allocating block smoothers 2022-03-01 17:07:03 +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
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
287576d064 Fix rustdoc hyperlinks 2022-02-14 14:22:57 +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
0c1f105910 Fix string to value for enum parameters 2022-02-14 02:10:12 +01:00
Robbert van der Helm
39e8dfc83c Add somewhat shady enum parameters 2022-02-14 02:04:17 +01:00
Robbert van der Helm
990072f529 Fix step size based formatting 2022-02-13 18:03:45 +01:00
Robbert van der Helm
19d2dc0a67 Implement step snapping for parameters 2022-02-13 17:52:54 +01:00
Robbert van der Helm
4481ef0ae9 Avoid more redundancy in parameter handling 2022-02-13 16:49:29 +01:00
Robbert van der Helm
4783535ebb Use preview_plain when setting normalized values
To prevent bugs, there should be only one way parameters are
unnormalized.
2022-02-13 16:44:18 +01:00
Robbert van der Helm
adf59c192b Add a step size for float parameters 2022-02-13 16:41:31 +01:00
Robbert van der Helm
cd0b870682 Directly pass a style to .with_smoother() 2022-02-12 19:56:37 +01:00
Robbert van der Helm
34fa536acb Add a builder interface for constructing params 2022-02-12 17:10:25 +01:00