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:
nvrl committed 2026-11-06 07:53:20 +01:00
1 parent b3ebe4d952
commit e3286f9094
21 files changed
+3471 -9

No files matched your search

+43
View File
@@ -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")
}
}
}