Hi there
Problem
I am trying to build a 5 potentiometer midi controller using a Arduino pro micro in order to use "MIDImixer" instead of "Deej" to control Window's volume mixer, but having some issues due to my lack of understanding on how to modify an existing code to suit my build.
Reference:
The project originates from Adam Welch's youtube build ( deej - Arduino Volume Mixer )
Video link:
https://www.youtube.com/watch?v=9WqwH4tebzI&ab_channel=AdamWelch
He uses an Arduino Nano. I did try one, but the nano board i have doesn't seem to respond when checking the serial monitor and turning the pots. Bought it from Aliexpress and wondering if it is a dudd, perhaps a Pro Micro could do the job instead...
Question:
- Would it be possible to modify the code to work with a ProMicro instead?
- If yes, would anyone from this forum be able to help me navigate this change in code, please?
Libraries i have installed:
#include <MIDI_Controller.h>
#include <MIDIUSB.h>
#include <MIDIUSB_Defs.h>
#include <frequencyToNote.h>
#include <pitchToFrequency.h>
#include <pitchToNote.h>
Adam's code used from the Deej Github
const int NUM_SLIDERS = 5;
const int analogInputs[NUM_SLIDERS] = {A0, A1, A2, A3, A4};
int analogSliderValues[NUM_SLIDERS];
void setup() {
for (int i = 0; i < NUM_SLIDERS; i++) {
pinMode(analogInputs[i], INPUT);
}
Serial.begin(9600);
}
void loop() {
updateSliderValues();
sendSliderValues(); // Actually send data (all the time)
// printSliderValues(); // For debug
delay(10);
}
void updateSliderValues() {
for (int i = 0; i < NUM_SLIDERS; i++) {
analogSliderValues[i] = analogRead(analogInputs[i]);
}
}
void sendSliderValues() {
String builtString = String("");
for (int i = 0; i < NUM_SLIDERS; i++) {
builtString += String((int)analogSliderValues[i]);
if (i < NUM_SLIDERS - 1) {
builtString += String("|");
}
}
Serial.println(builtString);
}
void printSliderValues() {
for (int i = 0; i < NUM_SLIDERS; i++) {
String printedString = String("Slider #") + String(i + 1) + String(": ") + String(analogSliderValues[i]) + String(" mV");
Serial.write(printedString.c_str());
if (i < NUM_SLIDERS - 1) {
Serial.write(" | ");
} else {
Serial.write("\n");
}
}
}
Picture of my build:
Wiring:
A0 - Pot 1 - Brown
A1 - Pot 2 - Red
A2 - Pot 3 - Orange
A3 - Pot 4 - Yellow
A9 - Pot 5 - Green
Gnd - White
VCC (5V) - Orange 2
Conclusion:
Not sure how difficult this request is, I have tried using Nerd Musician's midi controller guide but the codes he uses and guide confuses the hell out of me at this stage of my learning.
Any help would be much appreciated.
TIA!