Repository navigation
feat(events)!: add scalar parameter control events - #61
byteland-app merged 6 commits into
Conversation
- Add the ParameterControl enum and ControlEvent::Parameter. - Validate scalar controls with their stage paths and ranges. - Guard unchanged fields in the stage setters. - Mute aspiration with a flag on Formant for each drain call. - Add serde and tsify attributes for the Wasm package. - Document the scalar parameter variants and their ranges.
- Merge the upstream main branch into the feature branch. - Quantize the mono harmony gain in configure_harmony_gain.
- Merge the main branch into the feature branch. - Keep configure_all in Formant::new without a second reset. - Clear aspiration_muted before the dirty check in Formant::reset.
|
Review: Strong implementation of lightweight ParameterControl scalar events, single-source validate_* helpers, stage diff-guards, and drain aspiration_muted. Please rebase onto current main and re-run CI to clear the stuck PENDING check. Target this for the 0.4.0 breaking window (and consider adding #[non_exhaustive] to ControlEvent) so #122 can share the same validate_* helpers and diff-guards. |
- Merge main at 0.3.3 into the scalar parameter control branch. - Add #[non_exhaustive] to ControlEvent for the 0.4.0 release. - Keep the new Punch and Warm fixed-point paths in the narrow setters. - Reset scale_initialized in Resynthesis::set_pitch_ratio. - Decode ParameterControl events with cached keys in src/wasm.rs.
|
Addressed in
|
|
Round 2 review: Approved for the 0.4.0 breaking window — ParameterControl, single-source validate_* helpers, ControlEvent #[non_exhaustive], and full stage diff-guards are solid (and subsume #24). Please rebase onto updated main (after #46, #86, and #135) and coordinate with #122 on validate_in_sequence. |
- Merge main 0.3.4 into this branch. - Update hall allpass diffusion in Reverb::configure_diffusion. - Add validate_chromatic_intervals and validate_diatonic_intervals. - Add ParameterControl::apply_to and validate_in_sequence. - Pass the active ProcessorConfig into ValidatedEvents::new. - Check ParameterControl types and events in verify-pack.mjs.
|
Addressed in
|
|
Round 3 review: Approved for 0.4.0 — 27-variant ParameterControl, shared validate_* helpers, ControlEvent #[non_exhaustive], and stage diff-guards are verified (and subsume #24). Please rebase onto updated main after #20, #45, #107, and #117 (adding humanize/flex_tune validation alignment and any new normalize-jsdoc.mjs mappings). |
- Keep the Stamp helpers and the formant validators in src/formant.rs. - Add Humanize and FlexTune variants to ParameterControl. - Add humanize and flex_tune validators and setters to Resynthesis. - Reset dwell progress in Resynthesis::set_pitch_ratio. - Pass processor settings to decode_events in Wasm Float32 methods. - Normalize parameter JSDoc links in scripts/normalize-jsdoc.mjs. - Document and verify all 29 scalar controls across PCM and Float32.
|
Addressed in
|
Summary
#[non_exhaustive]toControlEventand add the#[non_exhaustive]ParameterControlenum insrc/events.rs, re-export it fromsrc/lib.rs, and addControlEvent::Parameter(ParameterControl)for 29 scalar parameters acrossPunchConfig,WarmConfig,ResynthesisConfig,CorrectionConfig(includingHumanizeandFlexTune),FormantConfig,HarmonyConfig, andReverbConfigfor the0.4.0breaking window.ParameterControlvariant inParameterControl::validate,ControlEvent::validate, and sequential block preflight (ValidatedEvents::new+validate_in_sequence+ParameterControl::apply_to, coordinated with feat!: add partial configuration patches and patch events #122) through sharedvalidate_*helpers before any state or output change, with the exact dotted field path and inclusive range of its stage structure.ControlEvent::ParameterinProcessor::applyto updateself.config, cleardrain_remaining, and call only the setter for the changed field.Punch,Warm,Reverb(includinghall_diffuseinconfigure_diffusionforMediumHallandLargeHall),Formant,HarmonyState, andResynthesis(includingconfigure_correction_decayforretune_msandhumanize,configure_flex_tune, anddwellresets onhumanize == 0.0andpitch_ratiochanges), while constructors initialize all coefficients unconditionally.Resynthesis::apply_configcalls inProcessor::drain_intowith a temporaryaspiration_mutedflag onFormant.cfg_attr(all(feature = "wasm", target_arch = "wasm32"), ...)serdeandtsifyattributes onParameterControl, decode{ type: "parameter", value: { type, value } }with cached keys insrc/wasm.rsinto the reusableTimedEventbuffer across bothInt16ArrayandFloat32methods, normalizeParameterControlJSDoc links inscripts/normalize-jsdoc.mjs, checkParameterControltypes and runtime events inscripts/verify-pack.mjs, and document all 29 variants and ranges in rustdoc,src/wasm.rs, andREADME.md.Verification
cargo build --locked --release,cargo fmt --check,cargo clippy --locked --lib -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps,cargo package --locked,RUSTDOCFLAGS="-D warnings" npm run check:wasm,npm run verify:pack,npm run verify:pack -- --ignore-scripts,.githooks/pre-commit,.githooks/commit-msg, and MSRV1.88(cargo build --locked --lib+--target wasm32-unknown-unknown --features wasm) with zero warnings.f32output,Processor::config,Feedback,Telemetry,ControlActivity,formant_envelope, anddrain*output againstmain(0850e25,0x71ee66cde2fb0796) and across all 29ParameterControlvariants (includingHumanize,FlexTune,MediumHall/LargeHallReverbDiffusion, monoFormant, and MIDIHarmonySourceswitches) in native Rust and WebAssembly (Int16ArrayandFloat32copied + in-place methods) compared to equivalent stageControlEventupdates.ParameterControlcases, multi-eventvalidate_in_sequencesequences, and malformed JavaScript parameter event cases fail before any state, configuration, output buffer, or drain change.Processor::newacross allprocess*,drain*,control_activity, andformant_envelopepaths.dry_mixevents:+59.441 ms(+132.416 mson a 16-voice stereo formant-stretch preset) onmainto+8.480 ms(noise floor-0.720 mson the rich preset) withParameterControl::DryMix.+1359.44 ms(guarded stage events) to+196.44 ms(-85.5%) with cached-keyParameterControldecoding.Automated PR initiated by user @byteland-app via Stitch Loop.