Tutorial: How to use MIDI devices in Unreal Engine with TouchDesigner

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Oh awesome will definitely bookmark

👍︎︎ 1 👤︎︎ u/[deleted] 📅︎︎ Dec 30 2020 🗫︎ replies

Let's bookmark this : )

👍︎︎ 1 👤︎︎ u/Viper2014 📅︎︎ Dec 30 2020 🗫︎ replies
Captions
hey guys i'm gonna teach you how to use mini devices in unreal um i'm using touch designer to transfer osc messages into unreal so to get touch designer you just go to touch designer's website derivative ca and slash download is where you can find the download you'll have to make an account it's free to make an account it's free on both mac and windows so anybody should be able to follow along with this just going to open touch designer i'm just going to really quickly go over some basic things in it we don't have to do much um you right click to select multiple nodes i'm just going to delete these double click to add stuff and then you can pick any of these these all do stuff the purple category is like video stuff so i'm going to add my webcam and give us a little feedback of what i'm doing and the first thing that we're going to work with is the midi map n which is a chop which pretty much all the stuff in this tutorial is going to be chopped so we need the midi in map and there's nothing yet so we need to create that midi device mapper and dialogs we go to create new mapping and you should see the device that you want to map should have it plugged in and touch designer will see it here and you select it here and then we need to make our own midi map so when i move this slider here you see that i have some input so i'm going to move over to devices and add a device and i can use this input here to assign sliders in this tab here so the important number is the middle number b zero doesn't matter if this is a question mark and these is just a variable so the only number that matters is the one in the middle so 13 the second one is 17. third one 1b so they do have letters in them too so watch out for that and the fourth one is one f i'm just gonna do four sliders and four faders just to keep the video short 12 16. okay so that's four sliders and four knobs so we can move on the buttons they have an on and off my message sometimes it can be different for on and off but most of the time it's the same number so just keep an eye out for that too okay so that's four of each i'm gonna give this as a name that means something and then we go back to device mappings and we have to add the one we just made here and then it should have everything that i just assigned in there and working so we can get rid of the dialog and see that we have our controller input here now what a lot of people would probably do in touch designer is string off here and rename and have a bunch of nodes do stuff but to keep it simple i'm just going to double click to create a new node and click constant and i'm just going to add a bunch of these and then just rename these so a constant is just basically like a bank of values in touch designer that you can give custom names and so i'm just going to name this slider one slider two slider three uh okay so that all looks right so these are the values that are going to have names that are significant and unreal and it's important in my opinion to have them be names that make sense yeah even faders and knobs are categorized as s here so it's just helpful for them to have names that make sense so what you can do in touch this is what i do a lot is just make chop viewers active with this plus sign and once it's active you get this arrow and if you click on it it allows you to drag the value from any of these to a value in anything else which is a really cool thing in touch designer so i'm just going to drop it here and select chop reference and now slider 1 in my constant is being driven by s1 from the mini device map and i'm just going to follow that for everything that i want to do go up to the knobs and the buttons so i didn't finish doing the entire mapping so you're seeing two but it's not gonna cause us any issues oh and you can make these really big if you're having a hard time clicking on them you can change the node sizes to anything you want to touch designer so now all these have a name that means something and it looks like they're all working so i'm going to move on the only other thing we need to get this going and unreal is um double click all we need is an osc out so plug that in here by dragging this to this and now this osc out is populated by this constant and the thing with osc it's just going to send over my local ip address so there's not really anything that's going to mess up between the same computer usually osc is kind of used to send data from one machine to another but we don't need to do that here so but we do need a port and the port that unreal uses is 8000 by default with the plugin we're going to use so i'm going to change the network port to 8 000 and hit enter so that's pretty much ready to go as far as the touch designer portion for this tutorial i could go deeper into touch for days but for right now i just want to show you how to get these values and unreal so i'm just gonna not close out of it just drag it somewhere because if you minimize it the data won't send anymore so i'm just gonna open epic games launcher and go to library and i'm gonna i can't even remember how to launch a new project let's see here so i'm running 4.25.4 i haven't really dug into 4.26 so this is like the newest one that's been out that i've been using so it's pretty up to date it's not the newest okay cool so we can start or create a new project here i'm gonna choose game next um i'll just do third person um just name it something and yeah that all looks fine so i'm using an osc plug-in i watched a video on youtube on how to compile it and it works if you just have it already compiled and drop it into new projects so i'm gonna just leave the link of the compiled plugin in the description of this video so all you have to do is drag this folder into your project and you should be good but if for some reason you want to watch that tutorial where you compile the plug-in this is where i got it from kat sullivan this unreal tutorial she's great it's cool check it out if you want to but i opened the project it exists now i um i put it in the default where unreal puts projects so i'm going to find where that is it's in documents for me unreal projects or maybe it's not unreal projects maybe yeah here we go so this is where you're going to need to drop the osc folder into this folder needs to have a new folder that you're going to name plugins and that's it all you need to do is drop this osc plugin folder into the plugins folder that you create at the root of your project folder and i'm actually gonna close out of this launch unreal again and open it again and then we're gonna go to i already have it open plugins i want to show you where it is you gotta open edit plugins here right here edit plugins and then you'll see a bunch of stuff this is stuff that i have from the marketplace but you should be able to type in osc and yeah i just had to scroll all the way down for some reason the search wasn't finding it but scroll all the way down in the project it should have osc by default it's enabled and with that you're pretty much ready to run midi controllers and unreal with just a little bit of scripting and some blueprints so i'm going to create that blueprint now blueprint class so in unreal you just right click down here in the content browser to create stuff do i'm going to name it midi mix but bp for blueprint first so now we have a blueprint that's ready to have some code in it when you click on it and open it for the first time it takes you to the viewport which we don't really need to use in this at all so i'm just going to click over to event graph and the first thing that we need is a component that comes with the plugin and that is the osc receiver component add that by adding component and just typing osc receiver like you just saw me do and just tick compile for fun because you have to do that a lot get used to it drag it into the scene and then you should be able to from this pull off of it and then a lot of unreal doing blueprints is just pulling off of a node and typing what you want next so next i want to bind event to on osc received okay and then we have that uh to activate it we want to activate every tick so it's always looking for osc messages so we'll just pull the event tick off and now this is active hit compile so now this needs an event create a custom event from it so we just pull off from this red and do a custom event and i'm just going to name this midi mix osc and now we have this which contains pretty much all of the osc slash midi messages coming in from touch designer but to get everything separated and usable there's a little bit more work we have to do so pull off it here and we're going to sequence so we can use this event pin on multiple things in this blueprint so sequence it and then we need to use this address but we need to use it on something that's not an address so i'm just going to add that first what we need which is a switch on string and see this is what we need this address to be is a selection a string the selection needs to be a string rather so the quick way of doing that this is a cool thing that unreal does if it can convert it it will so if i drag this address to this selection that's a string it'll convert it to a string for me so from there we just connect this and now we can create the string names that our floats are assigned to or our constant our midi messages are from touch designer so osc always sends its messages with this slash in front of it so every string in your switch on string should have that slash and i'm just going to type slider 1 slider 2 slider three and slash slider four and now this is ready to assign and have an execute pin every time these sliders are moved so our floats will change with our controller so now we need floats to assign these uh execute pins to and the way we do that is coming over here to variables and creating our own and it'll come in as a bool so up here you're gonna have to change it to float i'll show you how to do that in a second i'm just gonna name it slider one and you can actually name these anything at this point but i'm just gonna keep the naming convention the same um now i'm going to set slider one and the data this data needs to be converted into floats so we're just going to pull off of here and do a pop float and now we have the float that is going to be assigned to this variable which is a float so when you add this variable first it's going to be a pool you're going to want to change it to a float and then you can use this pop float to get this slider set now this is this should work so i'm going to actually run a little test here by putting a print string in and doing this little trick here so now the value of this slider should show up on screen when i'm in play mode let's see oh we need to add the blueprint the script to the scene so i just created it it's not in the scene we can just drop it in here it's not going to show this little orb circle thing but now that it's in the scene when i hit play as you can see i'm getting the input in from touch designer into unreal and now this is a completely usable variable and pretty much anything in unreal as long as you know how to blueprint so i'm just going to really quickly just copy duplicate this with control w four times and just rename them really quick and drag him into the scene do set pull the execute pin and the same pop float and what you could do what's really useful here is because we're going to be using this pop float for the buttons and the knobs as well as these sliders you can double click on the middle of it and it creates these reroute nodes which makes it really nice to just organize your stuff so that's a cool little trick do the same thing for slider three set and slider four so now all of these should be working from touch designer to unreal and the reason why i use the sequence is so i can kind of separate everything with these switch on strings because i didn't really like having a whole controller be on one switch on string like this whole midi mix look ridiculous so i use this sequence and i'm just going to copy and paste the switch on string and drag this selection from here and then use the then one from this sequence the sequence just fires all these off at the same time anyways so it's not like these have any delay behind each other in any noticeable way so here we can do knob one two okay and the same concept these are just floats knob one knob two three of four and same concept and then i'm gonna create another one of these or actually no pull one off from here make another one here you can kind of wire them like that if you want you could do it anyway you could pull them all straight from this pop float if you want and straight into the to the variables and last but not least we'll do the buttons and just can add a pin here to add another to the sequence drag it down get it somewhere you can plug it in and same with this plug it in let's do slash button one okay and then these come in as floats too but i think that they're pretty useful as true false bools so i'm going to show you how to convert those really quick in this video so button one same thing okay so those are all set up all right so converting these buttons from a float value to a bool it's really simple you just need to round it so just type round and then it should round it to an integer and then from that integer we can just type in bool and we just need this one to convert one and from there i do a branch and then plug in this condition here so now this execute pin from this true is only going to send when the button's turned on and if you know unreal a little more than just like a beginner then you can see why that's useful um the last thing i'm gonna do is show you how to actually tie these to something now in this script there's a ton of ways to do this i actually came up with a new way to do it that's really cool and if you guys want me to do tutorials continuously i'm down let me know but to get something affected by any of these in this script you can click over here and do a variable and change the variable type so i already did this third person character is what i want to add and we'll just do a third person object reference and i'm just gonna name it something that makes sense third person cool and then what we need to do is make this variable public so we click this little eyeball and hit compile and then it'll actually be a drop down now third person c here you just click the drop down and add your third person character and now the third person character in this scene is being referenced in this script so you can pull this out and get it and what i want to do is i'm just going to pull from here and i'm just going to type set fov field of view set field of view so now we have this i'm gonna go here and i can go straight into here but right now this slider is just zero to one so what you're gonna wanna use a lot of time for these sliders and stuff is either uh just any type of math usually it's map range clamp is what i use but sometimes i use uh just like a multiply just like multiply it by 20 if you just wanted to go from zero to 20 that's a really fast way to do it but for this one i want to do map range clamp so zero zero is the in value and the range b value is what it goes up to so it goes zero to one and we wanna i wanted to go from ninety to 165 let's say and i'm gonna plug this in and compile and save and now let's see what slider that is so slider one should now set the field of view of our camera in this scene let's see if it works whoa it works so you can do that to pretty much anything with midi controllers now
Info
Channel: tyler m
Views: 3,451
Rating: undefined out of 5
Keywords:
Id: WDhlETITi-I
Channel Id: undefined
Length: 27min 6sec (1626 seconds)
Published: Tue Dec 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.