Coder Social home page Coder Social logo

beau-seidon / dualshock3_midi_controller Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5.36 MB

ESP32 firmware to convert Dualshock3 bluetooth input to MIDI commands

License: MIT License

C 28.03% C++ 71.97%
dualshock3 midi-controller ps3-controller

dualshock3_midi_controller's Introduction

Dualshock3 MIDI Controller

ESP32 firmware to convert Dualshock3 bluetooth input to MIDI commands


  • The D-Pad and Shape buttons play notes when pressed, and are pressure-sensitive so they also send Aftertouch data.

  • L1 pressure sensor acts as a Note Velocity damper; the unpressed default is full volume, and newly played notes will be quieter as L1 is pressed harder.

  • R1 acts like a sustain pedal; it sends a momentary MIDI CC64 to hold played notes until R1 is released.

  • The L2 and R2 triggers send pitch bend data.

  • The joysticks send data on 4 CC voices, one for each axis of each joystick. The CC numbers are Lx:20, Ly:21, Rx:22, Ry:23.

  • Pressing the joysticks in will transpose the set of notes that the other buttons play. L3 transposes down 1 octove, and R3 transposes up 1 octave. Transpose is disabled while any note buttons are pressed, to avoid stuck notes.

  • The PS button is used as a modifer for other buttons to call secondary functions.

  • With PS held, the D-Pad and Shape buttons will change the button map to different notes corresponding to the selected diatonic scale.

  • With PS held, pressing L1 or R1 will decrease or increase the MIDI channel.

  • With PS held, pressing L3 or R3 will transpose the note button map down or up by 1 semitone.

  • Aftertouch is toggleable between Key, Channel, or None (default) by pressing Select with PS held.

  • Pressing Start with PS held will send a NoteOff message for every note on the active channel, in case any get stuck for some reason.

  • Pressing Start and Select at the same time will reset transpose and scale mapping to default, and turn all notes off.

To pair the PS3 controller to the ESP32, first determine the MAC address associated with the controller by connecting to a PC with a mini-USB cable, and using Sixaxis Pair Tool. Type this MAC address into the Config.h file before compiling in PlatformIO, so the controller will think the ESP32 is the "master" (the PS3 it is be paired with). Alternatively, use the Sixasis Pair Tool to reassociate the controller with the default MAC [1A:2B:3C:01:01:01] already in config.h (note: this will unpair it from any previously associated PS3).

To receive the MIDI output via USB serial, I connect the ESP32 to my PC (no other wires are needed), and use the Hairless Serial-MIDI bridge software, then send it through the loopMIDI virtual input port into my DAW. You could also output MIDI signals from the ESP32 built-in UART, using a DIN or TRS connector via a standard MIDI output buffer circuit, instead of USB into middleware. This would let you plug directly into synths or other hardware.

References:

https://dronebotworkshop.com/ps3-esp32/

Software

https://platformio.org/platformio-ide

https://www.filehorse.com/download-sixaxispairtool/

https://projectgus.github.io/hairless-midiserial/

https://www.tobias-erichsen.de/software/loopmidi.html

Code Libraries

https://github.com/jvpernis/esp32-ps3

https://github.com/FortySevenEffects/arduino_midi_library

MIDI Spec

https://www.midi.org/specifications-old/item/midi-din-electrical-specification

dualshock3_midi_controller's People

Contributors

beau-seidon avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.