An Arduino-Based MIDI Mouse Controller Mod transforms an old computer mouse (such as a classic PS/2 trackball or optical mouse) into a highly expressive, hardware-based MIDI controller. By routing every physical feature of the mouse to MIDI commands, this modification allows you to play musical notes, adjust pitch, control velocity, and manipulate mod wheels entirely through mouse movements and clicks. đ ī¸ Required Supplies and Components
To successfully complete this mod, you will need the following core hardware and software tools:
Microcontroller: An Arduino Micro, Pro Micro, or Leonardo. These feature native USB capabilities (ATmega32U4 chip), allowing them to act as a native, plug-and-play USB MIDI device.
Input Device: An old computer mouse (PS/2 trackball mice are highly popular for this project).
Wiring: Jumper wires or an adapter to interface the mouse’s internal board (or its PS/2 cable) with the Arduino.
Software Libraries: The MIDIUSB library (by Gary Gwell) available in the Arduino IDE Library Manager. You may also need a PS/2 library if you are tapping into an older mouse connection. đš How the Controls Map to MIDI
The magic of this mod lies in converting geometric mouse navigation and button states into standard MIDI protocol bytes:
X-Axis Movement: Map to MIDI Pitch. Moving the mouse horizontally scales the musical notes up and down.
Y-Axis Movement: Map to MIDI Volume / Velocity. Moving the mouse vertically scales the intensity or loudness of the note played.
Mouse Wheel Scroll: Map to Continuous Controller 1 (CC1), which universally triggers the Mod Wheel effect in software synths.
Mouse Wheel Click: Serves as a mode-toggle switch to change the operational profile of the controller. đšī¸ Operational Modes
Popularized by the DIY community on platforms like Arduino Project Hub, the controller code usually implements two primary play styles:
Glissando Mode: The device functions monophonically (plays one note at a time). Both left and right clicks trigger the same note. Holding down a click and shifting the mouse horizontally results in seamless, sliding note-to-note transitions.
Interval Mode: Left and right mouse clicks trigger distinct musical notes. This allows you to produce polyphonic intervals or chords; you click one button, shift the mouse along the X-axis, and click the other button to play harmony. đ Step-by-Step Implementation Instructions 1. Hardware Integration
If you are modifying a PS/2 mouse, identify the four vital internal lines: VCC (5V), GND, Data, and Clock. Solder these lines directly to your Arduino Micro. Connect VCC to 5V, GND to GND, and Data/Clock to designated digital hardware interrupt pins. 2. Writing the Sketch
Open the Arduino IDE. Install and include the MIDIUSB.h library. Your script will need to continually poll the mouse coordinates and button states. When a state change passes a set threshold, invoke the USB MIDI command function:
void noteOn(byte channel, byte pitch, byte velocity) { midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity}; MidiUSB.sendMIDI(noteOn); } Use code with caution.
Note: Always remember to call MidiUSB.flush(); right after sending a packet to clear the output buffer. 3. DAW Configuration Arduino MIDI Mouse Controller
Leave a Reply