I was wondering from the midi example that is available on Arduino Software
if its possible to send MIDI like that but with a potentiometer controlling both
Note and Velocity with different potentiometer's with serial.write
If there are examples available or someone that did something close to this
i would really appreciate your tips and solutions.
Hi i'm also trying to build up a controller with 8 pots using an arduino 2009 and a IC 4051 for multiplexing, i'm following this tutorial from littlescale
don't know why (maybe the pots) for me this circuit don't go. After that I've tested another circuit and code here it is
With that code and circuit I can hook up 6 pots (or analog sensor) and read their value, no latency, great response etc...
the problem is the mapping, when you select your parameter e.g. in ableton, until they are two it works than everything start flickering and its hard to get the solution....
// Variables:
int cc = 0;
int AnalogValue = 0; // define variables for the controller data
int lastAnalogValue = 0; // define the "lastValue" variables
void setup() {
// launch MIDI
MIDI.begin(4)
}
void loop() {
AnalogValue = analogRead(0);
// convert to a range from 0 to 127:
cc = AnalogValue/8;
// check if analog input has changed
if (lastAnalogValue != cc) {
MIDI.sendControlChange(16,cc,1);
// update lastAnalogValue variable
lastAnalogValue = cc;
AnalogValue = analogRead(1);
// convert to a range from 0 to 127:
cc = AnalogValue/8;
// check if analog input has changed
if (lastAnalogValue != cc) {
MIDI.sendControlChange(17,cc,1);
// update lastAnalogValue variable
lastAnalogValue = cc;
} // endif
AnalogValue = analogRead(2);
// convert to a range from 0 to 127:
cc = AnalogValue/8;
// check if analog input has changed
if (lastAnalogValue != cc) {
MIDI.sendControlChange(18,cc,1);
// update lastAnalogValue variable
lastAnalogValue = cc;
} // endif
}
I'm not a programmer, i'm not an electronic guru, i'm just a poor musician with a few of nerd skills
if (filter[i] != data_send){ //if filter and data_send not equal then in theory this will only send midi data when a value is changes an not constantly.
Should be changed to:-
if (abs(filter[i] - data_send) > 1){ //if filter and data_send not equal then in theory this will only send midi data when a value is changes an not constantly.
This will allow a little bit of noise without constantly resending the MIDI
On that code you just posted you need a different variable for each analogue channel for both the value and the last value. As it is you are using the last value from the previous channel reading which is not going to work. While the code is rubbish change it to
AnalogValue0 = analogRead(0);
// convert to a range from 0 to 127:
cc = AnalogValue0/8;
// check if analog input has changed
if (abs(lastAnalogValue0 - cc)>1 {
MIDI.sendControlChange(16,cc,1);
// update lastAnalogValue zero variable
lastAnalogValue0 = cc;
AnalogValue1 = analogRead(1);
// convert to a range from 0 to 127:
cc = AnalogValue1/8;
// check if analog input has changed
if (abs(lastAnalogValue1 - cc)>1 {
MIDI.sendControlChange(16,cc,1);
// update lastAnalogValue one variable
lastAnalogValue1 = cc;
// and so on