Hi, I'm making a full functional keyboard MIDI controller with Arduino Mega, the Control Surface library and my 61 keys keyboard. I have this code, with it, I can have all the keys with a pin of Arduino, but I want to control the "velocity" of the keys with a potentiometer.
I want to add a potentiometer that control the x value of the velocity of all keys, this way, if I want to play something soft, I reduce the value with the potentiometer (this is diferent of the volume).
How can I make that?
#include <Control_Surface.h> // Include the Control Surface library
#include <MIDI_Interfaces/SerialMIDI_Interface.hpp>
HairlessMIDI_Interface midi;
byte x = 100;
NoteButton C1 {2, {MIDI_Notes::C (2), CHANNEL_1},x};
NoteButton Db1{3, {MIDI_Notes::Db(2), CHANNEL_1},x};
NoteButton D1 {4, {MIDI_Notes::D (2), CHANNEL_1},x};
NoteButton Eb1{5, {MIDI_Notes::Eb(2), CHANNEL_1},x};
NoteButton E1 {6, {MIDI_Notes::E (2), CHANNEL_1},x};
NoteButton F1 {7, {MIDI_Notes::F_(2), CHANNEL_1},x};
NoteButton Gb1{8, {MIDI_Notes::Gb(2), CHANNEL_1},x};
NoteButton G1 {A1, {MIDI_Notes::G (2), CHANNEL_1},x};
NoteButton Ab1{A2, {MIDI_Notes::Ab(2), CHANNEL_1},x};
NoteButton As1{A3, {MIDI_Notes::A (2), CHANNEL_1},x};
NoteButton Bb1{A4, {MIDI_Notes::Bb(2), CHANNEL_1},x};
NoteButton Bs1{A5, {MIDI_Notes::B (2), CHANNEL_1},x};
void setup() {
Control_Surface.begin(); } // Initialize Control Surface
void loop() {
Control_Surface.loop(); } // Update the Control Surface
In this code I only have 12 notes, but in my complete code I have all the 61.