So I don't normally leave comments on videos, but this is without a doubt the best explanation on basic multiplexing I have seen! Concise and clear amongst videos that try and explain this in 1 minute or one hour. You've got yourself a new subscriber and paton :)
It's taken me eight years to find this video.. The series is very easy to understand and the code solves a number of problems I was having with Arduino MIDI. I have been using an Allen Heath ZEDR-16 that has excellent MIDI capability - or did until the Firewire board died and A&H have no stock. I need to build a 16 fader channel with 32 buttons. I reckon I can add a routine to flash an LED on detecting MIDI activity, but extending the buttons to 24 by adding another mux is probably beyond me. Maybe I can build two of these with 16 buttons, set them to different MIDI channels and have the DAW buttons respond to the different incoming channels.
I made a midi arduino footswitch using this design; made it all in one night. Was having trouble figuring out how to have my computer read the MIDI messages, but I figured it out. The video I was watching to figure out the programming for my arduino was by Nick Leonard who adopted your code. After seeing this video it all came full circle. Thank you so much for your work; it's so useful and informative.
i am pretty new in the technical side of midi and got curious about the arduino. after some checking i actually wanted to stop because it was so messy information for beginners everywhere, but you saved my plan! aagreat videos, thank you very much to be one step closer to my daw footswitch controller!
I had no idea what a multiplexer was and you explained it so clearly and accompanied it with extremely clear visuals and graphics. Thank you for teaching me this.
,,Here's how you describe a button: Start the line with the command word button to indicate that this is a button object.'' I love how a superior language that has such a great accuracy (programming languages) makes smart people sound like their suffering from a stroke. great video. Keep it up...
You are such an amazing teacher. Thanks to you, from literally zero electronics experience, to building a custom MIDI controller in a few days. Your instructions and videos are so clear, and you get straight to the point. Thank you from the Small Island across the pond :)
Man, you're a genius. I feel like I'm getting much closer to figuring out how Keybed matrixes work. I'm trying to fuigure out how to connect a 61 key Fatar keybed to the arduino, along with 16 x buttons and 16 x pots. I am seriously hoping you have a video dedicated to that, but I thought I should start at the start! Thanks so much though.
the mkp mini keybed im hacking right now has 25 keys with 2 contacts each. the 2nd contact is to provide velocity sensitivity: the microcontroller will measure the difference in time between contact closures and calculate the input velocity using some curve. every contact has a (row, column) coordinate on the 8x8 grid connected via a diode to avoid "ghosting" and "masking". im going to use an output multiplexer and connect each Y pin to a column, and connect a second multiplexer as an input from the rows. i will scan through the column outputs writing HIGH, and for each column, read every row. the keyboard buttons which are pressed should pass the HIGH voltage from the output mux to the input mux and show the button is pressed. or maybe ill write LOW first to see if that works without melting anything lol. after i map out which keys go to which pair of grid coordinates ill see if my esp32/multiplexers are fast enough to handle the velocity detection.
so many tanks from france! i make an midi controler for ableton in 2 days and it's work perfectly at the first try... so amazing tutorial and perfectly code!
I'm a pharmacy student, meaning I have ZERO knowledge about electronics or programming. With that said, the fact that i can easily understand everything you just said just speaks about how great this tutorial was! Thanks man!
no problem!a few quick questions tho, I'm planning to use 74HC4067 to make a 20 button midi controller (16 buttons for the midi notes on the mux and 4 buttonson the uno to choose banks) based on the midi fighter 3d: 1) will the 74HC4067 cause any latency issues when playing since the signal has to travel thru basically two chips? and; 2) do I have to change the code for the 4 buttons to be dedicated to changing banks like the midi fighter 3d or is that something i have to configure on the DAW itself instead, namely ableton? 3)is it still possible to use a usb b instead of a midi port and program that as a usb-midi port? or alternatively, flash the arduino uno to be recognized as a midi device? thank you so much in advance!
I'm not a professional by any stretch but I guess I can answer your questions somewhat. 1) I believe multiplexers are sufficiently fast as to not introduce any noticeable latency. Maybe latency could come from how the Arduino code handles the multiplexers, but to be honest 20 inputs doesn't seem like a lot of inputs regardless. 2) You need to change the code so your buttons send CC 0 or CC 32, which are the Bank Select MSB and LSB messages respectively. You might want to look into how MIDI deals with both the Bank Select and Program Change messages, because they work in a slightly different manner: you have to supply some parameter value so they actually do anything. 3) Technically yes, but you need to hack the Uno. The Uno has two microcontrollers, the 16u2 and the AT328. The 16u2 can be hacked to load a firmware which enables HID support, therefore making it possible for the Uno to be recognized as something like a keyboard, mouse or MIDI controller. To hack the 16u2 you'd need either another Uno or a way to access your Uno's ICSP port. Anyways, I think it would be easier if you used something with built-in HID support, such as the Micro or Micro Pro (they both have the 32u4 microcontroller). Again, I'm no expert so whoever reads this, please correct me if I've dun goofed.
thank you so much. I just ordered all the stuff to make a 16 step sequencer which will each have an on-off button, a knob for pitch, and a knob for velocity (or some other modulations) I'm really grateful to get such detailed instructions.
Wow this was amazingly well done. Coming accross a straight forward, well formatted tutorial with clear diagrams narrated by a clear, well spoken voice is like finding a Unicorn in a garbage dump. 10/10 - SUBSCRIBED.
Wow , this is great!!! I've been looking to make my own controller since no one offers a customize option and this video is really straight forward and easy to understand , thanks !!!
Hi Dave, Great video, perfect pacing, perfect depth. I follow several CZcamsrs and know you guys like to hear what we'd like to learn, so here goes... I'd love to see an encoder tutorial and an expansion on the note on/off and cc messages to a multi byte SysEx message. Also combine the MIDI in circuit with a MIDI "learn" mode. Thanks again for the video... And inspiration, I'll be dusting off my Uno this weekend. Steve
Nicely done! You clarified all the hurdles I had to get me started with Arduino. Very concise and all my intermediate questions were answered along the way, as if you knew I was asking them.
This series and accompanying sketch are really great and the use of multiplexers is fantastic as a Uno owner. Very nice work and Thank you for sharing!
I'm surprised you don't have more Subs as this is without doubt, the easiest Tutorial to follow on the Arduino and Midi Control, I came here from Look Mum (Sam) and now I know why he uses your method. Going to Sub now and have a good look around. Thanks.
thankyou so much sir... for the 3 part tutorial...ive been looking for this...since long..best part was that.. i was able to learn a bit of arduino as well with midi and mutliplexing...so detailed and step by step explanation...you rarely get.God bless you sir
thank you so much for these videos, they've been very informative and allowed me to build an awesome midi controller without knowing much about electronics. keep up the great work
This is an amazing tutorial with all steps, theory and practice exceptionally explained! Thank you very much for this, it was a great learning experience and the best tutorial I've found on the topic. Subscribed and thumbs up! :)
Great tutorial but imo lacks following information at one point: While the Multiplexer might not be able to hybrid between digital and analog inputs, it is possible to convert analogue inputs into digital ones within the code. This can be done similarily to how you convert analogue Values to Midi-Values for your Potentiometers. It can be achieved simply by loading the value of your analogue input into a Variable that is modulates another Variable either by dividing the Values by 512 or by defining a treshold and divide by that. Version one can be used when you never pick up values bigger than 511 unless you give voltage (remember: cables this small are very vulnerable to interference). Version two gets intresting if we have random spikes of interference going on. Look for the Highest Peak over an extended period of time and set your treshold higher than that. Now, only if you trigger the button, the treshold will be passed and the "Variable = input/Treshold"will be bigger than 1.
Amazing Midi Controller!! Please make a video with rotary encoders!!!! I do all examples of "Arduino MIDI Controller" and work perfectly! Thank you Notes and Volts!!!
First, let me thank you for the videos. They have made it much easier and faster to put together projects. I am curious if you or any of the folks on here have used feedback from Logic Pro to light LEDs, or to text to a display on the controller. My desire is to have the controller reflect any changes through the keyboard back to the controller. For instance if a button with a corresponding LED is used to mute a channel, a keyboard entry to mute the same channel would light the LED. Also, I'm putting together a controller pushing MIDI through USB, and I'd like to have Logic reflect a custom name for the controller.
I would think you should use pull up or pull down resistors on the buttons, otherwise the switch input can float and the mux input is indeterminate in that case.
Great videos, explained at just the right pace, without overwhelming the viewer with technical jargon. Windodge asked if this project would render a keyboard monophonic. Your answer was that the midi instrument itself would determine that. But since a multiplexer only outputs one value at a time, doesn't this mean that you're sending midi messages one a time? The way I understand this, is that the midi messages are sent fast enough to give the impression of polyphony. Please correct me if I'm wrong. :)
Hi Isabelle. Glad you like the videos. Your understanding is correct. If you play a C major chord - even if you manage to hit all the keys at the exact same millisecond (almost impossible for a human), Midi will send out three Note On messages one after another (C E G) in rapid succession . When you release the keys, it will send three Note Off commands to stop the notes.
This works great with the parts I could find. I am thinking about how to add a button or buttons in the code that adds bank(s) functionality. When the button for bank two is pressed, the pots would output a different CC# or on a different MIDI channel. A relatively small control surface with 16 pots and 16 buttons could then be used to control DAW software with 8, 16, ? however many tracks. My coding skills are rusty and were never that great to begin with ;), but thanks to your great videos and clear, simple instruction, I am moved to improve. Thank you sir!
you could potentially just add a button that increments the midi cc # by a certain amount? maybe a bit of a janky way of going about it but i think it would work.
Thanks man. Very nice series. It would also be nice if you could do some in depth code explanation of MIDI.h and your own MIDI_Controller_v1-2. But anyway: Great stuff!
Your videos are always well produced and your circuits are always sooooo clean :) Thank you for taking the time to share your knowledge. Just out of curiosity, what is your background?
Thanks HighDuke! I appreciate that :) I'm an electronics technician who has been fascinated by circuits since I was a little kid. I was also a musician for a couple of decades so I guess that explains the musical nature of a lot of my stuff.
The best tutorial I found, for a beginner like me. Thanks a lot, man! It will handle more than 2 multiplexers, right? Just need to add them to the code?
Thanks Pawel! Yes you can add more than 2 mux. One thing to keep in mind is the more controls you add, the longer it takes the code to check them all. Analog controls (pots) take more time than digital controls (buttons) to read as well. I'm not sure what the upper limit is.
Hello all. This software is GREAT!!!! Very simple to setup and customize to the user preference.. With the software that Dave has written for the UNO it can safely run total of 64 inputs. If more than 64 is needed add a second UNO and daisy chain the two together with 220 Ohm resistor (VERY IMPORTANT) , Dave did a video on MIDI in and THRU... On the second UNO software in the code in setup. MIDI.begin(MIDI_CHANNEL_OMNI); and in loop before Dave's first line of code add this... MIDI.read(); that will read MIDI from Uno 1 and pass it thru Uno 2 to the main MIDI out. If you are using older pots or slide pots the MIDI out may bounce around a lot when not touching the pot, I used a 10uf @ 50v capacitor connecting from ground to the signal terminal on the pot to solve that issue.
It can run more on 1 arduino if you change the variable array structure a bit. I can drive 111 inputs with some adjustments in Dave's code. I also added led output to the button toggle states so I get visual hardware feedback when a channel is muted. And yes, this tutorial is by far the best on YT as well as on the net. The code is setup very nicely in a customizable way. Hands up for Dave! One thing that would be great: this code ported to Teensy for USB, more native inputs and faster processing. But from what I understand it involves quite some rework as the direct port manipulation used in this code is not compatible with the teensy. I created a PCB design for my mixer currently being converted. It includes 7 4067 (96 analog / 16 digital buttons) multiplexer shields, 2 595 shift registers in serial for led output as well as footprints for both the Uno and the Teensy so they can be easily connected via their headers without any cables. Only flat cables to the pots and buttons.
I tried a couple programs as a noob past weeks Eagle, KiCAD but eventually I settled for EasyEDA. That one is very easy to use and has a great parts library which is user fed. You can directly order the boars in program.
Hi Concert LD. Thanks for the update and info! I never thought people would take this project as far as they have. I made it as a fun way to finish off the Midi for Arduino but many have really taken it to the next level. Anyway, thanks for sharing your knowledge. Great work!
Thanks for this well-explained video tutorial! I don't know enough about C to figure out whether your controller library can be modified to allow "coarse" (7-bit) NPRN parameters to be assigned to pots / buttons on this shield project. However, it seems if an NRPN flag is added to the "command" variable, and if the "note number" / "byte command" variables can hold a 14-bit value for the number of the NRPN parameter to change, then a routine could be added to issue the 9 bytes that make up the NPRN parameter change command (CC / #99 / MSB of NPRN parameter / CC/ #98 / LSB of NPRN parameter / CC/ #6 / 7-bit parameter value to send). Is this possible?
Can you use endless encoders connected via a multiplexer? The arduino needs to be able to send values to the encoder, not only receive values. An example of what I mean are the encoders on BCR1000. The advantage is that as you e.g. change the value of a pan knob inside the DAW, the endless encoder is kept up-to-date, and if it has surrounding LEDs then it will visually indicate what the pan value is.
This is awesome! It would be really cool if you could take this to the next level and teach us how to add functionality such as a midi sequencer using this project as a starting point. What do you think? I would dig learning about how that's done.
Those pots are going to go short and burnup when they are at their minimum position which would be close to 0-Ohms. You should really use a 200-Ohm resistor to limit the current through the pots.
Truly fabulous! I watched the entire series, even though CZcams served me just this episode, based on my previous interest in other multiplexer/demultiplexer videos. Have you formally set rights to your marvelous code? Otherwise, would you accept change with attribution?
pls do a video on connecting a proper keyboard on one side and a DAW software on other through arduino. I would like to see how DAW recognizes arduino uno as I'm not clear on those things. pls clarify.
hello friend, I wonder if you can use this script to turn the keys of a musical keyboard, because it uses matrix keyboard and sends several notes using the msm pin. My idea and convert an ordinary keyboard into a MIDI keyboard Sorry for the bad English, because I'm not Brazilian Thank you
I had a question: because the multiplexers all use the same control pins, does that have any implications for the polyphony of notes across different multiplexers? Like, say I have an input on one multiplexer pressed that requires the 3 control pins to be H H L, and I press a button on a different multiplexer that requires the control pins to be H L H
Hi Dave! Thank you for creating this series! I've been doodling an idea for a USB midi controller these past few days based on an Arduino, and just last night came across this series! So now I feel confident to make it happen :) I wanted to ask you if it would be OK to use a different Arduino chip, like a Nano, since I'm only planning on using pots (64 of them) and I'd like to make the enclosure as small as possible. I'd also like to power it just with USB, if it was possible to handle 4 16-pin mux and all those pots. Cheers!!
wow, this is amazing, thank you so much. I have 2 questions: 1- can I connect rotary encoders ky040 in the multiplexers? 2- Can I connect buttons and rotary encoder to the multiplexers? greetings and thank you very much!
Hi, great videos! I was just looking at your code and was wondering, what would be the easiest way of including a "note holder" function, so that the last pressed note is held for ever until the hold button is pressed again. Any ideas?
Great video! Do you happen to have updated code that works with Arduino boards that have native USB support? I know at some point, Teensy was about the best option, but so many boards now offer native USB. I have a Teensy 3.6 but also several Arduino Leonardo boards, how difficult would it be to modify the code to work with a Leonardo board?
Great video! Much easier to learn than trying to read a bunch of articles. Do you have any videos on using an encoder with an 8 or 16 input multiplexer? Thanks!
I’d like a really simple controller that has an encoder which allows you to dial in the CC e.g 74 for filter frequency, and a second encoder to change the value of that CC number. Example, encoder 1 set to 74 for filter frequency and encoder 2 to change the frequency value. Record filter sweeps into your DAW. Change the CC via encoder 1 to say 71 for resonance and record changes to resonance from encoder 2. This saves you having to have lots of encoders or having to reprogram the Arduino to use different controller numbers. The CC encoder would need a 3 digit display so that you can see which value you’ve selected. I can put the hardware together but can’t program the code. Is there anything out there like this?
First of all, thank you so much for your tutorials they are so professional and well documented. I build this project with an Arduino Uno with a multiplexer and everything worked out, it's really great. But then I tried to adapt it to my Arduino pro micro with one multiplexer and it seems a totally different story. I'm trying to send the midi through the USB port but I can't find the way. Do you have any ideas? Do you know how can I adapt this project to this board?
Great video! I got one question, and it's real nooby - can you rotate both those knobs at the same time and get two signals simultaneously? I know that I connect the knobs directly to the arduino that'll work since no switching has to happen, but with multiplexers I am not sure.
So if you can multiplex a mutiplexer, would it be possible to get 40 inputs into an Arduino Uno? Or would I be better off with an Arduino model with more input ports?
Wonderful video, im also interested in presets...as in if preset is set to 1, the pot controls cc1channel1, if preset is set to 2, the pot controls cc5channel2 and so on...can you do a video on that ? Also use buttons to change presets
What about the speed/strength of the buttons when you push them. like when you hit the button hard, the note is stronger. And if you hit it slow, the note is weak.
Hi, I am using 4051 IC with Arduino Nano with your code. I have added two buttons and modified the code accordingly as you described. But only one button triggers at a time and send MIDI messages, the second one doesn't work, but if I disable the first button in the code the second one does work. Can you help me please? Is there anything I need to do extra in the code? Do only the 4067 IC works with the multiple buttons?
Hi notes and volts, is there a reason why pin 0 and pin 6 can't be used to connect multiplexers in your code. I like to connect 6 4067 to the Uno. When connecting pots directly to the analog pins, pin0 and pin6 are available. Any way to change the code so that pin 0 and 6 are also mux capable?
Never mind above (typo pin 6 should have been pin 5). Also I already used A0-A03 analog input pins for my test one month ago :) I got confused by the naming of the address pins //A0 = PIN2, A1 = PIN3, A2 = PIN4, A3 = PIN5. They off course do not relate to the analog input pins . ADDR0-ADDR3 would have been clearer to not get mixed up with the A0-A5 used for declaring the analog input pins. For the OUTPUT PIN variable, INPUT PIN would have been a more suitable name for that variable as it's used as input scanning and not as output in this application. Minor details though, I'm very happy with your code!! Anyways I found out that for my project the Uno is near it's limit. I'm going to use 81 analog pots and 15 buttons for my final project. When I tried to declare the full 96 analog ins which the 6 analog multiplexers and 16 digital ins on 1 digital multiplexer the dynamic memory exceeded 100% (108%) and therefor I was not able to upload the code to the Arduino. With 81 pots and 15 inputs declared, the code uses 96%. Just enough to fully midify my peavey twelve hundred series vintage mixer. So anyone wondering what the maximum inputs is for the code to handle: around 96 digital and analog combined.
I changed the pot and button variables by taking out the midi channel parameter. In stead I set the channel fixed now. It freed up some dynamic memory and now I am able to connect 112 inputs at 98% dynamic memory consumption.
Hi There, I know this message dates back a year but I am very interested in your modified code for this project - could I ask a huge favour and ask if you could email me the code please? Many thanks
So I don't normally leave comments on videos, but this is without a doubt the best explanation on basic multiplexing I have seen! Concise and clear amongst videos that try and explain this in 1 minute or one hour. You've got yourself a new subscriber and paton :)
It's taken me eight years to find this video.. The series is very easy to understand and the code solves a number of problems I was having with Arduino MIDI. I have been using an Allen Heath ZEDR-16 that has excellent MIDI capability - or did until the Firewire board died and A&H have no stock. I need to build a 16 fader channel with 32 buttons. I reckon I can add a routine to flash an LED on detecting MIDI activity, but extending the buttons to 24 by adding another mux is probably beyond me. Maybe I can build two of these with 16 buttons, set them to different MIDI channels and have the DAW buttons respond to the different incoming channels.
Cool share the project
I made a midi arduino footswitch using this design; made it all in one night. Was having trouble figuring out how to have my computer read the MIDI messages, but I figured it out.
The video I was watching to figure out the programming for my arduino was by Nick Leonard who adopted your code. After seeing this video it all came full circle. Thank you so much for your work; it's so useful and informative.
DUDE ITS LITERALLY THE BEST EXPLANATION I HAVE EVER SEEN... YOURE THE BEST
Thanks Omer!
No doubt one of the best made videos on this stuff!!! Clear, concise, complete and professional!!! Thank You
Thank you Brian!
i am pretty new in the technical side of midi and got curious about the arduino. after some checking i actually wanted to stop because it was so messy information for beginners everywhere, but you saved my plan! aagreat videos, thank you very much to be one step closer to my daw footswitch controller!
Glad I could help!
I had no idea what a multiplexer was and you explained it so clearly and accompanied it with extremely clear visuals and graphics. Thank you for teaching me this.
,,Here's how you describe a button:
Start the line with the command word button to indicate that this is a button object.''
I love how a superior language that has such a great accuracy (programming languages) makes smart people sound like their suffering from a stroke. great video. Keep it up...
LoL! Thanks Damion
You are such an amazing teacher. Thanks to you, from literally zero electronics experience, to building a custom MIDI controller in a few days. Your instructions and videos are so clear, and you get straight to the point. Thank you from the Small Island across the pond :)
Thanks Patrick! I really appreciate it :)
Dude!!!! You speak to me as a beginner and now I finally get it!!! Thank you!!!
Man, you're a genius. I feel like I'm getting much closer to figuring out how Keybed matrixes work. I'm trying to fuigure out how to connect a 61 key Fatar keybed to the arduino, along with 16 x buttons and 16 x pots.
I am seriously hoping you have a video dedicated to that, but I thought I should start at the start! Thanks so much though.
the mkp mini keybed im hacking right now has 25 keys with 2 contacts each. the 2nd contact is to provide velocity sensitivity: the microcontroller will measure the difference in time between contact closures and calculate the input velocity using some curve. every contact has a (row, column) coordinate on the 8x8 grid connected via a diode to avoid "ghosting" and "masking".
im going to use an output multiplexer and connect each Y pin to a column, and connect a second multiplexer as an input from the rows. i will scan through the column outputs writing HIGH, and for each column, read every row. the keyboard buttons which are pressed should pass the HIGH voltage from the output mux to the input mux and show the button is pressed. or maybe ill write LOW first to see if that works without melting anything lol.
after i map out which keys go to which pair of grid coordinates ill see if my esp32/multiplexers are fast enough to handle the velocity detection.
so many tanks from france! i make an midi controler for ableton in 2 days and it's work perfectly at the first try... so amazing tutorial and perfectly code!
I'm a pharmacy student, meaning I have ZERO knowledge about electronics or programming. With that said, the fact that i can easily understand everything you just said just speaks about how great this tutorial was! Thanks man!
Thanks Dennis! That's awesome :)
no problem!a few quick questions tho, I'm planning to use 74HC4067 to make a 20 button midi controller (16 buttons for the midi notes on the mux and 4 buttonson the uno to choose banks) based on the midi fighter 3d:
1) will the 74HC4067 cause any latency issues when playing since the signal has to travel thru basically two chips? and;
2) do I have to change the code for the 4 buttons to be dedicated to changing banks like the midi fighter 3d or is that something i have to configure on the DAW itself instead, namely ableton?
3)is it still possible to use a usb b instead of a midi port and program that as a usb-midi port? or alternatively, flash the arduino uno to be recognized as a midi device?
thank you so much in advance!
I'm not a professional by any stretch but I guess I can answer your questions somewhat.
1) I believe multiplexers are sufficiently fast as to not introduce any noticeable latency. Maybe latency could come from how the Arduino code handles the multiplexers, but to be honest 20 inputs doesn't seem like a lot of inputs regardless.
2) You need to change the code so your buttons send CC 0 or CC 32, which are the Bank Select MSB and LSB messages respectively. You might want to look into how MIDI deals with both the Bank Select and Program Change messages, because they work in a slightly different manner: you have to supply some parameter value so they actually do anything.
3) Technically yes, but you need to hack the Uno. The Uno has two microcontrollers, the 16u2 and the AT328. The 16u2 can be hacked to load a firmware which enables HID support, therefore making it possible for the Uno to be recognized as something like a keyboard, mouse or MIDI controller. To hack the 16u2 you'd need either another Uno or a way to access your Uno's ICSP port. Anyways, I think it would be easier if you used something with built-in HID support, such as the Micro or Micro Pro (they both have the 32u4 microcontroller).
Again, I'm no expert so whoever reads this, please correct me if I've dun goofed.
MrRockism thank you! That helps alot, actually!
This is great!!!!. Please do Encoder video midi !!! Cool Notes & Volts
This brings back fond memories of my electronics design days, many years ago.
That's great tallgeese!
So far the best video and best channel for this stuff!
thank you so much. I just ordered all the stuff to make a 16 step sequencer which will each have an on-off button, a knob for pitch, and a knob for velocity (or some other modulations) I'm really grateful to get such detailed instructions.
Hi, how do you think to do the sequencer?
Wow this was amazingly well done. Coming accross a straight forward, well formatted tutorial with clear diagrams narrated by a clear, well spoken voice is like finding a Unicorn in a garbage dump. 10/10 - SUBSCRIBED.
Wow! Thanks Crawford. I appreciate that :)
there's a problem though, when I go to verify the code, it says " 'Mux' does not name a type" why is that?
an 1,2,3, explenation. absolutely the best.
Thank you!
Perfect! Exactly what I was looking for and didnt know how to describe it!
Awesome mopesca!
This helped me finally understand multiplexers
Wow , this is great!!! I've been looking to make my own controller since no one offers a customize option and this video is really straight forward and easy to understand , thanks !!!
Our Dave is the best ! , I love the clarity of your explanations, you rock !
Thanks Eric!
Hi Dave,
Great video, perfect pacing, perfect depth. I follow several CZcamsrs and know you guys like to hear what we'd like to learn, so here goes... I'd love to see an encoder tutorial and an expansion on the note on/off and cc messages to a multi byte SysEx message. Also combine the MIDI in circuit with a MIDI "learn" mode.
Thanks again for the video... And inspiration, I'll be dusting off my Uno this weekend.
Steve
Thanks Steve! Those are some great suggestions. I will keep them in mind for future projects.
It would be interesting if you could explain now shift registers. You make a great job and the best midi-arduino tutorials out there.
Thanks Sergi. I'll add that to my list for the future.
I second this request!
Nicely done! You clarified all the hurdles I had to get me started with Arduino. Very concise and all my intermediate questions were answered along the way, as if you knew I was asking them.
This series and accompanying sketch are really great and the use of multiplexers is fantastic as a Uno owner.
Very nice work and Thank you for sharing!
Thanks Tyborg!
AMAZING TUTORIAL THIS IS WHAT WE HAVE ALL BEEN WAITING FOR AT LAST PLEASE KEEP THESE PROJECTS COMING THANK YOU
Thanks Kevin!
I'm surprised you don't have more Subs as this is without doubt, the easiest Tutorial to follow on the Arduino and Midi Control, I came here from Look Mum (Sam) and now I know why he uses your method. Going to Sub now and have a good look around. Thanks.
Thank you John! Welcome aboard :)
thankyou so much sir... for the 3 part tutorial...ive been looking for this...since long..best part was that.. i was able to learn a bit of arduino as well with midi and mutliplexing...so detailed and step by step explanation...you rarely get.God bless you sir
You are most welcome
thank you so much for these videos, they've been very informative and allowed me to build an awesome midi controller without knowing much about electronics. keep up the great work
This series of videos are so well explained and so well done ...
Thanks Truman!
this is the real deal man , thanks' a lot I've been looking for these . God Bless you..
The Best e-Maker Video Ever. You are a superb teacher. Thank you.
the best explanation i ve ever seen so far.
Thanks Holger!
Thank you for this whole series!
Thanks Sean!
This is an amazing tutorial with all steps, theory and practice exceptionally explained! Thank you very much for this, it was a great learning experience and the best tutorial I've found on the topic. Subscribed and thumbs up! :)
Thanks Diego!
Wonderful! Videos like this really adds something of value to this world. I'll have lots of use from this when I start on my own project.
Thanks!
Thanks Andreas!
Great tutorial but imo lacks following information at one point:
While the Multiplexer might not be able to hybrid between digital and analog inputs, it is possible to convert analogue inputs into digital ones within the code. This can be done similarily to how you convert analogue Values to Midi-Values for your Potentiometers.
It can be achieved simply by loading the value of your analogue input into a Variable that is modulates another Variable either by dividing the Values by 512 or by defining a treshold and divide by that. Version one can be used when you never pick up values bigger than 511 unless you give voltage (remember: cables this small are very vulnerable to interference). Version two gets intresting if we have random spikes of interference going on. Look for the Highest Peak over an extended period of time and set your treshold higher than that. Now, only if you trigger the button, the treshold will be passed and the "Variable = input/Treshold"will be bigger than 1.
Thanks again for another superb tutorial. So clear and beautifully produced. Exceptional work.
Trying this one next - I became a patron on patreon too (for the first time) hope it works! Your videos are superb.
Thank BB! Let me know how it goes
Amazing Midi Controller!! Please make a video with rotary encoders!!!! I do all examples of "Arduino MIDI Controller" and work perfectly! Thank you Notes and Volts!!!
Thanks a ton for putting up this video series, very well explained and easy to follow :) Great job!
Exactly what i was looking for in great detail! Thank you from a beginner.
Thanks Matthew!
Man, you are a great teacher. Very well explained. Wow.
You are the midi lord
This is such an amazing video. Thanks a lot for explaining everything in the simplest words!
Thanks Hari! Glad you enjoyed it.
The best tutorial out there! Great code as well, especially for beginners!
Thanks Sebastian! Appreciate it :)
First, let me thank you for the videos. They have made it much easier and faster to put together projects. I am curious if you or any of the folks on here have used feedback from Logic Pro to light LEDs, or to text to a display on the controller. My desire is to have the controller reflect any changes through the keyboard back to the controller. For instance if a button with a corresponding LED is used to mute a channel, a keyboard entry to mute the same channel would light the LED. Also, I'm putting together a controller pushing MIDI through USB, and I'd like to have Logic reflect a custom name for the controller.
This is great and works the same with nte4051b multiplexer. My controller has 8 pots
Great video, and very simple to follow as usual!
Thanks Mathias!
Great video! Thanks for making this series.
Great job. Can we hope for a midiusb version in the future? This could be very appreciated.
OMG, THIS is exactly what I needed. ❤️❤️❤️
Thanks Stu! That's great.
I would think you should use pull up or pull down resistors on the buttons, otherwise the switch input can float and the mux input is indeterminate in that case.
Great videos, explained at just the right pace, without overwhelming the viewer with technical jargon.
Windodge asked if this project would render a keyboard monophonic. Your answer was that the midi instrument itself would determine that. But since a multiplexer only outputs one value at a time, doesn't this mean that you're sending midi messages one a time? The way I understand this, is that the midi messages are sent fast enough to give the impression of polyphony. Please correct me if I'm wrong. :)
Hi Isabelle. Glad you like the videos. Your understanding is correct. If you play a C major chord - even if you manage to hit all the keys at the exact same millisecond (almost impossible for a human), Midi will send out three Note On messages one after another (C E G) in rapid succession . When you release the keys, it will send three Note Off commands to stop the notes.
This works great with the parts I could find. I am thinking about how to add a button or buttons in the code that adds bank(s) functionality. When the button for bank two is pressed, the pots would output a different CC# or on a different MIDI channel. A relatively small control surface with 16 pots and 16 buttons could then be used to control DAW software with 8, 16, ? however many tracks. My coding skills are rusty and were never that great to begin with ;), but thanks to your great videos and clear, simple instruction, I am moved to improve. Thank you sir!
you could potentially just add a button that increments the midi cc # by a certain amount? maybe a bit of a janky way of going about it but i think it would work.
Thanks man. Very nice series. It would also be nice if you could do some in depth code explanation of MIDI.h and your own MIDI_Controller_v1-2. But anyway: Great stuff!
Thanks Pekka! I'll put that on the list.
couldn't agree more! that would be sweet
Congratulations on the very enlightening video.
I would like you to make a video showing how to put a potentiometer encoder (jog) in this project.
Thank you for the effort, this is next level brother!
Your videos are always well produced and your circuits are always sooooo clean :) Thank you for taking the time to share your knowledge. Just out of curiosity, what is your background?
Thanks HighDuke! I appreciate that :) I'm an electronics technician who has been fascinated by circuits since I was a little kid. I was also a musician for a couple of decades so I guess that explains the musical nature of a lot of my stuff.
The best tutorial I found, for a beginner like me. Thanks a lot, man! It will handle more than 2 multiplexers, right? Just need to add them to the code?
Thanks Pawel! Yes you can add more than 2 mux. One thing to keep in mind is the more controls you add, the longer it takes the code to check them all. Analog controls (pots) take more time than digital controls (buttons) to read as well. I'm not sure what the upper limit is.
Really nice and complete explanation. Thank you!
Thanks so much! excited to get building!
I would note that you could multiplex both analog and digital signals if you had a device input that would handle it.
thank you. i am really grateful for this perfect tutorial. Now i can make my own midi control board
Thanks a lot for these videos. you made designing MIDI super easy. Thanks a ton again. :-)
Thanks Sanjeev!
This is great!!!!. Please do Encoder video midi !!! Cool Notes & Volts
gr8 vid, gr8 explanation ... in some utube videos, they r mentioning about hairless .. but u haven't mentioned it here
thanks for the tutorial!!!I cant wait to try it!
Hello all. This software is GREAT!!!! Very simple to setup and customize to the user preference.. With the software that Dave has written for the UNO it can safely run total of 64 inputs. If more than 64 is needed add a second UNO and daisy chain the two together with 220 Ohm resistor (VERY IMPORTANT) , Dave did a video on MIDI in and THRU...
On the second UNO software in the code in setup.
MIDI.begin(MIDI_CHANNEL_OMNI);
and in loop before Dave's first line of code add this...
MIDI.read();
that will read MIDI from Uno 1 and pass it thru Uno 2 to the main MIDI out.
If you are using older pots or slide pots the MIDI out may bounce around a lot when not touching the pot, I used a 10uf @ 50v capacitor connecting from ground to the signal terminal on the pot to solve that issue.
It can run more on 1 arduino if you change the variable array structure a bit. I can drive 111 inputs with some adjustments in Dave's code. I also added led output to the button toggle states so I get visual hardware feedback when a channel is muted.
And yes, this tutorial is by far the best on YT as well as on the net. The code is setup very nicely in a customizable way. Hands up for Dave!
One thing that would be great: this code ported to Teensy for USB, more native inputs and faster processing. But from what I understand it involves quite some rework as the direct port manipulation used in this code is not compatible with the teensy.
I created a PCB design for my mixer currently being converted. It includes 7 4067 (96 analog / 16 digital buttons) multiplexer shields, 2 595 shift registers in serial for led output as well as footprints for both the Uno and the Teensy so they can be easily connected via their headers without any cables. Only flat cables to the pots and buttons.
HolyPeyote recommendations on a customizable PCB? Software, design and who makes them? I have some projects where PCBs would be really nice. Thanks
I tried a couple programs as a noob past weeks Eagle, KiCAD but eventually I settled for EasyEDA. That one is very easy to use and has a great parts library which is user fed. You can directly order the boars in program.
Thank you I will check that out. This will cut down on my spiderweb in my projects
Hi Concert LD. Thanks for the update and info! I never thought people would take this project as far as they have. I made it as a fun way to finish off the Midi for Arduino but many have really taken it to the next level. Anyway, thanks for sharing your knowledge. Great work!
Thanks for this well-explained video tutorial! I don't know enough about C to figure out whether your controller library can be modified to allow "coarse" (7-bit) NPRN parameters to be assigned to pots / buttons on this shield project.
However, it seems if an NRPN flag is added to the "command" variable, and if the "note number" / "byte command" variables can hold a 14-bit value for the number of the NRPN parameter to change, then a routine could be added to issue the 9 bytes that make up the NPRN parameter change command (CC / #99 / MSB of NPRN parameter / CC/ #98 / LSB of NPRN parameter / CC/ #6 / 7-bit parameter value to send).
Is this possible?
Can you use endless encoders connected via a multiplexer? The arduino needs to be able to send values to the encoder, not only receive values. An example of what I mean are the encoders on BCR1000. The advantage is that as you e.g. change the value of a pan knob inside the DAW, the endless encoder is kept up-to-date, and if it has surrounding LEDs then it will visually indicate what the pan value is.
This is awesome! It would be really cool if you could take this to the next level and teach us how to add functionality such as a midi sequencer using this project as a starting point. What do you think? I would dig learning about how that's done.
HI CB. That sounds like a cool project. I'll put it on the list.
Love the work you do. I will look forward to that.
Those pots are going to go short and burnup when they are at their minimum position which would be close to 0-Ohms. You should really use a 200-Ohm resistor to limit the current through the pots.
Hi Arnold. The Atmega chip on the Arduino has built in 20K resistors on the digital inputs and very high (100M) impedance on the analog ins.
@@NotesAndVolts Ahh I see, I just saw the 5V on one side of the pot and Gnd on the other and wondered what would happen when the wiper went to 0 Ohms.
it'll be great if you could guide me on how to make a usb midi controller using rotary encoders.
Outstanding! Thank you!!!
You're very welcome!
Truly fabulous! I watched the entire series, even though CZcams served me just this episode, based on my previous interest in other multiplexer/demultiplexer videos.
Have you formally set rights to your marvelous code? Otherwise, would you accept change with attribution?
Thank you. You can use the code as you want and attributions are always appreciated :)
pls do a video on connecting a proper keyboard on one side and a DAW software on other through arduino. I would like to see how DAW recognizes arduino uno as I'm not clear on those things. pls clarify.
hello friend, I wonder if you can use this script to turn the keys of a musical keyboard, because it uses matrix keyboard and sends several notes using the msm pin.
My idea and convert an ordinary keyboard into a MIDI keyboard
Sorry for the bad English, because I'm not Brazilian
Thank you
Luiz alberto Silva yes, I'm looking for something similar
Look up Evan Kale's channel. He did a video on how to do that.-
Vsev Krawczeniuk but this is easier 8 think. I am trying a completely salvaged keyboard to midi.
I had a question: because the multiplexers all use the same control pins, does that have any implications for the polyphony of notes across different multiplexers? Like, say I have an input on one multiplexer pressed that requires the 3 control pins to be H H L, and I press a button on a different multiplexer that requires the control pins to be H L H
This is awesome, thank you so mutch.
Great tutorial, I have a question though: what happens if I press 2 or more buttons at the same time?
Irrespective of pressing two buttons u will able to operate only one button as per select line
@@kartechindustries3069 ok, one at a time, thank you!
Hi Dave! Thank you for creating this series! I've been doodling an idea for a USB midi controller these past few days based on an Arduino, and just last night came across this series! So now I feel confident to make it happen :) I wanted to ask you if it would be OK to use a different Arduino chip, like a Nano, since I'm only planning on using pots (64 of them) and I'd like to make the enclosure as small as possible. I'd also like to power it just with USB, if it was possible to handle 4 16-pin mux and all those pots.
Cheers!!
Cool explanation ❤️👍😊
wow, this is amazing, thank you so much.
I have 2 questions:
1- can I connect rotary encoders ky040 in the multiplexers?
2- Can I connect buttons and rotary encoder to the multiplexers?
greetings and thank you very much!
Holi shit. It is what I'm exactly wanted!!!!
Awesome!
Hi, great videos! I was just looking at your code and was wondering, what would be the easiest way of including a "note holder" function, so that the last pressed note is held for ever until the hold button is pressed again. Any ideas?
Great video! Do you happen to have updated code that works with Arduino boards that have native USB support? I know at some point, Teensy was about the best option, but so many boards now offer native USB. I have a Teensy 3.6 but also several Arduino Leonardo boards, how difficult would it be to modify the code to work with a Leonardo board?
Great video! Much easier to learn than trying to read a bunch of articles. Do you have any videos on using an encoder with an 8 or 16 input multiplexer? Thanks!
I’d like a really simple controller that has an encoder which allows you to dial in the CC e.g 74 for filter frequency, and a second encoder to change the value of that CC number.
Example, encoder 1 set to 74 for filter frequency and encoder 2 to change the frequency value. Record filter sweeps into your DAW. Change the CC via encoder 1 to say 71 for resonance and record changes to resonance from encoder 2. This saves you having to have lots of encoders or having to reprogram the Arduino to use different controller numbers.
The CC encoder would need a 3 digit display so that you can see which value you’ve selected.
I can put the hardware together but can’t program the code. Is there anything out there like this?
First of all, thank you so much for your tutorials they are so professional and well documented. I build this project with an Arduino Uno with a multiplexer and everything worked out, it's really great. But then I tried to adapt it to my Arduino pro micro with one multiplexer and it seems a totally different story. I'm trying to send the midi through the USB port but I can't find the way. Do you have any ideas? Do you know how can I adapt this project to this board?
Great video! I got one question, and it's real nooby - can you rotate both those knobs at the same time and get two signals simultaneously? I know that I connect the knobs directly to the arduino that'll work since no switching has to happen, but with multiplexers I am not sure.
So if you can multiplex a mutiplexer, would it be possible to get 40 inputs into an Arduino Uno? Or would I be better off with an Arduino model with more input ports?
Wonderful video, im also interested in presets...as in if preset is set to 1, the pot controls cc1channel1, if preset is set to 2, the pot controls cc5channel2 and so on...can you do a video on that ? Also use buttons to change presets
What about the speed/strength of the buttons when you push them.
like when you hit the button hard, the note is stronger. And if you hit it slow, the note is weak.
Thanks, bro! I'll try this out soon! =D
Hi, I am using 4051 IC with Arduino Nano with your code. I have added two buttons and modified the code accordingly as you described. But only one button triggers at a time and send MIDI messages, the second one doesn't work, but if I disable the first button in the code the second one does work.
Can you help me please? Is there anything I need to do extra in the code? Do only the 4067 IC works with the multiple buttons?
Hi notes and volts, is there a reason why pin 0 and pin 6 can't be used to connect multiplexers in your code. I like to connect 6 4067 to the Uno. When connecting pots directly to the analog pins, pin0 and pin6 are available. Any way to change the code so that pin 0 and 6 are also mux capable?
Never mind above (typo pin 6 should have been pin 5). Also I already used A0-A03 analog input pins for my test one month ago :)
I got confused by the naming of the address pins //A0 = PIN2, A1 = PIN3, A2 = PIN4, A3 = PIN5. They off course do not relate to the analog input pins . ADDR0-ADDR3 would have been clearer to not get mixed up with the A0-A5 used for declaring the analog input pins.
For the OUTPUT PIN variable, INPUT PIN would have been a more suitable name for that variable as it's used as input scanning and not as output in this application.
Minor details though, I'm very happy with your code!!
Anyways I found out that for my project the Uno is near it's limit. I'm going to use 81 analog pots and 15 buttons for my final project.
When I tried to declare the full 96 analog ins which the 6 analog multiplexers and 16 digital ins on 1 digital multiplexer the dynamic memory exceeded 100% (108%) and therefor I was not able to upload the code to the Arduino. With 81 pots and 15 inputs declared, the code uses 96%. Just enough to fully midify my peavey twelve hundred series vintage mixer.
So anyone wondering what the maximum inputs is for the code to handle: around 96 digital and analog combined.
I changed the pot and button variables by taking out the midi channel parameter. In stead I set the channel fixed now. It freed up some dynamic memory and now I am able to connect 112 inputs at 98% dynamic memory consumption.
Hi There, I know this message dates back a year but I am very interested in your modified code for this project - could I ask a huge favour and ask if you could email me the code please? Many thanks
Yes! Please do encoders!
Great Tutorial, but can you explain what to do with the unconnected Pins from the MUX ? I have read that they should not be free and unconnected ...