feat: stable note tracking, NOTE pitch source and unsure fallback
Producers found the tracked plugins jumpy: the shared tracker switched notes after 10 ms and retuned every 5 ms, so growls and formant basses flickered and every tracked plugin acted on wrong notes. Shared tracker (common-dsp): - A new note needs a steady read for 40 ms; an octave down 80 ms, an octave up 200 ms (an octave-up read still fits the note's period and counts as agreeing). Inside a note the tuning only moves past a 0.25 semitone deadband. Follow bends keeps the old fast behaviour as an option. - A trust score turns the note unsure while reads disagree; Tracker::active and NoteState report it, and Fallback latches "step back" across note ends. - Notes end when the window start stays below the gate's release level for 20 ms, so short gaps between notes are seen without waiting for the gate. - PitchSource replaces the old (midi, gate, glide) arguments: Audio, MIDI or Note mode (a set note, no detection), plus a key lock (minor, major, root only) that snaps reads to the key. - stems.rs: synthetic stems (growls, wobble, reese, formant, 808 slide, layered drop, noise riser) and a score; examples/tracker_report scores the corpus or real WAV stems. On the corpus the old behaviour makes up to 28 extra note starts per second; the stable default makes none. Plugins: - Anvil, Lathe, Temper, Knurl, Planish, Braze and Forge gain the NOTE pitch source, the key lock and Follow bends (shared common-params crate and a shared header switch in common-ui). - Unsure tracking: Anvil brings the original sub back in place of the sine, Lathe passes the audio through, Knurl fades its texture out; Temper, Planish and Braze hold their last sure tuning. Readouts show the note only when it is sure. - Anvil gains Mode: Replace or Enhance (keeps the original sub and adds the sine under it). - Planish slides its band edges over 6 ms on a new note instead of snapping. - Ballast defaults to Grid parts, which need no tracking.
This commit is contained in:
1 parent
7c873f2bd0
commit
adfb2c0287
66 files changed
+2246
-261
No files matched your search
@@ -11,7 +11,7 @@
|
||||
mod settings;
|
||||
use common_dsp::loudness::{lufs, KWeighting};
|
||||
use common_dsp::svf::{Svf, SvfCoef};
|
||||
use common_dsp::tracker::{NoteEvent, Tracker, TrackerConfig};
|
||||
use common_dsp::tracker::{NoteEvent, PitchMode, PitchSource, Tracker, TrackerConfig};
|
||||
use common_dsp::{coefficient, db_to_gain, gain_to_db};
|
||||
pub use settings::{
|
||||
Grid, Segment, Settings, Source, FROM_MAX, FROM_MIN, RANGE_MAX, TARGET_MAX, TARGET_MIN,
|
||||
@@ -216,7 +216,15 @@ impl Engine {
|
||||
}
|
||||
pub fn set_settings(&mut self, s: Settings) -> Result<(), &'static str> {
|
||||
s.validate()?;
|
||||
self.tracker.set(s.source == Source::Midi, s.gate, false);
|
||||
self.tracker.set(PitchSource {
|
||||
mode: if s.source == Source::Midi {
|
||||
PitchMode::Midi
|
||||
} else {
|
||||
PitchMode::Audio
|
||||
},
|
||||
gate_db: s.gate,
|
||||
..PitchSource::default()
|
||||
});
|
||||
if s.from != self.settings.from || self.fresh {
|
||||
self.from_coef = if s.from > FROM_MIN {
|
||||
SvfCoef::highpass(self.rate, s.from, Q)
|
||||
|
||||
@@ -22,9 +22,10 @@ pub enum Source {
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||
pub enum Segment {
|
||||
/// Every note start.
|
||||
#[default]
|
||||
Notes,
|
||||
/// Every line of the host's beat grid, so a patch change on the same note counts too.
|
||||
/// The default: a switch-up lands on the grid, and the grid needs no note tracking.
|
||||
#[default]
|
||||
Grid,
|
||||
}
|
||||
|
||||
@@ -91,7 +92,7 @@ impl Default for Settings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
source: Source::Audio,
|
||||
segment: Segment::Notes,
|
||||
segment: Segment::Grid,
|
||||
grid: Grid::Quarter,
|
||||
target: -14.,
|
||||
amount: 100.,
|
||||
|
||||
@@ -117,6 +117,7 @@ fn note_starts_from_the_audio_cut_the_parts() {
|
||||
let mut e = Engine::new(RATE, 2).unwrap();
|
||||
e.set_settings(Settings {
|
||||
target,
|
||||
segment: Segment::Notes,
|
||||
..Settings::default()
|
||||
})
|
||||
.unwrap();
|
||||
@@ -151,6 +152,7 @@ fn midi_note_starts_cut_legato_parts() {
|
||||
e.set_settings(Settings {
|
||||
target,
|
||||
source: Source::Midi,
|
||||
segment: Segment::Notes,
|
||||
..Settings::default()
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
Generated
+4
@@ -340,11 +340,15 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "common-dsp"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "common-ui"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"common-dsp",
|
||||
"egui",
|
||||
]
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ impl Default for BallastParams {
|
||||
Self {
|
||||
editor: EguiState::from_size(ballast_ui::WIDTH, ballast_ui::HEIGHT),
|
||||
source: EnumParam::new("Note source", SourceParam::Audio),
|
||||
segment: EnumParam::new("Parts from", SegmentParam::Notes),
|
||||
segment: EnumParam::new("Parts from", SegmentParam::Grid),
|
||||
grid: EnumParam::new("Grid", grid_param(d.grid)),
|
||||
target: linear("Target", d.target, TARGET_MIN, TARGET_MAX, " LUFS"),
|
||||
amount: linear("Amount", d.amount, 0., 100., " %"),
|
||||
|
||||
Reference in new issue
Block a user