Repository navigation
feat!: add builders, parameter events and Wasm helpers - #72
google-labs-stitch[bot] wants to merge 3 commits into
Conversation
- Add with_* builders and presets to all configuration types. - Add Processor::update_config for validated configuration edits. - Narrow ResynthesisConfig::random_seed from u64 to u32. - Serialize processedFrames as a number in Wasm snapshots. - Add sub-stage controls and ParameterControl to ControlEvent. - Validate timed configuration edits sequentially on the stack. - Unify CorrectionScale and NoteMask with all HarmonyScale modes. - Accept DeepPartial<ProcessorConfig> in Tunelet and updateConfig. - Export noteMaskFromKeyScale and parseMidiBytes from Wasm. - Update the crate documentation, TypeScript exports and README.
- Pass frames and config to ValidatedEvents::new in Processor::validate - Remove the obsolete check_frames helper from WasmProcessor - Update the harmony_gain rustdoc on builders and parameter events
…s-jm0-4b02594b-646f-4bcc-a8c2-edff175223a0
|
Closing as superseded by #122 and #61. In addition to breaking bigint/u64 fields and weakening setConfig() validation, updateConfig() serializes the entire ProcessorConfig to JS, mutates it via Object.entries, and deserializes it back, which is slower than calling config() + setConfig(). This PR also has no CI checks. |
|
Acknowledged: this pull request stays closed because #122 and #61 supersede it. #122 adds typed |
Summary
This change adds fluent builders, stage presets, partial WebAssembly configuration updates, granular parameter events, JSON-safe numeric types, and scale and MIDI helpers across Rust, WebAssembly, and TypeScript.
Changes
Processor::update_config:const fn with_*builders and stage presets to all 11#[non_exhaustive]configuration structures (PrepareConfig,ProcessorConfig,CorrectionConfig,ResynthesisConfig,HarmonyConfig,PitchConfig,FormantConfig,PunchConfig,WarmConfig,AlienConfig, andReverbConfig).Processor::update_configinsrc/processor.rsto edit a stack copy ofProcessorConfigand validate the result before state or drain changes.#[serde(default)]to all 10 WebAssembly*Configstructures and exportDeepPartial<T>fromsrc/wasm.rsandsrc/index.ts.DeepPartial<ProcessorConfig>innew Tunelet(WasmProcessor::new) andTunelet.updateConfig(WasmProcessor::update_config).ResynthesisConfig::random_seedfromu64tou32, serializeFeedback::processed_framesandTelemetry::processed_framesas JavaScriptnumbervalues, and removetsify(large_number_types_as_bigints).Pitch,Correction,Formant,Harmony, andParameter(ParameterControl)variants toControlEventinsrc/events.rs, and re-exportParameterControlfromsrc/lib.rs.ProcessorConfiginValidatedEvents::newbefore frame 0, and apply them inProcessor::applywithout sibling overwrites.CorrectionScalewith all seven modes fromHarmonyScale, implementFrom<HarmonyScale> for CorrectionScale, and addHarmonyScale::note_maskfromSCALE_TONES.noteMaskFromKeyScaleandparseMidiBytesfromsrc/wasm.rsandsrc/index.ts.src/lib.rs,src/index.ts, andREADME.md.Generated crate documentation
Verification
cargo fmt --check,cargo build --locked --release,cargo clippy --locked --lib -- -D warnings,cargo clippy --locked --lib --target wasm32-unknown-unknown --features wasm -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps, andnpm run build.*Configtypes withoutE0639,Processor::update_configrollback on invalid edits, independentControlEvent::Parameteredits in one block with atomic preflight rejection, andHarmonyScale::HarmonicMinorsnapping toB(71.0) in C.DeepPartial<ProcessorConfig>updates innew TuneletandupdateConfig,JSON.stringifycompatibility ondefaultConfig(),config(),feedback(), andtelemetry(),noteMaskFromKeyScale("c", "harmonicMinor"),parseMidiBytes, and identical SHA-256 fixed-point PCM output against baseline renders.Automated PR initiated by user @byteland-app via Stitch Loop.