Control Surface
1.2.0
MIDI Control Surface library for Arduino
|
This example demonstrates how to use the AppleMIDI library to use Control Surface over the network.
This example requires the AppleMIDI and MIDI libraries.
The on-board LED will be used, as well as the push button on GPIO0. These should be present on most ESP32 boards, if this is not the case for your board, connect an LED (+ series resistor) and a push button to the relevant pins (in the "MIDI Elements" section below). For more details, see the NoteButton.ino and 1.Note-LED.ino examples.
Open the tab WiFi-Credentials.example.h
, enter your WiFi credentials, and rename the file to WiFi-Credentials.h
.
Upload the code to the ESP32, and open the Serial monitor. You should see output like this
Next, connect to the device using your DAW or other MIDI software. If the software supports mDNS (Apple Bonjour), you can use ESP32.local
, otherwise, you'll have to use the IP address.
When the connection is successful, you'll see the following message in the Serial monitor:
When the button is pushed, a MIDI note on message for note C4 (middle C) is sent.
When the ESP32 receives a MIDI note message for that note, it turn on/off the LED accordingly.
If you're on Linux, you can use the rtpmidi-bridge application in the example folder. You'll need to install Node.js and NPM.
First, install the necessary dependencies and build tools:
Then install the dependencies using NPM:
You might get a compilation error for the avahi_pub
module. This is not an issue, it's an optional dependency of the rtpmidi
module.
Finally, run the application:
The application will initiate a RTP MIDI connection with the ESP32, create virtual MIDI ports, and bridge the MIDI traffic between the RTP MIDI connection and the virtual MIDI ports.
You can then connect your DAW or other MIDI application to the virtual MIDI ports.
When the ESP32 is connected, you should see the following in the serial monitor and the rtpmidi-bridge output respectively:
Connect the virtual MIDI ports or the AppleMIDI connection to a device or application that can send and receive MIDI notes.
Written by PieterP, 2020-05-06
https://github.com/tttapa/Control-Surface