midi cv buddy out

midiOutBuddy · output · schema v1

MIDI CV BUDDY OUT — the output complement of MIDI-CV-BUDDY. Turns the rack's gate / pitch / velocity CV into MIDI notes sent to an external MIDI device, so a sequencer, envelope, or LFO inside the patch can play a hardware synth. A gate rising edge sends NoteOn [0x90|(ch-1), note, vel]; the falling edge sends NoteOff [0x80|(ch-1), note, 0]. The pitch input (V/oct, 0V = C4 = MIDI 60) is quantized to the nearest semitone for the note number, and the velocity input (0..1 CV) maps to MIDI velocity 1..127 — both are sampled at the gate rising edge. The module TRACKS the currently-sounding note so the NoteOff matches the note that was turned on even if pitch drifts while the gate is held. Pick the output device from a dropdown (enumerated from MIDIAccess.outputs; persisted by device name across saves) and the MIDI channel 1..16. Uses the browser's built-in Web MIDI output (no companion app); the user clicks "Connect MIDI…" once per origin to grant access. Device hot-plug is handled, and an all-notes-off plus a matched NoteOff are sent on dispose / device-change / channel-change so external gear is never left with a stuck note. CV is read main-thread via AnalyserNode taps polled on the shared scheduler clock — no AudioWorklet. Terminal MIDI sink (no audio outputs).

The OUTPUT complement of MIDI-CV-BUDDY: it reads gate / pitch / velocity CV from inside the rack and SENDS MIDI notes out to a hardware synth on a chosen device + channel. Mental model: anything in the rack that produces a gate and a pitch — a SEQUENCER, an envelope, an LFO-driven gate — can now play an external instrument. On each rising edge of GATE it sends a MIDI Note On using the pitch + velocity sampled at that instant; on the falling edge it sends Note Off for whatever note it actually started, so a glide under a held gate never strands the wrong note. The output device and MIDI channel are discrete card settings saved in the patch (no audio-side knobs), and Web MIDI permission is requested only when you click Connect. It defends against stuck notes: on dispose and on a device change it sends an all-notes-off plus an explicit Note Off for any tracked note.

the faceplate

midi cv buddy outgategatepitchcvvelocitycvaudiocvgatepitch
3 inputs · 0 outputs · 0 params

inputs

idcablewhat it does
gategateThe note trigger: a rising edge sends a MIDI Note On (sampling PITCH and VELOCITY at that instant), and the following falling edge sends the matching Note Off. Patch a SEQUENCER's gate or an envelope's gate here to drive notes out to the external synth.
gate / trigger
pitchcvThe note pitch as 1V/octave CV (0V = C4 = MIDI 60), quantized to the nearest semitone to pick the MIDI note number. It is sampled at the moment of the gate's rising edge, so the note that gets sent is whatever pitch was present when the gate opened (later drift under a held gate doesn't re-trigger).
control voltage (CV)
velocitycvHow hard to strike the outgoing note, as 0..1 CV mapped to MIDI velocity 1..127 (the floor is clamped to 1 because a Note On with velocity 0 is, by spec, a Note Off). Sampled at the rising edge alongside pitch; leave it unpatched for a default level.
control voltage (CV)

source

midi-out-buddy.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo