Repository navigation
feat(midi)!: add MIDI keybed, channel map and latch - #69
google-labs-stitch[bot] wants to merge 8 commits into
Conversation
- Set SmartInterval as the default harmony source with two voices - Set musical default intervals for diatonic and chromatic harmony - Record all 16 MIDI channels and 128 notes in a fixed-size keybed - Project held keybed notes across live MIDI source transitions - Add MidiChannelMap and midi_base_channel with legato note fallback - Add ignored_midi_events and correction_midi_active to Telemetry - Use a u128 bitmask for correction MIDI notes 0..=127 - Add CorrectionMidiMode with Momentary and Latch scale control - Export the new types and optional fields to WebAssembly and README
…-jm0-1541bed2-9af0-43cf-af10-a10baceebf89
…-jm0-1541bed2-9af0-43cf-af10-a10baceebf89
|
Review: The u128 128-key CorrectionTable, Momentary/Latch correction MIDI modes, and cross-mode keybed reprojection are very useful. However, this PR needs splitting and rework:
|
…-jm0-1541bed2-9af0-43cf-af10-a10baceebf89
- Keep HarmonyConfig::default() and default_voices() at four voices. - Remove ignored_midi_events and correction_midi_active from Telemetry. - Set MidiChannelMap::BaseWindow with base channel 0 as the default. - Store MidiKeybed velocity and u32 order tables on the heap. - Compact held note orders at u32::MAX. - Accumulate rolled chords in CorrectionMidiMode::Latch. - Update the rustdoc and README.md for the default settings.
|
Thanks for the review! Merged
|
|
Round 2 review: Thank you for restoring the defaults, boxing u32 keybed tables, defaulting to BaseWindow, and removing breaking Telemetry fields. Because #46 is landing as the clean 0.3.x MIDI bug fix, please rebase onto updated main after #46 and #123 and address three remaining items:
|
- Merge main v0.3.4 into the MIDI keybed branch. - Mark MidiChannelMap and CorrectionMidiMode as #[non_exhaustive]. - Return true on Note Off for active MidiChannels channels. - Decode undefined optional MIDI fields to their defaults in Wasm. BREAKING CHANGE: Source changes keep held notes in the MIDI keybed.
|
Thanks for the Round 2 review! Synced onto updated
|
- Merge main into the feature branch and resolve conflicts. - Keep humanize dwell across latched correction Note Off events. - Normalize the new MIDI rustdoc links in scripts/normalize-jsdoc.mjs. - Check absent and undefined MIDI fields in scripts/verify-pack.mjs.
|
Review:
|
…-jm0-1541bed2-9af0-43cf-af10-a10baceebf89 - Resolve merge conflicts with scalar parameters and Wasm checks. - Add harmony MIDI channel map flags to ControlActivity. - Narrow HarmonyState::apply_config to skip extra chord setup. - Update Rustdoc, README and pack verification for ControlActivity.
|
Thanks for the review! Synced onto updated
|
Summary
0.4.0Window (feat(midi)!) & Synced ontomain(8880205): Preserve held 16-channel keybed notes acrossHarmonySourceswitches and releaseMidiOmninotes per channel rather than across all channels, while keepingHarmonyConfig::default()(MidiChannels,voices = 4, unison[0; 4]intervals,BaseWindow,midi_base_channel = 0),#104Telemetry, and#61ParameterControl/ stage diff-guards intact.MidiKeybed& Narrowed Live Re-projection: Record every validatedControlEvent::Midimessage inMidiKeybed(held: [u128; 16]inline, withvelocity: Box<[[u8; 128]; 16]>andorder: Box<[[u32; 128]; 16]>allocated directly on the heap and compacted atu32::MAX, keeping inlineMidiKeybedat 280 bytes and zero post-construction allocations). Re-project held notes across live transitions amongMidiOmni,ChordViaMidi, andMidiChannels(and active channel-map changes), while narrowingHarmonyState::apply_configso edits only tomidi_channel_mapormidi_base_channelskipsetup_chord()and inactive channel-map edits make zero state or sample changes.#[non_exhaustive]MidiChannelMap,ControlActivityFlags & ImmediateMidiChannelsNoteOff(#46{Alignment): Add#[non_exhaustive]MidiChannelMap(#[default] BaseWindow,WrapFour) andmidi_base_channel(0..=12, default0) toHarmonyConfigwithserde(default, deserialize_with = ...)andtsify(optional, type = "... | undefined")so both omitted andundefinedvalues decode to defaults underexactOptionalPropertyTypes. Exposeharmony_midi_channel_mapandharmony_midi_base_channelonControlActivity(harmonyMidiChannelMapandharmonyMidiBaseChannelin TypeScript). Returncontrol_due = trueonNoteOfffor mappedMidiChannelsvoices so voice release starts on frame 1 instead of waiting up to 99 frames.CorrectionTable&#[non_exhaustive]CorrectionMidiMode: Replace the boolean keyboard array inCorrectionTablewithu128bitmasks covering notes0..=127(127 -> PitchClass::G). Add#[non_exhaustive]CorrectionMidiMode(#[default] Momentary,Latch) toCorrectionConfig(serde(default, deserialize_with = ...),tsify(optional, type = "CorrectionMidiMode | undefined")), restoringCorrectionConfig::noteson full key release inMomentarymode, retaining simultaneous or rolled chords across key release inLatchmode untilMidiEvent::AllNotesOff,Processor::reset(), or scale/mode updates, and preservinghumanizedwell across latchedNoteOffevents.MidiChannelMapandCorrectionMidiModeinsrc/lib.rsand TypeScript declarations, and update rustdoc, normalized JSDoc,scripts/verify-pack.mjs, andREADME.mdin ASD-STE100 Simplified Technical English.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:pack&npm run verify:pack -- --ignore-scriptsProcessorConfig::default()(Choir) PCM output andTelemetryslices withParameterControlat44.1 kHzand48 kHzagainstmain(8880205),0post-construction heap allocations, external-crate#[non_exhaustive]enforcement onMidiChannelMapandCorrectionMidiMode,ControlActivityflags (harmony_midi_channel_map,harmony_midi_base_channel) and zero-sample-change contract when inactive, narrowedHarmonyState::apply_configskippingsetup_chord()on channel-map edits, frame-1MidiChannelsNoteOffrelease, liveMidiOmni/ChordViaMidi/MidiChannelskeybed re-projection (0 / 4stuck voices),WrapFour0..=15folding + 128-note legato fallback,BaseWindow0..=12validation, andMomentary/Latchscale control across notes0..=127.Automated PR initiated by user @byteland-app via Stitch Loop.