Hello, I'm making a full functional MIDI controller with my Arduino Mega, I'm using my keyboard of 61 keys, 52 keys will be connected to the pins from 2 to 53, the other 9 will be connecte to pins A0 to A8. The keys are simple push buttons. I was using the code from this video:
But I couldn't change it in order to work the analog pins, so, I decided to do a research and I ended up with a library called Control Surface, it's quite simple and intuitive!
The problem is that with this code I recive this in my Serial-MIDI program:
With the code of the video I recived the note in channel 1 and with the velocity value:
I need to make this code work like the last photo in order to send the notes:
#include <Control_Surface.h> // Include the Control Surface library
#include <MIDI_Interfaces/SerialMIDI_Interface.hpp>
// Instantiate a MIDI over USB interface.
HairlessMIDI_Interface midi;
// Instantiate a CCButton object
CCButton button {A1, {MIDI_CC::General_Purpose_Controller_1, CHANNEL_1},};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}