Repository navigation
feat(midi)!: add pitch bend and sustain support - #56
Open
google-labs-stitch[bot] wants to merge 6 commits into
Open
google-labs-stitch[bot] wants to merge 6 commits into
google-labs-stitch[bot] wants to merge 6 commits into
Conversation
- Add PitchBend and SustainPedal variants and byte decode to MIDI - Validate MIDI channel and 14-bit pitch-bend value ranges - Add pitch_bend_semitones to HarmonyConfig and CorrectionConfig - Apply Q14 pitch-bend ratios and sustain latches to harmony - Apply Q14 pitch-bend ratios and sustain latches to pitch correction - Clear sustain and pitch-bend state on All Notes Off and on reset - Document the new MIDI controls and bend ranges in the README
- Resolve the conflict in src/harmony.rs - Iterate pending_order with enumerate in HarmonyState::resume_pending
Contributor
|
Review: Well-implemented 14-bit Pitch Bend and Sustain Pedal support across HarmonyState and CorrectionTable. Please update for the 0.4.0 breaking window:
|
- Mark MidiEvent as non-exhaustive for future MIDI controls. - Narrow the chord setup guard in HarmonyState::apply_config. - Decode pitchBend and sustainPedal in the Wasm event decoder. - Merge the upstream main branch at 0.3.3.
Contributor
Author
|
Addressed in
|
- Merge the upstream main branch at 0.3.4. - Decode undefined pitchBendSemitones values to 2 in Wasm. - Add harmony_pitch_bend_semitones to ControlActivity. - Align correction sustain and reset with keys 0..=127 and notes. - Return true on sustain release for channels 0..=3 in MidiChannels.
Contributor
- Merge the humanize, flex-tune, Float32 and JSDoc changes from main. - Keep humanize and flex_tune with pitch_bend_semitones in correction. - Reset correction dwell only when correction MIDI reloads the table. - Normalize the MIDI and pitch-bend rustdoc links for TypeScript JSDoc. - Check undefined and omitted pitchBendSemitones in verify-pack.mjs.
Contributor
Author
|
Synced with updated
|
Contributor
|
Review: 14-bit Pitch Bend, Sustain Pedal,
|
- Merge main (8880205) with ParameterControl and Telemetry updates. - Return false on sustained NoteOff in CorrectionTable to keep dwell. - Check pitchBend and sustainPedal in processMono in verify-pack.mjs.
Contributor
Author
|
Addressed in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds 14-bit MIDI Pitch Bend (
0xE0) and Sustain Pedal (CC 64) support across the Rust, WebAssembly and TypeScript APIs.MidiEventas#[non_exhaustive]and addPitchBend { channel: u8, value: i16 }(-8192..=8191) andSustainPedal { channel: u8, held: bool }with camelCasetsifytags, byte decode inMidiEvent::from_bytes, range checks inMidiEvent::validateand Wasm event decode indecode_midi_event.pitch_bend_semitones: f32(0.0..=24.0, default2.0, optional orundefinedin JavaScript) toHarmonyConfigandCorrectionConfig, validate both fields before any state change and addharmony_pitch_bend_semitonestoControlActivity.setup_chord()guard inHarmonyState::apply_configto the chord voice fields so a change topitch_bend_semitonesalone does not calculate chords again.Q14pitch-bend ratios toHarmonyStateandCorrectionTable.pending_orderforMidiOmniandChordViaMidi, release unheld notes on pedal release, support keys0..=127with configurednotesreload inCorrectionTable, preservescale_initializedandhumanizedwellon sustainedNoteOff(resettingdwellonly when correction MIDI reloads the note table) and clear sustain and pitch-bend state onAllNotesOffandreset.Q14bend ratio differs fromQ14::ONE, so default PCM output stays identical.pitchBendSemitonesrustdoc links inscripts/normalize-jsdoc.mjs, checkundefinedand omittedpitchBendSemitonesplusprocessMonopitchBendandsustainPedalevents inscripts/verify-pack.mjs, and document the new MIDI variants andpitchBendSemitonesranges insrc/wasm.rsandREADME.md.Verification
cargo rustc --locked --lib --release -- -D warningscargo fmt --checkcargo clippy --locked --lib -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-depscargo package --lockednpm run check:wasmnpm run verify:packnpm run verify:pack -- --ignore-scriptsmain(8880205) includinghumanize,flex_tuneandParameterControl(81,920bytes, SHA-2567c254a23a2d369d2ec207dcf1794342e6d4ec21374fd6f84c4b6f71c5a243c37), bit-for-bithumanizedwellpreservation on sustainedNoteOff, plus Rust and Node.js WebAssembly checks (Int16ArrayandFloat32in-place views) for#[non_exhaustive],ControlActivity, pitch bend, sustain latches, voice theft, key127and preflight validation.Automated PR initiated by user @byteland-app via Stitch Loop.