midi cv buddy out

midiOutBuddy · output

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. Dropped into a workflow channel lane, CH DEFAULTS to that lane's channel — but it is an INDEPENDENT setting: changing it re-routes the MIDI only, leaving the module in its lane with its clip assignment intact, and the card turns violet with a CH ≠ LANE badge while the two differ (set CH back to the lane's number to follow it again). 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 outpolypolyPitchGategategatepitchcvvelocitycvaudiocvgatepitch
4 inputs · 0 outputs · 0 params

inputs

idcablewhat it does
polypolyPitchGateThe POLYPHONIC note input and the preferred way to drive this module: the 16-lane polyPitchGate cable (a pitch AND a gate per lane) from a POLY clip lane, POLYSEQZ, MIDI LANE or another poly source. Every gated lane becomes its OWN MIDI note, so a 4-note chord column sends four simultaneous Note Ons — each tracked independently, so releasing one voice sends only that voice's Note Off. Velocity for every poly voice comes from the VELOCITY input (the poly cable carries no velocity). While ANY poly lane is gated the mono GATE input below is ignored, so a clip lane that patches both (the standard auto-wiring) never double-triggers.
poly pitch+gate bus; 10-channel poly bus (5 pitch + 5 gate lanes)
gategateThe MONO note trigger, for a one-voice source: 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. Ignored while the POLY input has any gated lane (poly takes precedence).
gate / trigger; gate — acts while the level is high (reacts to both edges)
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)

controls

controlwhat it does
Midi out buddy channel {n}Which MIDI channel the notes are SENT on, 1..16 as every synth prints it on its own front panel. Set it to whatever the instrument on the other end is listening to; a mismatch produces perfect silence with everything else working, which is this module's most common apparent fault. Dropped into a workflow channel lane it DEFAULTS to that lane's number, so the usual case needs no setting at all — and it is an INDEPENDENT key from lane membership, so changing it re-routes the MIDI only and leaves the module in its lane with its clip assignment intact. While the two differ the module says so, and setting it back to the lane's number makes it follow the lane again.
Midi out buddy connect {n}The one-time-per-origin permission gesture. Web MIDI needs the browser's consent before any output port is even visible, so until it is granted this module still watches its inputs and computes notes but has nowhere to send them — it is inert in the way that looks exactly like broken. It reaches the same request every MIDI module in the rack shares, which always yields a nameable outcome: granted, refused, unsupported, or the quiet case where the browser suppressed its own prompt without telling anyone. Once access is granted the dock's device body lists the OUTPUT ports it found and remembers the one you pick, so a reloaded patch re-attaches to the same synth without another click.

source

midi-out-buddy.ts on GitHub.

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