Go Down

Topic: Using more than 16 analog inputs for a MIDI controller (Read 7754 times) previous topic - next topic

ctechdx

Hello my friends,

I want to build a midi controller to control some virtual audio devices. One of my projects need 24 potentiometers. As long as I know the maximum analog input available is the arduino mega with 16. Then I would like to have some tips and suggestions about how can I build a controller with 24 potentiometers. I heard about the possibility to use two arduino mega,  but I don´t know how it works. Can I link two boards or I have to use two independent cards?

Thanks,

johnwasser

Analog multiplexers will let you connect 8 or 16 analog inputs to EACH analog input of the Arduino.  You can buy a Mux Shield II which allows 48 analog inputs:

https://www.sparkfun.com/products/11723
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Grumpy_Mike

This project is on a Uno and I think you can see how using multiplexers it can easy be expanded past the 16 mark.
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html

ctechdx


Analog multiplexers will let you connect 8 or 16 analog inputs to EACH analog input of the Arduino.  You can buy a Mux Shield II which allows 48 analog inputs:

https://www.sparkfun.com/products/11723


Thanks my friends...

With that mux shield II I can build the project with an arduino uno, right?


johnwasser


With that mux shield II I can build the project with an arduino uno, right?


If you want to produce MIDI output you will need some additional hardware.  The Mux Shield II will definitely take care of the reading of 24 analog inputs which can be your 24 pots.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

ctechdx



With that mux shield II I can build the project with an arduino uno, right?


If you want to produce MIDI output you will need some additional hardware.  The Mux Shield II will definitely take care of the reading of 24 analog inputs which can be your 24 pots.


John,

Which potenciometer should I use for arduino projects? Logarithmic or linear? And which resistence? 10k... 50k? Please give me some tip about it.

Thanks,

johnwasser


Which potenciometer should I use for arduino projects? Logarithmic or linear? And which resistence? 10k... 50k? Please give me some tip about it.


Use linear if you are controlling pitch and use logarithmic if you are controlling volume?

You should use a pot less than 100k because that is the recommended limit for input impedance on the Arduino analog inputs.  If you go down to 1k they will draw 5mA each at 5V (120 mA total).  I would use 10k as a good compromise between current draw and input impedance.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

ctechdx



Which potenciometer should I use for arduino projects? Logarithmic or linear? And which resistence? 10k... 50k? Please give me some tip about it.


Use linear if you are controlling pitch and use logarithmic if you are controlling volume?

You should use a pot less than 100k because that is the recommended limit for input impedance on the Arduino analog inputs.  If you go down to 1k they will draw 5mA each at 5V (120 mA total).  I would use 10k as a good compromise between current draw and input impedance.


Thanks John,

I go for the 10k then... but I´m still in doubt about the linear or logarithmic. I gonna use it to control many diferent parameters of some virtual audio tools... such as, volume, frequency, bandwidth, threshold compression, etc... but for the audio software, no matter which parameter I´m controling... everything is done through midi signal, which goes from 0 to 128 midi value for every parameter.

Which potentiometer would be better for a precise controlling of those values?

Thanks,

johnwasser


Which potentiometer would be better for a precise controlling of those values?


Linear.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Grumpy_Mike

Quote
everything is done through midi signal, which goes from 0 to 128 midi value for every parameter.

You sure of that?
A lot of MIDI control parameters use two CC channels to give a 14 bit control number.

Anyway midi values go from 0 to 127 not 128.

ctechdx


Quote
everything is done through midi signal, which goes from 0 to 128 midi value for every parameter.

You sure of that?
A lot of MIDI control parameters use two CC channels to give a 14 bit control number.

Anyway midi values go from 0 to 127 not 128.


Thanks Grumpy Mike, actually i´m not sure about it... I have experience with audio but not with the electronic part. Then you probably know it better than me.

For those midi control parameters linear 10k potentiometers are the best option for a precise control, or you have some other suggestion?

Thanks,

Grumpy_Mike

#11
Sep 18, 2014, 03:27 pm Last Edit: Sep 18, 2014, 03:29 pm by Grumpy_Mike Reason: 1
Yes use linear pots any logarithmic content should be done in the actual controller that changes the volume.

The Arduino has only a 10 bit A/D converter, so you can do this two ways.
1) have a seprate corse and fine control
2) take one reading and split it up into two bytes like this
Code: [Select]

val = analogRead(A0) << 2;
val1 = val & 0x7F; // lower bit to fine control
val2 = (val >> 7 ) & 0x7F; // upper bit to send to corse controller


ctechdx


Yes use linear pots any logarithmic content should be done in the actual controller that changes the volume.

The Arduino has only a 10 bit A/D converter, so you can do this two ways.
1) have a seprate corse and fine control
2) take one reading and split it up into two bytes like this
Code: [Select]

val = analogRead(A0) << 2;
val1 = val & 0x7F; // lower bit to fine control
val2 = (val >> 7 ) & 0x7F; // upper bit to send to corse controller




Thanks my friend... my arduino will arrive next week begining... then I gonna make some tests and try the code you suggested. I let you guys know if I have some doubt during the tests. I´m sure I will hehehe

Thanks   :)

korakios

Hi,

I am also interested in DIY midi controller and looked for the Mux Shield II but looking at the specs I'd like to ask :

-How many analog inputs can it handle?Are the 48 all analog?

-I believe that it cannot read at the same time all the sensor ,only one by one (maybe I'm wrong). So, what would be the average latency of reading from the fist to last sensor?

-Would the Mux Shield II be compatible on a teensy 3.1 board?

I am new to arduino concept ,so I apologize for my dummy questions.

Go Up