A game controller gives you several ways to shape a phrase without moving your hands: buttons for attacks, a directional pad for choices, sticks for continuous movement and triggers you can squeeze. A small musical app can give each gesture a clear role. Four buttons can play four tones while a trigger swells the sound and a thumb changes the next chord.
The interesting decision is what the player controls. Direct pitch is one choice. Chord tones, rhythmic cells, movement through a sound field and transitions between sections can make equally good instruments. Existing music software and games offer useful examples of each approach.
For a hands-on start, follow Play music with a game controller. Open Gamepad Chords to play progressions, or Controller MIDI to edit notes, CC and bend assignments in your browser. The first makes sound; the second sends MIDI to an instrument you choose. The walkthrough covers connection, a first phrase, a trigger-controlled filter and what the event inspector can tell you.
There is already good work to learn from
Sidebrain's Gamepad Control maps game controllers into Ableton Live through Max for Live. Its controller illustrations, input mapping, stick response controls and musical functions show how much of this experience depends on making gestures understandable. It is worth trying an existing tool before writing another general-purpose gamepad-to-MIDI bridge.
Cycling '74's gamepad object supplies mapped buttons, sticks, triggers and supported sensors through SDL2, with commands for optional vibration and LEDs. TouchOSC takes a related approach: gamepad input can change a control's value or property after scaling. Its gamepad messages are input-only, so it should not be mistaken for a general haptic-output interface.
These tools suggest a useful division. One layer understands the controller. A second turns its gestures into musical actions. The interface explains those actions to the player. You can change the instrument without rewriting how an Xbox or PlayStation controller is read.
Four games, four musical relationships
Games make especially good references when sound changes what the player does.
| Example | How sound participates | An idea to try in a music app |
|---|---|---|
| Sound Shapes | Collecting notes constructs the music; creatures and interactive objects also act as instruments. | Let movement add or remove musical parts. The player can explore an arrangement instead of entering every note. |
| Crypt of the NecroDancer | Movement and combat follow the beat, with keyboard, controller and dance-pad input. | Offer a rhythm-constrained mode in which gestures choose an action and the musical clock determines when it happens. |
| Rez Infinite | Its PS VR2 version pairs pulsing rhythms with controller and headset haptics. | Use a short, optional tactile cue to acknowledge an important event, alongside visible feedback. |
| One Hand Clapping | Singing or humming into a microphone solves puzzles. | Consider musical sound itself as an input, with a gamepad choosing the next task or phrase. |
Those are different relationships. Following a beat, constructing an arrangement, feeling a pulse and measuring a sung note call for different controls. The app ideas in the final column are design suggestions, rather than features those games promise. One Hand Clapping also illustrates an audio-input mechanic; a gamepad alone does not provide its vocal interaction.
Give each gesture one clear job
For a first chord instrument, try this assignment:
- D-pad directions select Cmaj7, Am7, Fmaj7 and G7.
- The four face buttons play the selected chord's root, third, fifth and seventh.
- The left trigger sets the velocity of the next note.
- The right trigger changes the level of notes already sounding.
- The left stick bends pitch a little in either direction.
Velocity and expression feel different. Velocity belongs to the attack: squeeze, press, and hear the onset change. Expression changes the held sound. Keeping both makes the controller more expressive than a collection of on/off shortcuts.
Keep a held tone at its original pitch when the chord selection changes, then use the new chord on the next press. That makes the release predictable and lets the player carry a common tone across a progression. A different instrument could deliberately retune held notes, but that choice needs an audible transition and a clear explanation.
Turn the mapping into a practice game
Gamepad Chords uses that mapping to explore a progression. Choose a diatonic major/minor exercise, or a chord sheet with secondary dominants, borrowed chords or chromatic movement. Change the tonic, inversion and register to hear how the same progression behaves in a different voicing. Play each chord’s four tones and move to the next step with the right bumper. Visible tone coverage and a round counter give the player a small goal while leaving room to listen. This exercise counts exploration in order; it does not grade timing or a performance on another instrument.
Give a center button a useful surprise: Options or Menu shuffles a different four-chord progression in the selected scale, or rearranges the selected chord sheet while preserving its qualities. Roman numerals, Nashville numbers, chord symbols and note names describe the same voicing. A static four-column piano roll shows pitch movement, and a keyboard highlights the exact held pitches. Keep step changes gentle by letting held notes finish at their original pitches. Shuffling or changing key releases them before the new set takes over.
The musical ingredients are reusable. Symbolic can generate a repeatable progression and turn chord symbols into playable pitches. When adapting the example with an agent, describe the musical exercise first:
Make a gentle chord-practice instrument for my controller. Let me choose a four-chord progression, play its four voices with the face buttons, and shape held notes with a trigger. Show the sounding pitches on a piano. Keep held notes at their original pitches when I change chords. Explain the controller mapping before changing it.
Then judge one short phrase. If the first inversion makes the button roles confusing, a useful follow-up is: “Label each pad with its actual pitch and chord role, and keep the piano highlight visible until I release the note.” These are example briefs for your own variation, not a promise that an untested prompt produces a finished instrument.
A gamepad, a row of MIDI pads or an on-screen interface can select an exercise step and its tone index. Keep controller values separate from those musical actions so the same practice idea works with another input device. Use the Symbolic library guide for the musical structures and the controller guide below for input and MIDI conversion.
Keep the connection separate from the music
The browser's Gamepad API can read a paired controller directly. A chord app turns that input into its own notes and expression. If your destination is a DAW instrument, a local relay can instead convert those gestures into MIDI and provide an input port for the DAW. Choose a controller connection explains that route, including standalone and AU/VST receivers.
MIDI carries musical instructions such as a note or CC value; it does not preserve the original controller diagram or provide a general return path for vibration. Check input and feedback separately, and select one route so a direct connection and a relay do not play each press twice.
For your agent, the controller SDK guide documents
maruaudio/controllers, the host's shared face.controllers service and ordered
musical input. The host owns connection and device selection; the module owns
what each gesture does. Use a source SDK build that includes those exports.
Prefer names such as south, east and leftTrigger in the mapping. The interface can show Cross or A for the south button after recognizing a controller family. The browser's standard mapping, rather than a recognizable product name, establishes what an index means. An unknown layout should remain visible for diagnosis until it has a measured mapping.
Make debugging part of the instrument
Before drawing an elaborate controller, show which device is selected, whether its mapping is supported and the values it sends. Check a face-button press and release, move both sticks through their centers and squeeze both triggers gradually. A trigger value such as 0.37 should survive the journey into the musical mapping.
Then test the interruptions. Hold a note and unplug the controller. Change the selected device. Hide the page. Every owned note must be released, and returning to the app should require a fresh press. A beautiful diagram cannot compensate for a note that stays on.
Feedback deserves the same care. A short vibration can confirm a chord change, but make it optional and offer a stop action. Read the host's feedback capability and result instead of assuming every connected controller can vibrate. Progressive trigger input measures how far the trigger travels; adaptive trigger resistance is a separate, device-specific output feature.
For a useful first experiment, play the same four-button phrase twice. First use fixed velocity and level. Then keep the notes unchanged and shape the second phrase with both triggers. That comparison tells you whether the controller is helping the player articulate music before you add more mappings, layers or artwork.




