Sending MIDI via PS4 controller using Max hi object

This guide provides instructions on how to create a Max patch using Cycling74’s Max application to interface a PS4 controller with a Digitone FM synthesizer via MIDI CC messages and the hi object. The patch will capture controller inputs, map these to MIDI CC messages, and control the synthesizer parameters in real-time.

Setting Up the PS4 Controller in Max

To start, you’ll need to establish a connection between your PS4 controller and Max. This is done using the hi object, which handles human interface device inputs.


Note: In Max version 8.6.0 Cycling 74 introduced the gamepad object which makes it easier to connect to gamepads. But this version here still uses the hi object, which is still relevant.


Steps:

  • Create a new patcher in Max.
  • Add the hi object to your patch.
  • Click on the hi object to open a dropdown menu and select your PS4 controller from the list of available devices.
  • Confirm the connection by sending a bang to the hi object, which should output the controller’s data stream.

Routing Controller Data

Once the PS4 controller is connected, you need to route the specific button and joystick messages to corresponding actions using the route object.

Steps:

  • Connect the output of the hi object to a route object.
  • Use the route object to filter messages based on specific controller elements (e.g., buttons, joysticks).
  • Each output of the route object should connect to a send object labeled with a meaningful name (e.g., send button1, send axisX).

For example outputs the PS4 controller the number 92 when the SQUARE is pressed. This one is then routed to a send square in my patch.

This sends then goes into a outlet and can be either used from the outlet in the parent patch or the parent patch can use the r square receive object to handle the interaction.

The PS4 sub patch to handle the Controller signals

Sending MIDI to the Synthesizer

Finally, convert the routed controller data into MIDI CC messages to control the Digitone synthesizer.

Yes, in my case I will use the 2018 Elektron synthesizere Digitone.

I will just use the 2 sticks to control some paramters and the 4 main buttons to mute and unmute the tracks T1-T4.

The parent patch sending MIDI to Digitone

Steps:

  • Create ctlout objects to send MIDI control change messages.
  • Use the outputs from your send objects to control the ctlout objects, specifying the channel, controller number, and value parameters.
  • Configure ctlout to match the MIDI CC specifications of your Digitone FM synthesizer for the desired parameters (like filter cutoff, resonance, etc.).

Conclusion

By following these steps, you can use your PS4 controller to interactively control parameters on your Digitone FM synthesizer through Max. Experiment with different controller elements and MIDI mappings to explore new sound design possibilities.

Patch Code

I have uploaded the patch code recently to Github and it is available here.

Max PS4 patch on GitHub


April 1, 2015
🚧 thought drafted
Saturday, May 11, 2024
🌎 published
Friday, May 10, 2024
🔨 last modified
in love with audio & MIDI since 1999