Hey everyone! ![]()
I’d like to share a small (but super fun) project I’ve been working on called Zynps4.
Zynps4 turns a PlayStation 4 controller (DualShock 4) connected to a Raspberry Pi running Zynthian into a MIDI controller. It can emit MIDI Notes / CC / Pitch Bend over JACK, and it can also send Zynthian CUIA commands over OSC, so you can play instruments and drive the Zynthian UI from the same controller.
Quick disclaimer (vibecode / AI-assisted)
This project was written using a vibecode / AI-assisted workflow.
That means: it works, it’s structured, but I’m also very aware there may be rough edges, missing best practices, or better ways to do certain parts. I’m sharing it openly because I’d love feedback, suggestions, and improvements from people who really know Zynthian/Linux/JACK/MIDI/HID details.
What it does (high-level)
- Reads the DualShock 4 input via HIDAPI and converts raw reports into events:
- buttons, axes, touchpad
- Loads a config (one of 4 modes) and maps controller events into actions:
- MIDI (Note / CC / Pitch Bend) over JACK
- CUIA commands over OSC UDP to Zynthian (port 1370)
- Lets you switch modes live:
- Hold PS + press DPAD direction
- Up → config1 (Mode 1, blue LED)
- Right → config2 (Mode 2, red LED)
- Down → config3 (Mode 3, green LED)
- Left → config4 (Mode 4, yellow LED)
- Hold PS + press DPAD direction
Why I built it
I love the Zynthian ecosystem, but for my live setup I wanted something faster + more tactile than touch navigation and more “muscle-memory friendly” than many MIDI controllers for UI navigation. I already had tons of experience with game controllers… so I went all in on using the DS4 as a “one device controls everything” solution.
What I’d love help with / suggestions welcome 
If anyone here is willing to share advice, I’d really appreciate feedback on:
- Best practices for JACK MIDI port registration on Zynthian
- Improving config ergonomics (validation, comments, friendlier errors, generator tool)
- Adding Bluetooth DS4 report support (USB works, BT differs)
- Expanding CUIA mapping ideas / good default “UI navigation” layouts
- New action types (Program Change, MIDI clock, etc.)
- Any performance / stability improvements (latency, reconnect, edge cases)
If this sounds useful to you and you’d like to test it, critique it, or contribute ideas, please jump in. Even small suggestions (naming, structure, missing CUIA commands, better defaults) are super welcome.