Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ Nothing has been released yet. The first release, 0.1.0, will cover what is on `
- Expanded windows for Compressor, Limiter, Gate and Glue Compressor: the last 1, 4 or 10 seconds of input, output and
gain reduction (Hold view freezes it) under a threshold or ceiling line you can drag, a transfer curve with the live
operating point beside the main controls, In and Out meters and every control laid out in rows.
- Expanded windows for Character Compressor (the model pills in the header, a main card that follows the model, and a
rack card with Detector, Sidechain and Level sections) and Mastering Limiter (its style pills, a short-term loudness
lane against a Streaming, Broadcast or Hot target with Loudness Reset, and ceiling and threshold lines you can drag).
Mastering Limiter's ceiling reads in dBTP while True Peak is on.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ factory presets) that the model, undo, saving, automation, engine and panel all
behind it. Auto Filter, Channel EQ and Character EQ also open an expanded window with a large display and live analyser,
In and Out meters and every control laid out in rows, and so do Tremolo, Auto-Panner, Chorus, Flanger, Phaser,
Ring Mod and Character Mod, whose window plots their motion or response with a time or frequency axis and a legend, and
Compressor, Limiter, Gate and Glue Compressor, whose window scrolls the last 1, 4 or 10 seconds of input, output and gain
reduction under a draggable threshold, beside a transfer curve; the other devices open their card in a window for now.
Compressor, Limiter, Gate, Glue Compressor, Character Compressor and Mastering Limiter, whose window scrolls the last 1, 4
or 10 seconds of input, output and gain reduction under a draggable threshold, beside a transfer curve (the Mastering
Limiter adds a short-term loudness lane against a target); the other devices open their card in a window for now.
[docs/devices.md](docs/devices.md) explains how they work and how to add one.

| Kind | Devices |
Expand Down
1 change: 1 addition & 0 deletions crates/dstudio-app/src/device_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,7 @@ impl Controller {
let check = |on: bool| if on { "✓".to_string() } else { String::new() };
let rows = match which {
crate::device_window::MENU_ANALYZER => self.win_analyzer_rows(device),
crate::device_window::MENU_TARGET => self.win_target_rows(device),
crate::device_window::MENU_BANDS => match self.win_band_rows(device) {
Some(rows) => rows,
None => return,
Expand Down
350 changes: 331 additions & 19 deletions crates/dstudio-app/src/device_window.rs

Large diffs are not rendered by default.

267 changes: 208 additions & 59 deletions crates/dstudio-app/src/device_window_dynamics.rs

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions crates/dstudio-app/ui/device_panel.slint
Original file line number Diff line number Diff line change
Expand Up @@ -399,24 +399,28 @@ component ButtonCell inherits Rectangle {

// Drag zone of a device field: one or two parameters (horizontal / vertical), Shift fine,
// Alt-click or double-click resets them.
component ZoneDrag inherits TouchArea {
// The pointer is tracked in window coordinates: a zone that follows its line (a threshold,
// a handle) moves under the pointer while it is dragged.
export component ZoneDrag inherits TouchArea {
in property <int> device;
in property <PanelZone> zone;
property <length> last-x;
property <length> last-y;
property <length> at-x: self.absolute-position.x + self.mouse-x;
property <length> at-y: self.absolute-position.y + self.mouse-y;
mouse-cursor: root.zone.param-x >= 0 && root.zone.param-y >= 0 ? MouseCursor.move : root.zone.param-x >= 0 ? MouseCursor.ew-resize : MouseCursor.ns-resize;
function reset() { Studio.panel-reset-xy(root.device, root.zone.param-x, root.zone.param-y); }
pointer-event(e) => {
if (e.button == PointerEventButton.left && e.kind == PointerEventKind.down) {
if (e.modifiers.alt) { root.reset(); return; }
root.last-x = self.mouse-x;
root.last-y = self.mouse-y;
root.last-x = root.at-x;
root.last-y = root.at-y;
Studio.panel-drag-xy(root.device, root.zone.param-x, root.zone.param-y, 0, 0, 0, root.zone.rate-x, root.zone.rate-y, e.modifiers.shift);
}
if (e.kind == PointerEventKind.move && self.pressed) {
Studio.panel-drag-xy(root.device, root.zone.param-x, root.zone.param-y, 1, (self.mouse-x - root.last-x) / 1px, (root.last-y - self.mouse-y) / 1px, root.zone.rate-x, root.zone.rate-y, e.modifiers.shift);
root.last-x = self.mouse-x;
root.last-y = self.mouse-y;
Studio.panel-drag-xy(root.device, root.zone.param-x, root.zone.param-y, 1, (root.at-x - root.last-x) / 1px, (root.last-y - root.at-y) / 1px, root.zone.rate-x, root.zone.rate-y, e.modifiers.shift);
root.last-x = root.at-x;
root.last-y = root.at-y;
}
if (e.button == PointerEventButton.left && e.kind == PointerEventKind.up) { Studio.panel-drag-xy(root.device, root.zone.param-x, root.zone.param-y, 2, 0, 0, root.zone.rate-x, root.zone.rate-y, false); }
if (e.kind == PointerEventKind.cancel) { Studio.panel-drag-xy(root.device, root.zone.param-x, root.zone.param-y, 3, 0, 0, root.zone.rate-x, root.zone.rate-y, false); }
Expand Down
6 changes: 3 additions & 3 deletions crates/dstudio-core/src/builtin/character_compressor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ pub static CHARACTER_COMPRESSOR: DeviceDef = DeviceDef {
ParamDef::new("release", "Release", 20.0, 8000.0, 200.0, Taper::Linear { skew: 0.3 }, "ms", Format::Custom(TextFn(release_text)))
.help("How fast reduction lets go."),
ParamDef::choice("adapt", "Adapt", OFF_ON, 0).help("Program-dependent release: sustained reduction recovers more slowly."),
ParamDef::new("hold", "Hold", 0.0, 500.0, 0.0, Taper::Linear { skew: 0.5 }, "ms", Format::Custom(TextFn(release_text)))
ParamDef::new("hold", "Hold", 0.0, 500.0, 0.0, Taper::Linear { skew: 0.5 }, "ms", Format::Ms(2))
.help("Time the reduction is held before it releases."),
ParamDef::new("range", "Range", 0.0, 24.0, 24.0, LINEAR, "dB", Format::Db).step(0.1).help("Largest gain reduction allowed."),
ParamDef::new("range", "Range", 0.0, 24.0, 24.0, LINEAR, "dB", Format::DbNoPlus).step(0.1).help("Largest gain reduction allowed."),
ParamDef::new("drive", "Drive", 0.0, 2.0, 1.0, LINEAR, "", Format::Plain(2))
.help("Amount of the model's saturation; 1 is the model's normal colour."),
ParamDef::new("mix", "Mix", 0.0, 200.0, 100.0, LINEAR, "%", PCT)
.help("Blend of dry and compressed signal; above 100% the compression is exaggerated."),
ParamDef::new("makeup", "Makeup", -12.0, 24.0, 0.0, LINEAR, "dB", Format::Db).step(0.1).help("Gain after compression."),
ParamDef::choice("auto_gain", "Auto Gain", OFF_ON, 0).help("Adds make-up gain that follows the threshold and ratio."),
ParamDef::new("lookahead", "Lookahead", 0.0, 20.0, 0.0, LINEAR, "ms", Format::Time)
ParamDef::new("lookahead", "Lookahead", 0.0, 20.0, 0.0, LINEAR, "ms", Format::MsAuto)
.step(0.1)
.help("Delays the audio so the detector reacts before peaks arrive (adds latency)."),
ParamDef::choice("oversampling", "Oversampling", &["2x", "4x"], 0).help("Oversampling of the saturation stage."),
Expand Down
25 changes: 24 additions & 1 deletion crates/dstudio-core/src/builtin/mastering_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub static MASTERING_LIMITER: DeviceDef = DeviceDef {
.not_automatable()
.overlays(STYLE_OVERLAYS)
.help("Clean is transparent, Loud recovers fastest, Gentle is a single slow stage, Dense leans on the slow stage."),
ParamDef::new("lookahead", "Lookahead", 0.1, 5.0, 2.0, LINEAR, "ms", Format::Ms(1))
ParamDef::new("lookahead", "Lookahead", 0.1, 5.0, 2.0, LINEAR, "ms", Format::Ms(2))
.step(0.01)
.not_automatable()
.help("How far ahead peaks are seen; longer is smoother, shorter is punchier."),
Expand Down Expand Up @@ -154,3 +154,26 @@ pub static MASTERING_LIMITER: DeviceDef = DeviceDef {
sidechain: false,
samples: 0,
};

/// The ceiling reads in dBTP while True Peak limiting is on: "−1.0 dBTP".
fn text(def: &DeviceDef, d: &Device, p: &ParamDef, v: f32) -> Option<String> {
let true_peak = def.param("true_peak").is_some_and(|tp| def.value(d, tp) >= 0.5);
(p.id == "ceiling" && true_peak).then(|| if v < -0.05 { format!("\u{2212}{:.1} dBTP", -v) } else { "0.0 dBTP".into() })
}

pub(super) static BEHAVIOR: Behavior = Behavior { text, ..Behavior::NONE };

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn ceiling_reads_true_peak_while_limiting_true_peak() {
let def = &MASTERING_LIMITER;
let mut d = def.instantiate();
let ceiling = def.param("ceiling").unwrap();
assert_eq!(def.text(&d, ceiling, -1.0), "\u{2212}1.0 dBTP");
d.params.insert("true_peak".into(), 0.0);
assert!(!def.text(&d, ceiling, -1.0).contains("TP"));
}
}
1 change: 1 addition & 0 deletions crates/dstudio-core/src/builtin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ pub fn behavior(def: &DeviceDef) -> Option<&'static Behavior> {
"delay" => Some(&delay::BEHAVIOR),
"echo" => Some(&echo::BEHAVIOR),
"grains" => Some(&grains::BEHAVIOR),
"mastering-limiter" => Some(&mastering_limiter::BEHAVIOR),
"reverb" => Some(&reverb::BEHAVIOR),
_ => None,
}
Expand Down
13 changes: 11 additions & 2 deletions docs/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ flowchart LR
device has one (`device_window::has_window`; Auto Filter, Channel EQ,
Character EQ and the plotted-field family: Tremolo, Auto-Panner, Chorus,
Flanger, Phaser, Ring Mod and Character Mod; and the dynamics family:
Compressor, Limiter, Gate and Glue Compressor), otherwise the card itself in a window. A
Compressor, Limiter, Gate, Glue Compressor, Character Compressor and Mastering
Limiter), otherwise the card itself in a window. A
window is a face 960 pt wide (Ring Mod 860): a top bar (power, presets, the device's header pills), a
large display (the card's canvas drawn at window size with its axis and
legend), In / Out meters, and rows of controls laid out with the same
Expand All @@ -84,7 +85,15 @@ flowchart LR
over a dBFS level plot, one pixel per dB in both, with the threshold (or
ceiling) as a dashed line you drag. Hold view freezes the history. Each
device's first card carries a transfer square: the static curve of the
card's law over −48..0 dB with the knee and the live operating point. The
card's law over −48..0 dB with the knee and the live operating point
(Character Compressor's comes from its model's computed curve). Character
Compressor's rack card switches between Detector, Sidechain and Level
sections (`ACT_SECTION`; the Level band pills reuse `ACT_TAME_BAND`).
Mastering Limiter's display adds a loudness lane: the output's short-term
level (unweighted mean power over 3 s) against the Target picker's level
(`MENU_TARGET`: Streaming −14, Broadcast −23, Hot −9 LUFS), restarted by
Loudness Reset (`ACT_LOUD_RESET`), and draws its ceiling as a second,
solid line with its own grip. The
meters read `se_builtin_set_metering` / `se_builtin_levels`
(`Engine::builtin_levels(id, &mut [f32; 4])`): while a window is open the
audio thread keeps the input and output peak of each block, and the app
Expand Down
Loading