MIDI Control Surface with Nano ESP32 S3

Hello everyone,

I'm trying to get familiar with the Nano ESP32 S3 which, according to the compatibility chart, seems fully compatible with the control surface library and supports MIDI-over-USB. See the link: MIDI over USB

Now, I'm starting from basic functions to see how it feels: 1 PBPotentiometer, 1 Note button, 1 encoder.

It wasn't as easy as the Pro Micro, but I managed to upload my sketch:


#include <Control_Surface.h>
#include <Encoder.h>

USBMIDI_Interface midi;

using namespace MIDI_Notes;

//FADERS
PBPotentiometer vol1 {
  2,        // Analog pin connected to potentiometer
  CHANNEL_1, // MIDI Channel 
  };

//BUTTONS
NoteButton button1 = {
   5,
  {note(Ab, -1), CHANNEL_1}, 
};

// ENCODERS
CCRotaryEncoder enc1 = {
  {6, 7},       
  MCU::V_POT_1, 
  1,            // optional multiplier if the control isn't fast enough
};

void setup() {
RelativeCCSender::setMode(relativeCCmode::MACKIE_CONTROL_RELATIVE);
Control_Surface.begin(); 
}

void loop() {
Control_Surface.loop();
}

The note button and encoder seem fine now; the PBPotentiometer works but it is a bit noisy; the library analog filter doesn't seem to improve much.

Do you guys have an idea of what can I do to make it work properly?
Thank you!

Let's ask the author @PieterP

It's best to check the hardware first. Make sure you're using potentiometers with a low enough resistance, short wires, stable supply voltages, etc.

Then try increasing the ANALOG_FILTER_SHIFT_FACTOR and ANALOG_FILTER_TYPE options in ~/Arduino/libraries/Control-Surface/src/AH/Settings/Settings.hpp (e.g. ANALOG_FILTER_SHIFT_FACTOR=4 and ANALOG_FILTER_TYPE=uint32_t).

1 Like

Thanks a lot PieterP!
It worked!