Making MIDI Controller consisting of 25 potentiometers & 33 buttons

Hello Everyone,
I'm a beginner and new to Arduino Programming.
So,firstly I will describe the whole project in short and later discuss the issues I'm facing.
I'm making a MIDI Controller having 25 potentiometers (10k ohms) & 33 buttons which are hooked to 4 74HC4067 multiplexers (2 for Potentiometers & 2 for Buttons) Arduino Uno does not have this many Analog and Digital lines.

Below is the link to the video,which I have reffered :

I have attached all the files required(Code and Library).

Now, the issues are:
1.)I'm getting incomplete MIDI signals i.e. on the scale of 0-127,I'm get readings from 7-125/126 only.
2.)Sometimes the Pots start flickering badly and the value I get are near 57-68.
3.)There is some sort signal colliding issue.Signal colliding means when I turn the controller no.36 (from middle towards right or left) ,controller no.37 is also affected by the half the ratio.
Similarly,when I turn controller no.52 to right,the controller no.37 turns slightly towards left & when I turn the controller no.53 towards right,the controller no.37 turns slightly towards right.

Please do help me know what are the changes to be done.

Thank you!!

Arduino_MIDI_Library_v4.3.1.zip (46.5 KB)

MIDI_Controller_v1-2.zip (4.29 KB)

Adarsh_Umadi:
Hello Everyone,
1.)I'm getting incomplete MIDI signals i.e. on the scale of 0-127,I'm get readings from 7-125/126 only.

You could map the result from analogRead from the range 60-964 to the range 0-1023.

Adarsh_Umadi:
2.)Sometimes the Pots start flickering badly and the value I get are near 57-68.

Do you mean it flickers between 57-68, because that's a large range, not just standard ADC noise. In that case, you should double check your hardware and connections.
Some noise on the analog inputs is perfectly normal, and you usually use some kind of digital filter in combination with thresholding or hysteresis to prevent it.

Adarsh_Umadi:
3.)There is some sort signal colliding issue.Signal colliding means when I turn the controller no.36 (from middle towards right or left) ,controller no.37 is also affected by the half the ratio.
Similarly,when I turn controller no.52 to right,the controller no.37 turns slightly towards left & when I turn the controller no.53 towards right,the controller no.37 turns slightly towards right.

This often happens if the resistance of your potentiometers is too high. Ideally, your potentiometers should be 5kΩ or 10kΩ.
If you can't fix the hardware, try doing a dummy read each time you change the multiplexer channel, before doing your actual measurement.

You could implement all of that yourself, but these are solved problems, and the Control Surface library I maintain already allows mapping the potentiometer range, it filters analog inputs, and it does dummy reads on multiplexers.

You can find an example for using potentiometers with multiplexers in the Getting Started guide. For mapping the potentiometer range, see the CCPotentiometer-Map example.

Pieter

Adarsh_Umadi:
Hello PieterP,
Firstly I would like to thank you for helping me out.
as I am new to Arduino I didn't understand what you are trying say.

See the documentation of the map function.
You could do something like this:

const unsigned minrange = 60;
const unsigned maxrange = 964;
unsigned rawvalue = analogRead(pin);
unsigned mappedvalue = constrain(rawvalue, minrange, maxrange); // make sure the input is in the correct range
mappedvalue = map(mappedvalue, minrange, maxrange, 0, 1023); // map the limited range [60, 964] to the full range [0, 1023]

If the potentiometer reads a value of 60, this code will map it to 0, if the potentiometer reads a value of 694, it maps it to 1023 (100%).

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.