An update on the previous code.
No new concepts, just a smarter way to remap from AI's 1024 to MIDI's 256 steps:
#include <MIDI.h>
//Define Pots
byte pot[] = {0, 0, 0, 0, 0, 0, 0, 0};
byte lastpot[] = {0, 0, 0, 0, 0, 0, 0, 0};
//Define cc number of each pot
byte midi_cc[] = {10, 60, 23, 16, 34, 45, 33, 78};
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
}
void loop()
{
for (byte i = 0; i < 8; i++)
{
pot[i] = analogRead(i) >>3;
if (lastpot[i] != pot[i]) {
MIDI.sendControlChange(midi_cc[i],pot[i],1);
lastpot[i] = pot[i];
}
}
}