How to Build Arduino MIDI Controllers - The Complete Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my nerd musician friend in this video i'm going to show you my complete process of how i build my midi controllers this is actually a summary of a live i did in november which i talked for about three hours but in this video i'm going to put only the most important parts i'm going to talk about midi controllers what they are and how you can build them what's the best brain for a midi controller and i mean what is the best arduino for your midi controller what arduinos are how can you use them i'm going to talk about components how can you use buttons potentiometers a breadboard how can you wire your circuit and how can you program your board without actually having to learn how to code i'm going to show you how to use the code i only show inside my paid courses where you can use buttons potentiometers rotary encoders displays leds motorized faders and more and also i'm going to answer a lot of the questions of the people that watched the live so watch it until the end because it will clarify a lot if you're thinking about building your own midi controllers so let's get started so first we're going to talk about midi controllers and or how to build midi controllers so first thing is like what is a midi controller that may be that might be obvious for you for some of you what a midi controller is but for some people it's not okay so a midi controller is an interface uh that it's an interface that uses the midi protocol so imagine that you have it can be a launchpad like that it can be a mixer it can be a keyboard okay and this interface this equipment wants to send a type of information let's say you have a keyboard and you want to send the note c sharp three at half of intensity like medium intensity okay and then you want to send uh an f-sharp and now you want to like in your jaw you want to trigger a sample and you want to send a midi control change or control a volume with midi control change with a different type of midi message so what is this midi is just information it tells what when and how it tells for example the note which note and when and with which uh with which intensity okay or uh the volume parameter okay uh or the the the pan like the position of the pen so you can control uh things like you can send notes or you can actually control things like the volume uh the parameters are inside your plugin so that's me the midi is just information and midi actually stands for musical instrument digital interface and it's just a language it's just protocol there's no sound with midi midi has no sound okay and some interfaces that can use the midi protocol are called midi controllers okay so you use a midi controller to control another thing to control a synthesizer for example to control a digital audio workstation for example or midi nowadays it's used for so much you can use for controlling a dj software a vj software even uh photo editing software and video editing software like adobe premiere um or adobe lightroom or photoshop so you can use midi controllers for to a lot of things okay but what if you want to control a cut off a filter of a synthesizer with the movement of your hand in the air what if you want to use midi of your daw to control a set of lights in your stage what if you want to control a motor what if you want to create an art installation what if you want to use a the the temperature of the air to make music what if you want to get crazy you won't find this in a store for sure you won't find that on guitar center how to convert the wind the speed of the wind into note so for that you need to build yours so there's a couple reasons i believe and the couple reasons i am in love with of why you should build midi controllers and one is things like that for example this costs this cost me around forty dollars or in brazil here like a hundred and fifty ais or even like 120 ai's and if you bought this like a midi fighter midi fighter would cost you like 200. 250. so building a midi controller is so cheap it's super cheap so that's the first reason okay it can be like five ten times cheaper than if you bought one in a store another reason if you if you like a certain plugin if you like massive uh massive from native instruments the synth which i love or if you like a specific compressor that you use a lot if you have an um generic midi controller your it doesn't look like the the plugin used it's it's not the same so one thing you can do is creating your own midi controller that looks like the plugin that you have so you can create customized uh interfaces that looks like exactly the plugins that you have okay so that's the second reason and the third one is like the first thing i was talking if you want to get crazy you can just get crazy and create anything you want uh with a midi controller with an arduino that i'm going to talk about more so uh one thing that i want to show you here is uh a couple of the midi controllers i have viewed so i am going to um move here to my screen and i'm going to show you some of the midi controllers i have built with the platform i'm going to show you which is the arduino hmm [Music] so [Music] and press here to come back to scale now it's everything mapped automatically for you because of the midi script now you can control volumes sends but it could be anything [Music] first thing i have done was a launch pad inspired on the midi fighter uh so let me just talk a little bit about me maybe you don't know me maybe you do my name is gustavo silvera and i am brazilian and i think we have some brazilians here and i started because two reasons things are super expensive in brazil midi controllers are ridiculous ridiculously expensive and at the time that i was i graduated in music by the way music composition that's what i studied and i have been a musician my whole life so no background in engineering i'm not an engineer i'm not a software engineer electrical engineer whatever i am a musician and all that i learned about electronics and programming was self thought and the reason i started researching that it was because i had an electronic music project and i i wanted to smash buttons and perform and um i didn't have money to buy a midi fighter or even like a push controller for ableton so it's like what if i if i call if i build my midi controller but there was no single place with all the information i needed to build a midi controller so i digged like a duck from all all around the the internet for months and like was a lot of trial and error way more error than uh anything else was it was painful but i was able to make my first midi controller it was super nice then i did another one and uh after i started making some some people started to ask me oh can you do one for me i was like uh yeah if you baby yeah and i did one two three and i started to do a couple people and i thought well there's more people uh wanting probably there's more people wanting to build midi controllers so i was maybe i should just create a vlog and teach people how to do it so people can have all the information they need to build midi controllers in one single place and that's how the nerd musician was born after that i went to the united states to do a masters in music technology at georgia southern university after that i worked at mouse state university as human computer interaction into electronics designer and i decided to leave the united states and come back home to try to live from youtube and courses and this that we are doing today which i love okay so that's why i'm here today and uh i hope you enjoy you enjoy it you you enjoy it too god damn it so okay guys so let's start with what we want we are going to talk about how to build midi controllers so the first thing we need to do is understanding uh the center the core of this midi controller the brain of this midi controller so every electronics that does something uh like a like a drone that's something complex uh like a robot has a brain so be besides your brain you're gonna need another one and for this project or for midi controllers we can use it's not the only option but it's probably the best option for beginners which is an arduino so what an arduino is okay so focus an arduino is a credit sized board that has a micro controller so this thing here is a micro controller and the micro controller will be the brain of your arduino of your midi controller but what an arduino why an arduino we use an arduino because the arduino can get information from the physical world like the touch of a button the turn of a knob so let me get something here like you can get a potentiometer you can turn the knob okay you can get a distance sensor or a light sensor whatever sensor anything that gathers information that from the physical world real physical world the arduino can get that and transform into digital data so the arduino transforms the information from the physical world to the digital world and for example you can get this information let's say the press of a button and in the arduino through some programming and don't get scared with that it's going to be the easiest way for you with some programming you can tell all when you press this button turn on an led for example change the brightness of this led when you turn the knob or send a midi note so we can actually create midi controllers with the arduino so you can see here that this arduino this is the arduino uno and we actually have different arduinos uh let me find another arduino here i just had one laying around but okay it's gone but it's here so this is another arduino so look at the difference can do mostly the same things but they have some differences what are the differences between arduino so for example i'm going to show you here um here so this is the arduino uno this is the most common arduino the most famous arduino which is the one that i have here it has a usb b it has a place for the for a power supply and it has pins that you can connect jumpers which is this thing here is a wire that you can just plug in those holes here and it's good the arduino uno is good because um it's really easy to prototype to test things because you don't need to solder you can just put this jumper in one hole and then put in another one and test your circuits using a breadboard which i'm going to talk about so okay so we have the arduino uno but we also have for example the arduino mega which has way more pins in case you need more pins for your project but it's kind of big and we have the arduino nano which is way smaller arduino pro mini which is even smaller but without a usb we have arduino micro we have arduino pro micro and the pro micro is the one here it is my favorite one and we're gonna talk about why um we have the arduino pro micro we have even like an arduino like that which is the lily pad which is good for wearables if you want to put in your clothes and put a conductive material how do you say um conductive thread you can thread in your shirt and actually make a an electronic thing inside a wearable in a shirt in a pillow so this is great for that we have the teensy which is a type of an arduino it's not made from the company arduino but you can program like an arduino okay so we have those we have many different types of uh of arduinos and some are better for one for something and some are better for other things so which ones oh so just one thing like an arduino also is the name of the company okay and you can find like arduino or genuino our genuino is sold in the united states and uh arduino is sold in the rest of the world and the arduino is open source which means that anybody can get the files of the arduino and reproduce legally and sell it i believe you have to change the name but you can make a board that it's exactly the same and sell it or change and make your own so that's why a lot of chinese chinese companies make arduinos that are so cheap you can get an arduino pro micro like that i guess for two dollars and fifty cents i don't know how much now but they are so cheap and it's legal and it's this people ask me oh is it the same quality of the arduino the original one yes it's the same quality um but probably the same quality this doesn't even matter but why should you buy then the the original arduino to support the project so you should buy at least one arduino original arduino so you can support the project because everything is open source you can use their id with other boards for free so just buy one original okay but then for your projects later you can get from aliexpress super cheap okay guys so um one thing which might which arduino should you buy for a midi controller you might ask and that's um that's a question that i get a lot because we get overwhelmed uh right because look we have many and this is just the tip of the iceberg we have many types of midi controllers so which one should you get so my advice is you should get at least one arduino uno why because it's good for prototyping you just plug the y the jumpers here you don't need to solder nothing and you can test your prototypes you can even use the arduino uno in the midi controller however there are some problems when you a midi controller you want that when you plug it it's recognized out of the box like a midi controller you plug and in your jaw it says oh midi controller badass midi controller is on and you can just use it however when you plug an arduino in the computer it doesn't see a midi controller it sees an arduino and with the arduino uno there's a way you can convert it to midi class compliant which is uh what we call when plug and play you can convert the arduino uno to midi class compliant and that's not all of the arduinos not going to get into much detail because i have a complete video of which arduino to choose uh and just look here in my youtube and explain why but some arduinos can become midi controllers out of the box you don't need to do any extra hack this one needs an extra hack okay and the arduino that doesn't need or some of the arduinos that doesn't need the this extra hack one of them is the arduino micro and the other one is the arduino pro micro and another one is the arduino leonardo they are my favorite because you can just plug and play and make it into a midi controller okay and they are tiny and they are cheap so i usually try to get the cheapest arduino that works in my project so now that you know my advice is the arduino pro micro is my favorite uh micro is good too it has more pins and the teensy it's actually the best because it's tiny it's plug and play and has a lot of pins because there's the pin limitation of how many buttons how many potentiometers you can plug so the teensy zik is actually the best of them and there's different teams there are bigger tinses this is the teensy lc which is great great but the tnc lc the teensy family is more expensive if you live in the states or in europe they're not expensive but if you live in brazil in brazil like me they can get really expensive so i prefer buying from aliexpress the arduino pro mic okay and with the arduino pro micro it has a pin limitation of the number of inputs you can connect i will teach you how i don't know if we're going to have time but there's possible to use something like called a multiplexer an extra component that you can increase the number of inputs of an arduino pro micro up to 100 and something 116 i get i don't know it's a lot or even more so if more than 100 components in your midi controller is not enough for you okay that's a nice project so arduino pro micro is my favorite tnc lc probably the best or a bigger one and arduino uno is great for prototyping and there's a video on my youtube about that so now how do we do that okay so now that now we start to get our brains melted a little bit if it's not yet uh let's just get some water do you have doubts let me let me see if you put anything here yeah milo said that adafruit makes wearable boards he had sized uh besides the the lily pad adafruit has really nice they have their own boards adafruit actually have their arduino compatible because it's open source adafruit which is a company got the arduino project and made different boards based in the arduino that you can program like an arduino so for example there's the feather board which has bluetooth low energy built-in so you can get a midi controller with a bluetooth in just one board so really nice huh okay guys so i want to um talk a little bit about electronics now okay uh oh good question no need for power supply with nano let me get here to the nano good question actually the nano is this one but maybe you were talking about the pro mini so how the arduino is powered like power from the usb or if you're not using the usb you can use this thing here but if you're not using the usb and you don't have this or you don't even have the usb like this how you how can you do it every arduino will have pins here that you can actually connect power through wires so it's not that easy okay so you're gonna have to have your own uh power pin so you can connect your power supply or your battery so for example here vcc is five volts where you're going to connect five volts and then here is ground so you're gonna have to connect uh five volts here or raw you can connect more than five volts because the arduinos are five volts so if you connect more than five volts uh you might fry your arduino so you get uh the raw pin there move me here so the raw pin here you can connect a power supply here that goes up to i don't know depends on the arduino 12 volts 18 volts okay so uh let me see if i have more questions what are your thoughts on the arduino due for midi i never used the arduino due but i think it has you can use the midi media i'm pretty sure you can use the midi usb library which we're going to talk about and you can use it for midi i think that do is more powerful the thing is i i i try to get cheap you know i try to use the most simple cheaper arduino for media i don't there's no reason why use better arduinos like the do unless you have it or unless your project has so many uh components that it gets slow or you want to do lights at the same time then you can get fancy but the tnc if you can want to get fancy the teensy is my favorite um used to be part of a pro micro almost always breaks effort ah that's a great question so he's talking about this is the arduino pro micro and after you programmed it a couple times it just dies bricks it's called brick like it's bricked and you cannot use it anymore and it happened today with me because i formatted my computer and all the software is new and like that was a big mistake um so the my arduino pro micro bricked but there's a way you can burn a new bootloader uh you can't you bootloader is the firmware only complicated words it's the software that comes in the in the arduino you can change its software to a better one and i use the sparkfun bootloader for the arduino pro micro and you need an arduino uno to burn the bootloader in the arduino pro micro i have this i showed this in my course how to do it but how to burn a new bottle loader arduino pro micro if you google uh i if i remember i'm going to put the link in the description okay but it's doable and probably won't happen anymore or not as often arduino dew is 32 bit and it's 84 hertz yeah it will be faster it will be faster but doesn't mean that the arduino pro micro is not fast enough so um i don't know if you can perceive the difference if you don't use like hundreds of buttons but only with testing to know but definitely an arduino dual is way faster and if you're doing lots of things at the same time then a faster arduino is good so tara's music channel i am the process of making a midi harp with 36 strings i am not sure whether i should have used a do it do or or mega um i don't remember how many pins do have as i told you i would use an arduino pro micro with multiplexers i teach how to to to do this inside the course and i'm going to show you in the code what you can do i don't know if i'm going to have time to show you exactly how but i'm going to share you with you the code that i only share inside my course with you guys which is the extended code where uh you can use multiplexers really easy oh he said that the usb port breaks physically from the welds i'm sorry i gave you a whole explanation and that was not the question oh yeah micro usb it's not ideal but you can um get another like a usb extension and use a usb extension with usb b if that's the problem uh you can even use uh get another usb with wires so that's there is a workaround but the usb of the arduino pro micro is not great there are arduino's pro micros coming with a usb mini now on aliexpress not the micro but the mini so take a look there um okay so let's go here uh let's talk a little bit about electronics okay so two things we have to know we have two different off inputs in the arduino digital and analog and that's important digital type to think of think about a digit just one digit that's one or zero one or zero on or off pressed or not pressed pressed or not pressed okay so a digital input in the arduino you you will connect components that's just on and off buttons and switches but analog in the analog inputs you're gonna connect things that have a minimum and the maximum it's just it's not just on and off okay so potentiometers uh any type of sensor you know that uh have an information that's analog to the real world something that's minimal like a distance you know you have a minimum and a maximum and infinite numbers in between any type of sensor that works like that you will connect in the analog input so let me just show you something here so for example the arduino uno those are the digital pins where you can connect buttons so it's digital inputs but also digital output so you will connect buttons or leds motors but let's just talk about inputs so here from 0 to 13 you're going to connect and we will avoid 0 and 2 because these two uh pins here can be used to exchange serial information whatever that means for now so we're going to use from 3 to 13 in the arduino uno for example and in the arduino pro micro from 2 to 9 to 215 here if you take a look here which is the arduino ups arduino pro micro pin out you can see that what is uh i think what is you can use as a digital pin so you can see that even the the ae382 can be used as a digital pin and the analog pins which are green are these ones a0 8 2 a3 from analog one but you can also use this pin here as a 10 this one here is a9 a8 a7 a6 so some so sometimes just looking at the arduino itself you don't know exactly which pins can be used for what it's not that obvious so you can google arduino pro micro pin out and you can see which ones are analog or which ones are digital so how do we connect a button or how do we connect a um a digital pin so a button is really simple so where's my button one leg you can see that you have two legs so how a button works when you press a button it closes the circuit the energy will flow through the button when the button is not pressed the energy is not flowing but when you press the energy is flowing the electricity and one pin one terminal you will connect in the arduino digital pin and the other one you will connect in the ground so for example here this is ground this is a digital okay so one pin in the digital one leg in the digital pin and the other one in the uh ground the arduino will be reading in the digital pin the current will flow through it so when you press the button the current will flow and the arduino will read a voltage a change in the voltage okay so when we get this state change in the voltage we're gonna talk we're gonna tell the arduino to send a midi note for example but the potentiometer and guys i have some free videos where i teach this um maybe more in-depth or edited in a video here in the youtube too you can look for diy midi controller workshop but anyways a potentiometer and i'm going to change here to my to my table so okay so here my table so here's a potentiometer and you can see that it has three legs so i'm not going to get it much into detail but this leg goes to ground this leg goes to five volts in the arduino and this leg goes to an analog pin of the arduino so ground five volts and analog pin of the arduino so how can i actually build a circuit with the arduino without actually have so let me just look in the chat here before we get into the circuit here so questions about components about the electronics i know that we talking a lot but it is what it is that's a lot a lot to cover is rotter encoder better choice than potentiometers that's a great question uh i think i have a rotary encoder here yes i have one here so i can show you so here is a rotary encoder with click so what is a rotary encoder it has infinite some people call it uh how can i say um infinite potentiometer or something like that because a normal potentiometer has an end beginning and end and a rougher encoder no it just increments uh like one two three four five six seven or uh ten nine eight seven just goes down or up rotary encoders are great because a potentiometer has a absolute position so if it's in zero it's in zero and for example if you want to map a potentiometer to two different parameters parameter a and parameter b and you can change the midi channel to do that use the same components to map two things when you move the knob let's say you mapped parameter a and left in zero then you moved to the to you changed your midi channel and now you're you uh you mapped parameter b and you moved to 10. you're okay parameter one is in zero and two let's say a and b uh parameter a is in zero and b is in ten now i want to move my parameter a again but remember that it was in zero but now my potentiometer position is in 10. so when i move this it will send the value 10 or 9 to that parameter a and it was hearing 0 it would like that but it will skip to the value 10. so that's a problem when using potentiometers when you want to use the same component to map different things with that being said a rotary potential a rotary encoder doesn't have this problem it's just absolute you can program this in a way that parameter azim is in ten okay so you start in ten oh that now i changed to to bank a and it was in zero oh i can start from zero it is great right but great powers come with great responsibilities and the problem is that it is way harder to use first router encoders are not analog they are digital and they have two digital pins they are hard to use you take the making music with arduino course where i teach exactly how to use rotary encoders exactly the way i told you so in my code in the code that i'm going to show you today it implements rotary encoders but there's another problem rotary encoders take two digital pins and um can't be multplexed you can't use a multiplexer that thing that i told you that increases the number of inputs of an arduino for x reasons so you need so each encoder needs two pins and uh can't be multplexed so if you want to use eight encoders you need 16 digital pins um so you need an arduino with more pins so for example if you want to use eight router encoders you can use the the teensy llc and there's another catch uh it needs to be a special pin it's not just digital pin is a special digital pin with interrupt so there's um there's a lot of things about encoders which which make them hard to use they're great but they have this problem also some people like to know exactly where they are in their um in their knob you know i know i can see because uh with encoder you can't see where you are where you are unless you have an led ring like many controllers have but also to create an led ring is hard so roger encodes router encoders are super hard but totally doable but inside the course i also teach exactly how to do it um and i am i'm actually designing a controller with eight router encoders to use to control macro controllers inside ableton but anyways let's see more questions uh what do you think about interference my pots never stay ready even if not touched so i have to round up okay so what about interference interference is a problem that can be overcome um inside my code you have a pretty stable reading in my potentiometers but it is because i am using a filtering algorithm that comes the using a library which is the responsive potentiometer library and you're gonna see that even in my code when you in the debug mode when you're just looking at what's going on you can see that there's a responsive reading so that's that's a game changer so if you use the responsive um responsive read or something like that uh library it basically solves this problem it changes everything okay so that's a problem but uh inside my code you're gonna get a pretty stable reading i'll just have a gotta tractorino nice tractorino was a project that i did for djs okay guys so let's come here um i'm going to turn me off here so this is a breadboard and what is a breadboard is something that you use to create connections without so you can see here if it focus but if it doesn't focus whatever you can see it here that has lots of holes that you can plug jumpers so i can create a connection with a jumper like that without soldering and again uh if you want a more in-depth improv more in-depth video go for my diy midi controller workshop imagine that every like this part here every column has a conductive material below it so if i connect let's say in 35 here this is a column 35 there's numbers there and i connect another wire in line 35 i am connecting these two wires here because both are touching the same conductive material so every column so this is divided so this is a division so it's not connected all the way through but it's connected in every column here in every column here in the vertical line and here it's in the horizontal so why we have this horizontal line sometimes we need to connect a lot of components to the same thing such as to the ground we need to connect every component to the ground so how can we connect all those components like tens tens of components into the same ground we use a common ground so my arduino is connected the ground of the arduino is connected to this blue rail here you can see here you can see that two there the ground is connected to the blue thing and buttons are connected to the blue thing and potentiometers too the five volts or the positive is connected in the red line so that's blue usually connect your common ground and in the red you connect your common five votes so that's how you use a breadboard in a nutshell basically you can use to connect things without soldering so here what i have i have three buttons one leg of the button is connected to ground and the other one is connected to and pin four i have two potentiometers one is connected to the other one to five volts and the middle one is connected to an analog pin of the arduino one this one is connected to a0 and this one is connected to a one so that's all you need to do here in this breadboard of course you can add more components but for now we don't need that so guys that's it for the circuit for buttons and potentiometers is it's quite easy this is pretty straightforward it's having some water and now i want to show you how you can make it into midi so um i don't just want to show you a quick example using an arduino which is probably the first thing everybody uh do of like how you program your first arduino um okay so here is my screen and i want you to go to arduino.cc so arduino.cc is where you can download your the arduino ide so what is an arduino ide an arduino ide is what i'm opening here the arduino ide is this integrated development environment and you program your arduino one thing that's really cool about the arduino and you can come here to software and you download the arduino ide i'm not going to do that okay you can download there when you want but what you get is the arduino ide i'm opening here because of the live stream the my computer is super slow but hopefully we can get that going so guys please questions right now while the arduino while the id opens how can i make alpha next for next cse ask how can i make arduino nano a midi class component well you can't you can go to the description of this video and there's the code and you can go to the github page and you can download the two you can download the two of them okay um that is the code that we're going to use here in the arduino and one thing like why it's going to be easy like why programming can how programming can possibly be easy well programming is not if you want to program your arduino like i did from scratch all the code that i use i made it of course i use libraries i adapted things from other people but everything i made it and i have been working on this code and i only use for 90 of my projects uh let me change to me meanwhile and i use for 90 of my projects the same the same code the same arduino code well guys my id is not opening i'm starting to get a little bit worried okay so getting back to the to why it's going to be easy for you because oh it's opening now one thing that's really um nice about the arduino community is that many people share open source projects like i do projects that you can just download and um you just need to have a little bit of knowledge of how to use an arduino ide which i'm maybe going to show you here the arduino ide but i also show you in the diy midi controller workshop actually today i wanted to show you way more how to use my extended code that i only share inside my course which is the full the extent that i don't remember the name but it's the arduino full something whatever which i'm trying to open but maybe yeah it's super super slow but what i do or what what i do is at least what i do inside my course the making music with arduino besides that by the way there's i have three courses one is the making music with arduino the other one is the making music with arduino the arduino programming and the other one is the kicad pcb design so three courses the arduino the making music with arduino the making music with arduino is a course where i teach you how to build midi controllers without having to learn how to code you only need to adapt some things in my code and i go step by step what do you need to adapt to use buttons how many buttons where those buttons are what do you need to adapt to use a potentiometer what do you need to adapt to use multiplexers to increase the number of inputs how to use leds like how to use normal leds or digital leds so you can get led feedback how can you use motorized fader how can you use rotary encoder how can you use this place to actually see which channel you are actually in basically uh what i teach is how you can do it the in the easiest way possible and the arduino programming the course is where i teach you how i did that how i program those parts i teach you how to code if you want to learn how to code so the first is i want to be build midi controllers without learning how to code fast that's the making music with arduino i want to also learn how to code that's the arduino programming and then i want to learn how to build my own printed circuit boards like that like this is the traktorino this avoids wire like with a pcb you don't need wires for the rest of your life and it's easy to assemble way easier to assemble way faster to assemble way more reliable looks super professional and like the track torino got super popular just because the pcb is super cool and it's super powerful and super easy to build okay so with that being said um let me say let me see some questions here how about sliders and they don't require require a 10 bit adc a buddy of mine in berlin has been working on a cool midi controller with faders and he also built his own stainless steels okay so his sliders are exactly the same thing as rotary potentiometers in a different layout this is a a potentiometer is a variable resistor you just change the resistance is like a resistor like you are decreasing the amount of current that flows through it and depending on how much you turn you you decrease or increase the amount of current that flows through it and then you can read this in the arduino a slide potentiometer is exactly the same thing uh the arduino has a 10 bit adc so i didn't talk about resolution about bits maybe we should but maybe it's too complicated for now but uh you need to convert analog to digital because you have the world is you have an infinite numbers between two numbers that's reality and until you can divide until it's not divisible anymore and it used to be the atom now we have quarks and things like that but let's say it's infinite but the computer doesn't have infinite divisions between a and b you have to quantize this a to b so let's say you have zero to five volts which is the voltage of the arduino so you're gonna change between zero and then you need to convert this to a set of numbers you need to quantize this to a set of numbers so you need an analog to digital converter and the arduino has the analog to digital converters in the analog pins so that's what analog pins are and the arduino has a resolution as resolution is how many numbers you can put between the minimum and the maximum the arduino has a 10 bit resolution in its analog pins which 10 bits is like 10 ones and zeros how many combinations of ones and zeros you can get with ten you can get one thousand and twenty four numbers so ten bit resolution gets you one thousand and twenty four does it does it mean that midi has 1024 numbers have you ever noticed that midi only goes from zero to one to 127 so 128 values so instead of 1024 you only have 128 because the midi protocol resolution or what fits in a midi message is only seven bit quite feel it's not much so um however there are ways you can combine two bits of seven and get 14 bit resolution which gets you i guess 16 384 numbers and i teach you how to have how to use high resolution faders inside my course too um it's a way you have to combine two bits uh i i know i don't know if i'm answering your question or just talking more but um resolution is a thing and midi only has 128 possible values unless you create you do something in the code which it's super easy to do in my code you you just do like one line like tata and you can uh high resolution faders and you can get 16 000 blah blah blah okay so okay guys i have the arduino id here and let me get to my board again okay i'm not going to use the arduino uno because it's super slow just for opening an arduino project okay so i'm going to just stay with the arduino pro micro which is the one that we're going to use for our midi controller and i'll do my best here so we can so you can see what's going on but yeah it's super slow but here is the code that i want you to use which is this there's the date which i last updated it and the diy midi controller full there's the diy midi controller which only supports buttons and potentiometers but there's this one that supports well this code supports buttons potentiometers rotary encoders motorized faders displays leds addressable leds multiplexers um high resolution faders and many things so it's quite powerful okay guys so i don't know if you'll be able to use this today but at least i well i want to show you okay so you're going to open the first file and you can see that it has lots of tabs each tab is responsible for doing one thing in the code so the whole code is all those tabs together um but we only change things in the first only change things in the first tab this is where things happen in the background and here's the first tab is where you configure things so the first thing is choosing your board you can choose it implement this code also implements different boards the atmega328 family which is the microcontroller of the arduino uno the mega the nano but this is not midi class compliant you need an extra hack you need hairless midi to convert serial to midi and i'm not going to show you how you can do that and it's increasingly less stable using hairless midi so i try to avoid hairless midi and i try to avoid arduino unomega um for for my final projects okay only for prototyping then you can use atmega32u4 if you're using atmega324 family which is the micro pro micro and leonardo which are the ones we want for final project or the teensy and there's this debug thing here if you just want to debug the code in the serial monitor so this will make you a midi controller and this will make you this is for you to see the messages that are happening this is really important really really important i always start with debug because i will press the button and i will see in the serial monitor which we can open here which type of message is arriving so no message is arriving because our midi controller is not set to debug so we are going to copy this and only paste here debug so how we can use encoders potentiometers blah blah blah this first section here is where you turn things on and off and to turn something on or off is simply as typing two bars until it's grayed out when it's gray is just a comment it doesn't do anything but if i delete it gets color again and now it's something see the comments here after the double bar comment if not using buttons so to comment is double bar so i'm not using buttons now so i want to use buttons so i want to define this not comment so here i can turn on buttons potentiometers use a multiplexer i can turn on encoders now pixels which are addressable leds a display i can use banks which is great to use with displays and encoders i can have banks and i can change those banks using buttons and for example i can have banks for buttons bank for potentiometers a lot of things and i explain each of those things in the course uh here i can also now uh use like this is a bit shifter it's if i want to increase the number of outputs of your of my code if i want to use many leds how can i use that use a bit shifter which is something like the multiplexer it increases the number of outputs so a multiplexer increases the inputs and the bit shifter increases the output are you using a vu meter you can use the leds as a vu meter so i have here also coded uh how can you use like a bunch of leds to behave as a view meter although a view meter can only be used with traktor or ableton live using a max for live plugin i i created uh do you want the leds to be used as a view or led feedback like you play a note and the led turns on here high resolution fader so for example if i do this now i am using high resolution faders nothing else more motorized faders and even if you want to use with the mackie protocol to use with pro tools also if you want to change octaves with buttons so many things you can turn on and off for now we only want buttons and potentiometers before we go forward let me see if there's any questions what about midi 2.0 uh midi point to midi 2.0 i didn't actually take took like a great look at it i know that's going to improve a lot of things but i'm not using the ad here in the in the the midi controllers i'm really curious about like if you guys uh know more you can tell me i know that mpe midi polyphonic expression uh got a big improvement things like that uh resolution but i'm not totally aware of how to use it in the arduino yet okay another cool thing are piezo surfaces yeah piezo are a little disk that you can tap and it tells you the intensity of your tap it's good for you to do velocity sensitive things but not great piezo have piezo has a lot of problems which you should use another type of material which is called um velo velostat anyways i'm not going to explain how to use velocity sensitive sensors right now because it's a little bit more complex but you can do something with uh piezo if you're not using like many piezos like close together because you can touch one and the surface can vibrate and vibrate the other piezo and you can get false readings and um i don't think like dan said i don't think anybody needs me 2.0 well with high resolution fader i yet don't see a reason to where i need and even with the xt synth that instrumental looks like a guitar i did it uses midi polyphonic expression uh just like the roly seaboard exactly the role exactly like the roly seaboard i use in the axis synth and with normal midi so it's really because i i don't see a reason why right now i need it but if i need it i'll start using okay so after we chose what we are using now we need to calibrate things or uh we need to set things up and when i say things set things up so here are the libraries that i'm using you don't need to change anything here don't need to change anything here in the libraries until you get to this thing here button so here is where we start to configure things and it's pretty easy can be a little overwhelming because there's a lot of lines but if you just find what you're looking for you can press ctrl f or command f to find things so if you type like buttons and read the comments total number of buttons number of buttons in the arduino plus the number of buttons on multiplexer one plus buttons on multiplexer two so all the buttons summed you put here so i have how many so just type three here then here number of buttons connected is straight to the arduino because you can have buttons connected to the arduino you can have buttons connected let me open make it bigger here you can have a multiplexer so this is a multiplexer now this is a multiplexer and this increases the number of inputs so you can have buttons connected to the multiplexer okay and that's going to be separate so the only thing we need to change right now is number of buttons in the arduino or number of total number of buttons which is three then total number of buttons in the arduino which is three because all of them are connected to the arduino and here the pins of each button connected is straight to the arduino so pins of each button connected is straight to the arduino not the pins connected to the multiplexer so i am connecting in pin two three and four here is if you are using a multiplexer which we are not but you can configure here your multiplexer pretty straightforward too now this is nice what type of message you want to send here you can configure if you want to send a note number because like midi notes c c sharp which are in numbers in midi so like i guess 32 is a c c3 no 36 is a is a c and you can use ctrl change and you can use and um toggle is like you press one time and then you press another you press one time you get a note on and you press another time and you get a note off and guys we're gonna do a 30 seconds break i'll be right back if you want to get a t go the bathroom that's what i'm going to do right now because things are getting crazy right here so i'll be right back and we are back oh my god how can we possibly be doing live that long without going to the toilet good luck for us okay let's see the the questions halfway testing the midi drums if you have time we'd love to hear about your thermi yeah we can talk about that later if i ever if i ever done pcb printed fsr sensors so um just a second i'm going to grab something here so about the fsr so far sensitive resistor not exactly but almost so this is a pcb i've done i made and um this is the pcb that i actually do in the kicad course i show you how i did this i created this pcb while recording the course so that's everything i did here it's in the course the kicad pcb design course and this type of pcb is made for you to use with rubber pads so how does this work the material that is here is the same um as the velostat it conducts energy but depends on how pressed it is it conducts more or less energy so it changes its resistance depending on how much pressure you put on it okay and here i'm going to make our life easier and here each of those things here are basically just two connections two terminals it has a fancy um it has a fancy drawing here but basically it's just two terminals and when this thing here touch the terminal we get a signal and this type of thing can be used for um something like that can be used for sensitivity okay so i'm not going to use this with velocity it's just on and off and this thing here the feydwino will be a fader port clone let's say you know the fader port with motorized fader that's the idea so i'm going to connect this motorized fader is going to be in the side and all of these will be a functions that you can control the daw there will be a rotary encoder here and a motorized fader and it will be so easy to assemble because there's no buttons you need to solder you just drop this here and it has leds so each button can have a different color so yeah it's a it's a nice project i can't wait to to get this done like the full controller so let's come back where were where were we uh let's come back okay so let's configure our buttons so here put here the type of message oh sorry you're not seeing my screen okay so now we need to edit this here is put here the type of message you want to send in the same order you declared the button pins n n for node number cc for contour change t for node t for note number but in toggle mode this is pin two three and four so this that's the order i declared first second and third so now i need to tell do i want a note number control change or note number in toggle mode so i have these three options so let's say i want node number note number and let's let's keep like that i'm just going to change it here just for you to see so first would be control change second node number and then node number then here we need to tell which number we want which node or which control chain so i want to send control change 11 let's say and then node number 36 and node number 38. now our buttons are configured we need to configure our potentiometers so go down a little bit until you find potentiometers and it's pretty similar number total number of potentiometers we have number of parts connected is straight to the arduino we have two if we are and out and the pins now for an analog pin you need to declare with an a in the beginning a0 a1 so first potentiometer is connected to a0 and second to a1 same if you're using multiplexer you're going to configure multiplexer here and here potentiometers will send control change no matter what in this code at least for now you can send pitch band but mostly you just want to send control change and here you can type the number of the control change you want to send and that's all all you need to do to build a midi controller to program midi controller there are other things you can do like put wires and solder but make an enclosure but we're going to talk about more about it you know things here for example if you want to use encoders you're going to same thing you're going to tell the number of encoders you just change this oh by the way things with the star are the things you can change for example this doesn't have a star this doesn't have a star doesn't have a star um this should have a star so you will change if i remember uh you will change things that have a star here okay so number of encoders then here uh the pins of the encoders but then it starts to get a little bit more complicated you can actually start presets um you can set up your basic midi channel for the button potentiometer encoder here for example you can change the colors of your um if you are using led feedback with like a like a midi fighter with a button that changes color you know you can change the color of your buttons here you configure the bit shifter configure the view the motorized fader because then you need a mode or two it gets more complicated when you go down like to things like motorized fader so but even then you can just this you need to configure you know that's that's not much you don't need to learn you don't need like a college degree you know you don't need months maybe a couple days you know but that's all basically at least if it is working okay a part of the part of the maker journey is learning how to troubleshoot is finding where the problem is and trust me you're going to get problems you're going to have problems i have all the time with time and with techniques like i have codes just for you to help you with debugging i have a class only about how to debug how to find the problem how to troubleshoot you know which is huge i guess learning how to troubleshoot but anyways we want to see now in the serial monitor first we need to select the board and if this doesn't get too slow okay so i want to select the board the spark phone pro micro actually you will have to install the spark phone pro micro board and well i'm not going to show you how here but you need to install the spark from pro microboard actually it comes in arduino avr boards the micro it's useful but probably it might it might brick your arduino and if it gets bricked also you need to unbreak it until it works flawlessly but anyways you need to change you need to choose your board could be an arduino uno for example the dewey but i am going to select spark phone pro micro uh and port here you need to select the usb port where your arduino is connected usually it's this usb modem it's midi now because it's working as a midi controller but it's something usb or com4com 3 if it's windows and that's all you need to do so then you have here verify and upload verify will tell you if you have any error in your code so you're going to see here this by this bar that's very fine is it possible some more info about multiplexing multiplex config dude multiplexing is a little bit more complex i have all the info you need inside them inside the course the making music with arduino but right now there's no way like we can talk more because there's a information about how you connect the multiplexer and why you connect that way which pins are which but yeah know that this code here um you can use with that and oh and when you download the code and things like that you can see the schematics and i have this schematic for the multiplexer so you can see at least how i am wiring the multiplexer okay so you can see here that's done compiling if i got an error it would show the error but i'm not going to try to get an error here i'm trying to avoid wasting time so then you click upload so now the arduino um will receive the code we we will upload the code through the usb and almost there okay so we are done then because we are in debug we're gonna open serial monitor it should be eleven fifty two zero zero bout baud rate if everything went right we should see something when we press the button button zero channel zero cc eleven value one twenty seven then value zero when we release so channel 0 actually means channel 1. arduino language 0 is 1 when we convert to midi in the channel at least so remember i chose midi cc 11 then 2nd button note 36 velocity 0 then when we release velocities 0 so 127 and 0 button 2 or the third button node 38 exactly like we configured so it means that when i change this to arduino um or to midi i'm quite sure it's going to work if it's not working here it's because either you did something in the circuit or in the code okay and then you need to troubleshoot now potentiometers parts 0 channel 0 cc1 value you can see uh from 0 to 127 and you can see here that responsive value that's the actual reading by uh that's the actual responsive reading or the the reading with the filtering remember when we talked about unstable potentiometers and how this code supports or how this code solves this makes a responsive or stable reading so that's the stable reading i could put here the not stable but that's all all i wanted to read here so you should have value from 0 to 127 and here value from 0 127 and it only should move when you move the potentiometer if your potentiometer is moving like if you're seeing values coming here changing without you touching the potentiometer this might be because the breadboard uh that's going to be more stable when you solder but you can increase this value here go to potentiometers and there's this variable here var threshold threshold for the potentiometer signal variation because it's always unstable a little bit it's always moving a little bit even if you're filtering so you need to tell the arduino only send the midi message if the if the change is bigger than so here i chose eight and eight is an arbitrary value that i found testing okay you can increase this if you are getting a jittery potentiometer but don't do too much do as little as you can okay guys um now i'm going to go to midi monitor try to open midi monitor which is going to be a software that i'm going to use to to monitor the incoming midi message so see here that i don't have any midi controller and if i press a button nothing happens only happens in the serial monitor but if i choose atmega32u4 it press and press upload because everything was working now we should have a midi controller um yes please explain explain responsive reading so uh the reading so there's something that's called um floating which is a noise because every power thing every electronics have some noise from the from the power from the like the the current of your home for even from your finger like from you you have electricity and you interfere in the in the uh how do you say the magnetic field of the arduino around the arduino so it's always jittery so you never have like if you read the potentiometer in one place you never have only like a hundred a hundred and a hundred and a hundred it's going to be 100 103 98 104 really fast changing really fast and there there are algorithms that try to fix that i don't remember the name of the algorithm used in the responsive um which is what is the name of the library i have the library here let me find the library responsive analog read that's the library which gets this reading applies some sort of algorithm some filtering algorithm and then you get a responsive or a stable reading from the analog read of the arduino it does all the work for you okay so this library is great um so i think that now if we open midi monitor you can see here that i have spark phone pro micro in my midi controllers so what the hell is that midi monitor is just a software for you to monitor incoming midi message just to see what's what you're getting from your midi controllers it can be from any midi controller okay um so let me just fix something here so okay come back to midi monitor so if i press here now you can see that i am sending ctrl 11 you can see here 11 in channel one and if i press the second button i am sending note c one z 127 velocity with maximum and zero and then here i am sending d1 127 and zero here i'm i'm sending also my midi control change which we can use to map things and everything is working guys if it's working here it's going to work in your daw i'm just going to change something because are really low and i want um higher notes because the pitch will be too low for you so where are we in our buttons okay so notes 36 and 38 let's 60 and 64. okay so let's upload again and hopefully guys we're we're getting to the end we're our midi controller is ready i'm just going to talk answer more questions get to a little bit of some anything that comes to my mind about enclosures but i just want to show you that we went from scratch until we made some noise and we want to do something in ableton live right after and if you have any other sort of questions please put in the comments it's uploading the code almost there you can see when it's that it blinks when it uh uploads the code okay so let's make sure we get other notes yeah so able tone so let's get some instrument let's get a piano not this one okay electric piano basic and first you also need to configure the midi controller in ableton if it's not too slow i can open the settings but it's going to show as arduino pro micro okay let's open the settings everything takes ages here in midi you can see that now we have spark phone pro micro in in and out we only need to use s in because we're not using leds for example if we were using leds you could use out and select track and remote track is to actually play notes and remote is actually to map parameters so now that was my mystery sound if i press here we should listen to a note so we have our amazing two notes midi controller and this i was like oh my god it's not working but because this one the first button is only for mapping so i can for example um let's map the play button and you can see here that is cc 11 so now if i press here we don't have it stop bar should be in on my keyboard so okay so now we can hear notes but what uh what about mapping things so i'm going to click here on pan and move this knob you can see that mapped and i'm going to uh map to this send here this other potentiometer so now you can see that it's changing the pan [Music] and we can add some delay the play button and note and we mapped the pan knob and also the send okay just waiting a little bit to know if you are there okay so i wanna talk now okay guys so that was successful so how can you go from this to a bigger midi controller you know from something like this the process is pretty much the same but instead of using breadboard as connections you're going to use wires so here i have an arduino an arduino pro micro and i connected all my buttons and potentiometers in the same style as i showed you here i'm not using even a multiplexer it's just the same there's no mystery there just in the code i would say which button went where and which potentiometer went where you know how many and the type of message i want to send you know uh something that might then it's complicated it's the encode the enclosure um the enclosure is i think the enclosure is the thing that i took more time to figure it out to how to make like a professional enclosure let me get another midi controller here like this one this is the midi mode and it was inspired by the minimoog app so you can see that's pretty similar to the minimoog plugin you know you have you can select waveforms uh you have the parameters for filters but that's just a midi controller it's just lots of knobs this has a multiplexer with an arduino pro micro that's how i have that many knobs but that's just a midi controller in the same layout of the minimoog plugin which is a plugin that i really like and um you can see that the enclosure of this one is pretty similar to the enclosure of this one but this is wood with varnish but the design the way they mount is pretty similar i design all my enclosures inside fusion 360 which is a cad 3d software and then i export the files to laser cut and uh i have some fusion 360 videos here in the in my youtube and i also start from the same template uh i i only choose like what's the length blah blah blah height the width of the material and the whole design adapts itself it's called a parametric design where you just change some numbers and the whole design changes itself the only thing i need to do at every project is designing where the holes will be which is kind of easier and uh and then sent to a place to cut the the enclosure this is wood i cut with a cnc but the other one is acrylic i cut with a laser cut there's two companies in my town so i advise you to look in your town to see if there's any people using laser cutters or cnc's or look for fab labs or maker spaces hacker spaces usually usually they have or on the internet you can find at uh ponoko.com or scuptio put laser cutting online and you find it there's many services but it's more expensive if you can find it locally it's going to be uh great okay what else um let me come back to myself okay guys tell me did you like it give me give me your heart there in the comments of course likes and subscribes are also welcome so yeah i know there was a lot of content but there's even more to learn about how to make midi controllers and if you want a step by step in an organized course you can check my making music with arduino course below for building midi controllers and its brother courses which is the arduino programming and kicad pcb design where in one i'm going to teach you how to program and in the other one how to design your own printed circuit boards this way you can become a really pro maker will be able to build your midi controllers the way you want super professional and even sell it and make some money with it and please put your doubts here in the comments that i'll do my best to answer and of course if you didn't yet please subscribe and ring the bell so you help me too so that's it for now ciao
Info
Channel: Nerd Musician
Views: 77,027
Rating: undefined out of 5
Keywords:
Id: IwfycC8rLos
Channel Id: undefined
Length: 76min 47sec (4607 seconds)
Published: Thu Dec 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.