Hi there Arduino community!
I'm new in this forum and in Arduino world as well.
I like to build midi controllers and I want to make an Arduino based midi controller with 16 buttons and 6 potentiometers.
After a little research I found that I could use Arduino Nano for my project, using 2 analog inputs with buttons.
So I could use
1 to 14 digital inputs > 14 buttons
1 to 2 analog inputs > +2 buttons
3 to 8 analog inputs > 6 potentiometers
If you are using an Arduino that has 8 analog inputs then that should work.
If you want to use an Arduino with 6 analog inputs you can use a selector/multiplexer to get 16 button inputs from 6 pins (2 pins to address a 1-of-4 selector for rows and four pins for column inputs).
For the buttons, as long as only 1 button is pressed, you can use the keypad library as well. 4 rows, 4 columns, no extra hardware needed.
So thats 8 of the standard 14 digital inputs, 6 available.
6 analog inputs for pots, 0 available.
First of all, thank you all for such quick replies
Well, using 1 button at the time only is not an option, just because you don't want that in a midi controller for music producing or performance.
In the Arduino NANO I can get 14 digital inputs including TX/RX
I asked someone that is into Arduino and he told me that I should avoid using TX/RX while connected to a pc via USB.
Being that this midi controller needs to be pluged always via usb, I think using Arduino nano for this controller is not the way.
Using a a resistor ladder could be an option, I don't know how it really works but heard something about it.
Yes, sounds like you need more inputs then.
JohnWasser's suggestion to scan banks of buttons for multiple buttons pressed (or toggle switches?) at one time would be a good way to go then.
You could have 2 shift registers also; make up a loop that scanned their inputs in every 100uS, act on what you get back. Then just need 3 IO lines; Serial data in, clock in, data latch.
Or move up a step in processors, to a 40-pin dip like 324/644/1284 (increasing memory) or a board with that and SD Card and RTC like my Bobuino (link below).
I decided to do it with a Mega...
that way I can add some more buttons and potentiometers as well without getting to much trouble
I decided this just because I need to do it fast and easy. It's going to get a little more expensive this way but it worth it.
Now, being that I will use a Arduino Mega, I have lots of digital and analog inputs.
My main problem now will be programming the arduino to send MIDI data from all inputs though its USB port.
As I understand, I could also use a program like Max/MSP or Isadora or PureData to decode Arduino incoming data into midi, and that way I wouldn't need to program the Mega to send midi data.
I could do it this way, and I think that will be the way in the beggining, but It's always better to program the arduino to send midi data just because you could use this controller in every computer and not only in the one you have de decoding software, am I right?
I will research now other midi controller projects in this forum and I surely be asking for some more assistance in this project.
Thanks!
On a standard Arduino you can use 8 pins to get 16 buttons (four rows of four columns) and with a diode in series with each button you can detect multiple simultaneous button presses. Ten pins would get you 25 buttons (five rows of five columns).