feat(weld): add sidechain test build
Weld will phase-align a bass layer to another layer it hears through the sidechain. This first build only checks that FL Studio delivers the sidechain to a CLAP aux port: it passes the main layer through unchanged, meters the sidechain and offers Layer/Sum/Sum dry listening. No latency.
This commit is contained in:
1 parent
b3ebe4d952
commit
e3286f9094
21 files changed
+3471
-9
No files matched your search
@@ -0,0 +1,43 @@
|
||||
//! Host-independent controls. Gains in dB.
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// What the plugin outputs.
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||
pub enum Listen {
|
||||
/// The aligned main layer only. The sidechain layer reaches the mix on its own track.
|
||||
#[default]
|
||||
Layer,
|
||||
/// Aligned main layer plus the sidechain layer, to judge the sum in one place.
|
||||
Sum,
|
||||
/// Unprocessed main layer plus the sidechain layer, to compare with `Sum`.
|
||||
SumDry,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Settings {
|
||||
pub listen: Listen,
|
||||
pub output: f32,
|
||||
pub bypass: bool,
|
||||
}
|
||||
impl Default for Settings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
listen: Listen::Layer,
|
||||
output: 0.,
|
||||
bypass: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Settings {
|
||||
pub fn validate(&self) -> Result<(), &'static str> {
|
||||
if !self.output.is_finite() {
|
||||
return Err("non-finite setting");
|
||||
}
|
||||
if (-12.0..=12.).contains(&self.output) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("setting out of range")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user