feat(ui): MAIN and ADVANCED pages, Anvil main page around Mode, Split and Sub level

Producers found the panels crowded: every control had the same weight. The
header now carries a MAIN / ADVANCED switch (common-ui header_paged). The
main page keeps the controls a first result needs; the advanced page shows
everything, as before.

- Anvil: Mode (Replace or Enhance), Split and Sub level, plus Octave, Ghost,
  Keep and Output. Kick lock, Dynamics, Drive, Glide, Phase, Gate and the
  pitch switches move to Advanced. The note readout says when the original
  sub plays because tracking is unsure.
- Lathe, Temper, Knurl, Planish, Braze: tracking and fine-tuning controls
  (Gate, Smooth, Snap, Harmonics, Push at, Floor, Bright, Normalize, band
  gains, Phase) move to Advanced. Lathe labels the octaves of the note in Hz
  on the harmonic axis.
- Forge passes the page to its module pages.
- Weld: the main page shows the level won back at full height, Mode,
  Response and Output; the phase plot, Sections, Low, High and Gate move to
  Advanced.
- editor-check renders the advanced pages with --advanced.
This commit is contained in:
nvrl committed 2026-11-06 21:16:11 +01:00
1 parent d6939a753a
commit 01fd3241eb
10 files changed
+594 -227

No files matched your search

+50 -33
View File
@@ -13,12 +13,15 @@ pub struct State {
/// True while a pointer button is held, so knob drags become one host gesture.
pub gesture_active: bool,
pub help: String,
/// The advanced page shows its extra controls. Not saved.
pub advanced: bool,
}
impl Default for State {
fn default() -> Self {
Self {
analyzer: AnalyzerFrame::default(),
gesture_active: false,
advanced: false,
help: DEFAULT_HELP.into(),
}
}
@@ -226,19 +229,27 @@ pub fn show(ui: &mut egui::Ui, settings: &mut Settings, state: &mut State) {
state.help = DEFAULT_HELP.into();
state.gesture_active = ui.input(|i| i.pointer.any_down());
ui.add_space(2.);
header(ui, "TEMPER", "TRACKED DISTORTION", |ui| {
let r = ui
.selectable_label(settings.bypass, RichText::new("BYPASS").size(13.))
.on_hover_text("Crossfade to the delayed dry signal.");
if r.clicked() {
settings.bypass = !settings.bypass;
}
toggles(ui, settings);
ui.separator();
let mut mode = settings.source.mode();
pitch_from(ui, &mut mode, &mut settings.pitch);
settings.source = Source::from_mode(mode);
});
let mut advanced = state.advanced;
header_paged(
ui,
"TEMPER",
"TRACKED DISTORTION",
Some(&mut advanced),
|ui| {
let r = ui
.selectable_label(settings.bypass, RichText::new("BYPASS").size(13.))
.on_hover_text("Crossfade to the delayed dry signal.");
if r.clicked() {
settings.bypass = !settings.bypass;
}
toggles(ui, settings);
ui.separator();
let mut mode = settings.source.mode();
pitch_from(ui, &mut mode, &mut settings.pitch);
settings.source = Source::from_mode(mode);
},
);
state.advanced = advanced;
body(ui, settings, state);
ui.separator();
ui.label(RichText::new(&state.help).color(MUTED));
@@ -371,7 +382,8 @@ fn note_panel(ui: &mut egui::Ui, settings: &Settings, frame: &AnalyzerFrame) {
fn controls(ui: &mut egui::Ui, settings: &mut Settings, state: &mut State) {
let d = Settings::default();
ui.columns(10, |c| {
let advanced = state.advanced;
ui.columns(if advanced { 10 } else { 5 }, |c| {
knob(&mut c[0], state, "Drive", &mut settings.drive, 0. ..=36., d.drive, " dB", 80.,
"Gain into the curve. With Normalize at 100 % every note starts from the same level.");
knob(&mut c[1], state, "Bias", &mut settings.bias, 0. ..=100., d.bias, " %", 80.,
@@ -380,25 +392,30 @@ fn controls(ui: &mut egui::Ui, settings: &mut Settings, state: &mut State) {
"Boost or cut one harmonic before the curve, so the distortion bites there on every note.");
knob(&mut c[3], state, "Mix", &mut settings.mix, 0. ..=100., d.mix, " %", 80.,
"Blend with the delayed dry signal.");
let mut push = settings.push_harmonic as f32;
knob(&mut c[4], state, "Push at", &mut push, 1. ..=16., d.push_harmonic as f32, "", 54.,
"Harmonic number that Push boosts or cuts.");
settings.push_harmonic = push.round().clamp(1., 16.) as u32;
knob(&mut c[5], state, "Floor", &mut settings.floor, 0. ..=2., d.floor, " ×f0", 54.,
"Highpass before the curve at this multiple of the note. 0 is off. Keeps sub mud out of the distortion.");
if settings.floor < 0.25 {
settings.floor = 0.;
}
knob(&mut c[6], state, "Bright", &mut settings.bright, 0. ..=64., d.bright, " ×f0", 54.,
"Lowpass after the curve at this harmonic. 0 is off. The top end stops at the same harmonic on every note.");
if settings.bright < 4. {
settings.bright = 0.;
}
knob(&mut c[7], state, "Normalize", &mut settings.normalize, 0. ..=100., d.normalize, " %", 54.,
"How far each note's level is evened out before Drive. 100 %: quiet and loud patches distort the same.");
knob(&mut c[8], state, "Gate", &mut settings.gate, -60. ..=-20., d.gate, " dB", 54.,
"Input level that counts as a note. Raise it if tails retrigger.");
knob(&mut c[9], state, "Output", &mut settings.output, -12. ..=12., d.output, " dB", 54.,
let last = if advanced {
let mut push = settings.push_harmonic as f32;
knob(&mut c[4], state, "Push at", &mut push, 1. ..=16., d.push_harmonic as f32, "", 54.,
"Harmonic number that Push boosts or cuts.");
settings.push_harmonic = push.round().clamp(1., 16.) as u32;
knob(&mut c[5], state, "Floor", &mut settings.floor, 0. ..=2., d.floor, " ×f0", 54.,
"Highpass before the curve at this multiple of the note. 0 is off. Keeps sub mud out of the distortion.");
if settings.floor < 0.25 {
settings.floor = 0.;
}
knob(&mut c[6], state, "Bright", &mut settings.bright, 0. ..=64., d.bright, " ×f0", 54.,
"Lowpass after the curve at this harmonic. 0 is off. The top end stops at the same harmonic on every note.");
if settings.bright < 4. {
settings.bright = 0.;
}
knob(&mut c[7], state, "Normalize", &mut settings.normalize, 0. ..=100., d.normalize, " %", 54.,
"How far each note's level is evened out before Drive. 100 %: quiet and loud patches distort the same.");
knob(&mut c[8], state, "Gate", &mut settings.gate, -60. ..=-20., d.gate, " dB", 54.,
"Input level that counts as a note. Raise it if tails retrigger.");
9
} else {
4
};
knob(&mut c[last], state, "Output", &mut settings.output, -12. ..=12., d.output, " dB", 54.,
"Output trim.");
});
}