Using MIDI Controllers for Video Game Macros
Video game speedrunners frequently push hardware to its limits to execute frame-perfect glitches, and repurposing Musical Instrument Digital Interface (MIDI) controllers has emerged as an effective technique for executing complex input sequences. By routing signals from hardware like DJ pads, keyboards, and foot pedals through software translators, runners can map single presses to intricate macros or rapid keystroke bursts. This setup provides superior tactile feedback, ergonomic precision, and the ability to trigger exact sub-millisecond command sequences that standard computer keyboards and gamepads cannot easily match.
The Hardware Advantage of MIDI Devices
MIDI devices, such as the Novation Launchpad, Akai MPC pads, and electronic foot pedals, are engineered for high-frequency, low-latency live musical performances. Unlike traditional computer keyboards, which suffer from key travel distance, debounce delays, and potential ghosting (where simultaneous keypresses are dropped), MIDI controllers offer several distinct hardware advantages:
- Instantaneous Actuation: Velocity-sensitive silicone pads register contact immediately upon touch, allowing runners to input commands faster than with standard mechanical switches.
- Distinct Physical Layouts: The grid layout of pads allows players to position their hands comfortably, reducing strain during runs that require hundreds of repetitive inputs.
- Foot Pedals: USB expression and sustain pedals allow runners to offload complex inputs or macro triggers to their feet, leaving their hands entirely focused on movement and camera controls.
The Software Translation Pipeline
MIDI devices do not output standard USB Human Interface Device (HID) keyboard or controller signals natively; they transmit MIDI data packets specifying channel, note, velocity, and duration. To make a game recognize these inputs, speedrunners use a software pipeline:
- Hardware Connection: The controller sends a MIDI signal (such as a "Note On" message) via USB.
- Signal Translation: Middleware programs—such as Bome MIDI Translator, MIDI2Key, or custom Python scripts—intercept the raw MIDI event.
- Macro Generation: The translation software matches the incoming MIDI note to a preconfigured rule. This rule translates the single note into a simulated keyboard or controller macro.
- Virtual Driver Emulation: The software uses virtual input drivers (such as vJoy or ViGEmBus) to inject the inputs directly into the operating system at the driver level, ensuring the game reads the inputs with virtually zero processing latency.
How Macros Are Structured and Timed
Once the pipeline is established, speedrunners program specific macro behaviors tailored to the physics and input polling rates of their target games:
- Burst-Fire Mapping: In games requiring maximum inputs per second (such as rapid menuing or jump-canceling), a single pad press can be mapped to toggle inputs on alternating frames (e.g., Input, Wait 1 Frame, Release, Wait 1 Frame).
- Multi-Button Chords: Glitches that require pressing mutually exclusive directions (such as Up + Down simultaneously) or triggering multiple face buttons simultaneously are mapped to a single MIDI pad to guarantee zero latency discrepancy between the inputs.
- Timed Sequences: For frame-perfect tricks that require a delay—such as pausing, waiting three frames, and unpausing—the translator software delays the secondary inputs by exact millisecond intervals tailored to match the game's internal tick rate.
Speedrun Rules and Category Legality
The use of MIDI controllers depends strictly on the rules of the specific speedrunning community:
- 1:1 Remapping Rules: Most major leaderboards on platforms like Speedrun.com mandate a strict 1-to-1 input rule for Real-Time Attack (RTA) categories. In these categories, using a MIDI pad to replace a single button (e.g., using a foot pedal for the spacebar) is legal, but mapping a pad to trigger a sequence of multiple inputs is considered a banned macro.
- Unrestricted and Tool-Assisted Categories: In glitch exhibition runs, Tool-Assisted Speedruns (TAS), or leaderboards with "Arbitrary Code Execution" (ACE) categories, full macro functionality is permitted. In these runs, MIDI devices act as powerful physical consoles to deliver hundreds of precise, pre-programmed commands per second to bend the game's state instantly.