Music Visuals in Unreal Engine 5 - Full Beginner Course

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello hello hello and welcome welcome to audio visualization in and real Engine 5 for beginners course in which I'm hopefully going to teach you the basics of how you can kind of set up a framework to visualize songs and whatnot so this course is going to be divided into three parts into three chapters if you will and by the end of chapter number three you should have something similar to this um room a space in which which will reflect audio or music that that's playing so first chapter is going to be us creating this kind of a little menu icon where we can select a song and we choose any song MP3 file that you want hit open and it starts playing so that's step one I really hope that right now it's not blasting in the recording anyway step two is going to be creating a material that that displaces and reacts to that song just like that and step three is going to be using a pretty Advanced I would say um exporting importing techniques from Rhino and grasshopper to get an array of shapes that react to the music as well so while step one and step two are enough to visualize music or to visualize sound step three is just going to be a little bit of a bonus for those of you who do use Rhino and grasshopper and that just want to kind of bring this one step further I would say anyway with that being said by the way if you just want the files as per usual all of the files are available for patreon supporters so if you support the channel Link in the video description you get every single file that we do on this channel for free so consider consider supporting anyway so let's begin all right chapter one so one thing before we begin or two things first one is this course will be aimed I will try to tailor this course with an assumption that you're a beginner user right of Unreal Engine somewhat of a beginner user for Unreal Engine so for those of you who are intermediate users bottom right corner of the of the screen you will see the playback speed of this video you can increase it so that it's not does doesn't get too boring for you when I'm explaining simple stuff second thing before we begin is installing two free plugins and you can get them just from here from the marketplace one is going to be called easy file dialogue easy file dialogue that one just click on install to engine and then you're good to go it might ask you to purchase it for $0 so you just do that and then install it either way they are free so it's fine and the second one is um something something audio runtime runtime audio importer Meta Meta sounds runtime audio importer meta sound install to engine this one as well right once you have those two done then we go to library we click on launch and then we can simply create a new file a completely new file uh that is going to be called uh well the the name of it is just going to be audio this YouTube or something like that um there we go and uh rate tracing I will have this turned on because I like pretty shadows and it's going to be a third person map hit create once it's done then we continue all right so once you have this loaded in you just click play here in the top um the green little arrow and you run around to see if everything works if everything works great we can move on if something doesn't work then well che check it out I have no idea what kind of error you're getting you need to fix it yourselves if you don't see the content browser as well as environment light mixer then you can just click on this content drawer icon right here in the bottom uh left corner and then in the top right corner of this content drawer you can click on dockin layout which will basically just come on yeah it's going to give you a popup of this content browser like so and then you can just drag it down to properly dock it all right with that done now we need need one more thing to enable plugins before we start working so those plugins that we installed they are not enabled so I'm going to go to settings here in the top right corner I'll choose plugins and here I'll type in Easy file dialogue this one tick mark immediately asks me to oh you don't see it immediately asks me to restart I will not be restarting just yet because there's one more plugin that I want to um run and it's runtime uh audio something runtime audio importer with meta sound support very nice tick mark that one and then we restart so I'm going to rightclick um in my content third person Maps folder I'm going to create a new map so I'm going to right click and choose or level sorry and choose level right here I'm going to name my level audio Vis audio visualization and double click on that level to open it up uh it's going to ask me do I want to save it yes I do and now it gets opened up also what I'm going to do is make it so that every time I run the project this level um is the main one that loads in so I'll go to settings project settings map and modes and here editor startup map as well as game default map I will change both of these to my audio this level there we go perfect with that done now we have a completely empty space right there's absolutely nothing here you can see no objects no lights no nothing so we can start fresh so in my I'll expand this the first thing that we do in this chapter is create the little menu icon that is going to be shown as we start the game if I now start the game here my character just spawns and just keeps falling right until well forever I guess unless there's a kill volume uh kill kill depth in this level I don't think there is though anyway so what we want to do is we want to now create this menu I icon menu box right I in my content folder I will create a new folder right click new folder and I'll call it Widgets or menus if you want to I prefer to call it widgets double click on that right click inside of this folder and create a new widget which is under user interface widget blueprint like that user widget like that and just name it uh menu I did a menu menu there we go so we just name it that way now to edit it all you need to do is just double click on it opens up a new tab and now you can if you're a new user you can get kind of confused as to oh okay where's the where's the level again how do I get back to the level all you need to do is just drag uh take this tab right here that says menu drag it out click and drag on it right and then you can dock it right next to your audio V tab right here right so I'm docking it right here and now I can toggle between these two quite easily right this is what I I always do I have uh everything just docked in one line and then I can access it from from my main um window I guess anyway in here you can create anything you want so for example um or rather example is going to be once we actually have the proper setup so let's do the proper setup first so what we want to do is we want to go to the panel tab here this is by the way everything uh all different things that you can create um in the menu but the base one is always the same it's called canvas panel and we just drag and drop it in on this screen right so the canvas panel is basically just a border of the screen in W and according to it different objects will be placed according to the the edges I guess of this uh canvas panel right so that's always the first thing that you drop unless you're kind of unless you know what what you're what you're doing but I will assume that you don't so that's the first thing that you that you actually need to drop in I'm going to grab a text button here by the way you can search in the pallet for whatever you want so I'll just type in text text just slap it in there and for the text block here on the right hand side you can see there's a menu entry where you can change you know the the actual text that's displayed so for this text block I'm just going to write um testing right testing just like that I'll hit compile save and I have my like menu that just has a single text the problem is that if you just play this level now well it's not there right it doesn't show up and there's no button that I can press to make it show up so how do you make a menu show up well that can be driven either by the character or by the level itself so we will be activating it when you start the game when you start playing it we will be activating and we will be showing it on the screen how do you do that well you need to go to the level blueprint blueprint is scripting um basically you need to script it in into the level and the way you do it is actually pretty simple don't be scared you go here to list of blueprints uh that are available and you don't have many so you do have the level blueprint you click on that and it opens up this scary well right now it's not that scary because it's empty but it opens up this this blueprint and you can see that now we have three tabs I have my level tab I have my uh user interface Tab and I have my blueprint My Level blueprint app so this controls the behavior of the whole level right it's much kind of generalized you can also have smaller blueprints that we will have um that are much more localized but this one is General I guess that that should kind of make sense and it has two events that trigger um information right that trigger a script flow so first one is event begin play which kind of is self-explanatory when you start the game something happens right and it starts running a certain command and it runs it once one time and the second one is event tick event tick is basically the moment you start the game at every okay for for the sake of for to make it easier to understand at every frame of the game so right 30 frames per second or whatever at every Frame It fires off um a trigger right so this keeps going throughout the whole play session um this happens multiple times you know throughout the game while this one happens only once at the start of the game what we want is of course for it to happen once the menu you know you show the menu and it just kind of stays there right so let's use event begin play for now later we'll make it a little bit a little bit nicer but for now let's just do event begin play one thing that I did without really thinking about is I compiled and saved automatically because I'm I'm quite used to it so back in the menu if you change anything right let me just kind of drag the text around you can see that there is this question mark next to the compile button compile means that it checks for any errors and it creates a logic you know a small little app if you will um inside of your much larger program so every time you make any changes you need to recompile your Blueprints and the menu um as well as the level blueprint are both blueprints so I click on compile I click save now we're good to go make sure that compile has a tick mark here back in our audio visualization blueprint like our level blueprint I will start creating the logic you know for showing the menu first thing first is we need to fetch the vidget the menu widget we and we need to kind of just fetch it out out of the files and create one when the game begins right so what we're going to do is we're going to drag out a wire from this event begin play and we'll say create audio uh nope um create widget it should be just create widget yeah there we go create widget there we go and then it's going to ask us okay what's the class of the widget the class is the name of your menu and in this case the name is menu well that's what you written right as the name so here I'll just expand it and I'll type in menu to find it there it is perfect and owning player who owns this widget well it's you're the only player who's going to be playing it right so you're going to be owning it so you can just get player controller and use that right I can compile and save and click the play button and here you will see that well actually there's no menu what what gives you know there there's no testing sign on my screen when I press play why well that's because you have created the widget but you're not showing the widget right so what you want to do also is ADD you drag off from the output here release the mouse button and you type in add to viewport add to viewport like that it's going to ask you okay what should I add to viewport and that's your widget that was created like that the return value is basically after it creates the widget it spits it out through here right through the output here and then add to viewport input reads that can read that output and show it right now if I hit compile play there it is our little menu right well it's not a menu it's it's just text but uh now you know how to just push any text on your screen which is nice uh cuz you can now you know if you're an architect you can write you know like WD to move around for your clients and so on anyway that's besides the point now uh in the menu let's get rid of the text for now don't don't need it so the first thing is we create a button and to get a button just type in button get that drag it in there's your button and you can rename it as well I'll I'll just name it uh import audio button uh to rename it's F2 uh when when you select anything in the uh heror he tab I guess it's F2 and then inside of that uh button let's add a text so I'll just select text and drag it onto my import audio button like that and you can see if I zoom in here now I have my little text block um right on the button and if I select the button itself and move it around the text moves with it it's a little bit ugly so I'll just make it a bit bigger there we go something like that for the text I will change the text itself to import audio or pick a song I guess would be nicer I do a little bit more human pick a song there we go and then for the button itself I will just change the color and opacity of it so the opacity should [Music] be hello oh that's the wrong one background color I'm sorry uh Alpha I'll just drop it down a bit just something like that uh compile save play there we go there there's there's our our button now if I press if nothing happens but at least we have it right now let's always position it so that it's kind of anchored to this corner and it's always at an offset from this corner to do so you just select the button here in the hierarchy and if you scroll up you can see anchors tab if I open up this this uh subtab this menu menu box here I can see that I can anchor to the bottom right corner of my canvas panel right here I click on that and now my position is offset from this point right here right so if I write my position X is actually um zero then it's like so if position Y is zero it's like so right so what I want to do is I want my position X to be uh let's say 100 well let's do 250 250 and my y position I'll do like 300 oop sorry minus 300 like that compile play now you will see that doesn't matter how I transform this screen it always offsets properly it's a little bit too far out from the bottom so I'm going to change it right now to - 250 I think that's going to look nicer it's a little bit too far out isn't it 150 minus 125 there we go okay that that that's much more decent all right so we have ourselves a button now let's make it do something remember how we had the blueprint here you know with the chain of um events of what what's happening once we have the event begin play your menu your widget also has a blueprint that it can that happens when you press things and when game starts and so on and that blueprint can be accessed through this icon right here so here we have the designer for the actual you know menu icons and so on and colors and whatnot and here we have the graph the gra graph is you know event construct event tick you know tick already event pre-construct and so on right we will not be using well we will be using event tick but that's going to be later I will just be deleting everything for now so that you know we're on the same page so that it's clean I'll come back to the designer tab real quick I'll select my button not the text the button itself I'll scroll down in the menu in the details Tab and I'll choose from one of these events onclicked on relased or or oh sorry onclicked on pressed on relased on hovered on un hovered things that you can do with a button right so in our case when you click a button something should happen so on clicked I will click on this plus sign Boop immediately gives gets me into the node editing portion of of of the menu uh widget and also gives me this event that okay when you click the button something happens right what should happen when I click the button well the first thing is um give give me a second I'm thinking the first thing is when you click the button it should open up the browser right your file explorer so that you can choose the song right so what we want is we want to drag out from here and type in open file dialogue open file and this is from Easy file dialogue plugin by the way open file dialogue right um you can choose uh to use like a specific file type like MP3 here and it's going to f filter out everything um that is not MP3 but I I will not I will just keep it dirty right so we have it like that right so now technically let's compile and play pick a song Bam opens up a browser where where we can choose a song and hit open it doesn't do anything but you know it at least we can select a song now okay that works next next um by the way you should think about these wires that come from these white triangles as electricity that feeds the nodes that are connecting to it right so if I show you the level blueprint event begin play electricity turns on this create menu vidget which you know creates a widget it goes through it then goes here and it adds the widget to the viewport right so it's all chain and it all goes in the correct order one after the other so in menu you click the button open file dialogue right it opens it up and then um if it cannot open okay so it gives you three outputs one is the file that was opened a file name that was opened second one is it couldn't open something or you didn't choose anything you canell right so if if you cancel then it should do nothing if you if this is um if this is false it should do you should do nothing if this is true you the chain of events should continue and it should actually play the song right so sorry I'm I'm I'm just thinking real fast so what we will need is a logic gate that's well it's not a gate but it's it's a branch it's flow control gate branch and I'll connect true or false statements you know yes a file was selected no a file wasn't selected if it's a yes then it continues if it's a no then nothing happens so if it continues if it's a yes uh then we should create a runtime uh sorry not a just create runtime audio importer that's the other plugin that we installed and with this audio importer we should import audio from file bam okay who should import audio from file the audio importer that we just literally created like that what's the file file path well it's the file that we have selected the problem is that here you can see from the Icon this is an array which is basically a list a list of things while this is it it just wants a single file it can't import multiple files right well this one uh you can select multiple files and then it's going to freak out so what we want to do is we just want to get first one you know if you just selected one the first one will be the correct one if you select multiple it's just going to give you the first song out of the list so I'm just going to drag out from there and type in get uh copy get a copy and connect that to file path for the audio format determine format automatically yeah yeah we just determine it automatically that's that's going to be fine okay so now technically if I compile save and play and pick a song and I pick a song and hit open technically now the song is inside of the Unreal Engine we don't hear it it's not playing um you need to actually play it to to hear it just like with a viewport uh adding to the viewport you need to add the viget to the viewport but it's there so now we need to sorry need to think real quick real quick what we want to do is we want to then if a song is playing it should Trigger or if a song was selected it should trigger a separate event right that just goes oh okay yeah yeah I'm I'm I'm I'm on to it right so I'm going to drag out from here from the audio importer I'm going to drag out the wire from here and I'll say to on result assign or bind assign yeah assign to on result and this is this one is a little bit trickier to to explain but basically um I'll just connect here if there is a result from here this feeds back the electricity into this event and this event triggers right so I can just say song selected event or the the name doesn't matter of of of this so I'm not going to explain how to do it but it's basically song selected and then it plays right so don't forget this wire though because buying event needs to also electricity to work right so when you select the song there should be a little bit of a delay uh for the machine to catch up and also just for it not to blast immediately as you press play so I just drag out here I type in delay and I'll say um let's do like a 1 second delay two second delays two two seconds right and when it is completed we should check the status of like off off sorry we should check this status of the Importer if the audio file has been imported so the status can be um this is not going to be true or false this is going to be multiple values so I'll just drag out from there and I'll write equal equal enum like that not operator equal but equal in EN num en numerator and here I'll expand oh okay so it has like options of success failed to read sound wave declaration error invalid audio format audio does not exist load file to array error right so only when it says success should it continue on if it's anything else it should freak out and it should stop working so here we already have this logic you know Branch if yes then play if no then stop so we're going to do the same thing I'm just going to create a branch just like that it's nerdy stuff I know but soon we will get to the fun stuff with the materials that's chapter two but you need a menu for you need chapter one to do chapter two I'm sorry it's boring I know bear with me connect like that right so now if this is a success true will fire off if this is false uh sorry if this is not not the success anything else then false will fire off if false fires off I kind of want to see what the is going I I swear I'm sorry I kind of want to see what the hell is going on so I'm going to say if it's false then print string print something on the screen and the string should be the status so I'm just going to connect W the wire from status to string like that it creates a node in between enum to string I'll just kind of position it like so okay we're good so if if it fails it tells us why if it's true uh or or sorry if it doesn't fail if it's a success then it fires off here when it fires off here I want it to play but I don't want the menu to take care of the playing I want a separate blueprint to actually do the playing of the song part because then in that blueprint we can also analyze it rule of thumb is you don't want your menus to be too heavy in terms of blueprints uh in ter in terms of calculation right so all of the analysis and so on will be done in a separate separate blueprint right so for now I will just compile and save this and I will create that so-called separate blueprint in my level I will go to my content folder right click and choose new folder and call it blueprints blueprints double click on it yay and inside of this blueprint folder I'll create a blueprint right click a script blueprints are scripts basically right click choose blueprint class actor the first first one and I'll just name it um listen uh we can do like listen BP so that it's clear that it's a blueprint listen BP F2 to rename things listen BP that should be good enough I mean yeah that that's going to be fine so in listen BP what we want to do is we want to um trigger an event oh sorry let's open it up first so this is our lesson blueprint uh we immediately go to the event graph rather than the viewport because we care about the logic I'll delete everything in in here we don't care um about those notes we will make our own and in this event graph what I want to do is I want to create a custom event custom event add custom event I'll name it uh play uh evaluation play event play EV there we go play that's going to be good enough play um this play V will trigger from our menu right so when this is true it should fire off and it should trigger our play EV but also when when this triggers it should create sound create sound 2D sorry create sound 2D like that and the sound that it should create is going to be an imported music imported wave file so I I will um say that well we can't select it from the menu of of files that we have imported into un real engine because it gets imported during the game time right so this needs to be a variable that changes over time right that changes accordingly to what you have selected I'm going to right click on this I'll choose promote to variable I think that can change and it's annoying but here it is right here's the note and basically this this is an empty container in which like anything can be placed as long as it's a audio file or raw audio file so I'll I want to rename it um from sound to wave sound or actually sound sounds fine uh so let's keep it as sound right so two things play event and sound compile save don't forget to compile and save your listen blueprint and go back to your menu uh menu widget here when it's true it should send over the fetched audio file the imported audio file it should send over to the listen blueprint and also it should trigger the event that listen blueprint should play the audio file okay this is going to be actually it's not going to be that bad because we only have one listen blueprint so it's fine so let's do it this way we drag out from Branch true statement here and we get all actors of class like that and for um our our class is literally the name of the actor listen BP right so I'll expand this and type in listen BP yay it C it caught it right so now basically if you have if you have this blueprint in your map used then it's going to fetch it the problem is that if you have 25,000 copies of your listen blueprint just copied all around the map it's going to fetch every single one of those right and because of that the output of this is always a list the list is easy to deal with because we know that we will be using only one um actor right so we just get the first one right right get a copy bam and that's going to be always the one that we want right because a list of one you get the first one from the list of one that's the one right with that done now we have the possibility to set drag out from here set wave why I can't see it oh that's not wave set sound set sound there we go there it is Cat come on set sound bam and now if I compile this from this blueprint oh don't forget the electricity bam to make this work oh cat don't stop it's a I have a new cat his name is Momo can show you there he is and Momo loves to sleep on my keyboard when I try to record a video anyway uh moving on so set now uh triggers and overwrites this variable with anything that you plug in to here so now we need to fish out where the hell is our uh wave file where where the hell is our imported sound and it's all the way here this custom event that triggers from this import audio from file also has an output of the actual wave file imported sound wave that was imported so what we will need to do is drag a really long ass wire and it's going to be annoying for the tutorial but it is what it is imported sound wve from here connects to sound in here yoink just like that now technically if I compile save oh no never mind well well I can show you if I compile save and press play I pick a song I choose a song I Hit open nothing happens why well that's because uh access one second why is it none H we'll figure it out later probably not an issue Famous Last Words anyway so for now um this does not work yet because we are not triggering this event right so it never plays so what we want to do is we want to play with this and to do that we will from this get drag out one more and how was it called play EV type in play EV and that is the function that we will call play EV electricity comes in bam and now it should work I think yeah there's no way that it's not going to work right compile save play please okay it doesn't work um Escape out of that okay it is uh really not happy with me uh saying set sound execute Uber graph menu blueprint event I made a mistake somewhere let's see so if we go to the level you act I I mean I don't have anything in the level right this just exists uh listen blueprint just exists as a file in my system but it's not used used in the level so of course it won't work what I need to do is just drag it into the freaking level for it to work so you drag it in right then you press play Then you pick a song you choose the song you hit open the typical we create the sound we don't play it we just created it right so after uh this is in listen blueprint after you create a sound you drag out from here and you CH you will choose start analyzing output cuz that's anyway what we will need to do start analyzing output don't expand it it's scary just minimize it you're good to go like that and then you press uh you drag out from there and you type in play uh scroll scroll scroll scroll scroll scroll scroll scroll scroll it should be easier play manager set play rate play diag play sound 2D H I don't like that can I can I just do can I just drag from here uh from Return value I'll just drag out from here and type in play should be better yeah there we go play bam electricity don't forget something like that so analyzing by the way if we expand it I probably should show you um there are like different ways of how you can analyze the the sound but I honestly would suggest not not dealing with that right now uh and just using the default values yeah anyway compile save play play pick a [Music] song There we go okay good good good good so now there are issues that we need to fix and once we fix them then we will move on to chapter 2 yay finally so issue number one easy um if I press play and I click anywhere else than the pick a song my mouse is gone I can't select pick a song anymore because I'm in uh play with the character mode no bueno issue number two I don't really want the menu to be always there right so I want to fix that we will fix both of the issues at the same time so uh let's go ahead then then do that so if I go to my map uh or to my level blueprint audio visualization expand blueprints here open level blueprint bam if I go to the blueprint here I don't want it to spawn when event begin play begins right so I will delete that and instead I want to spawn uh it to spawn when I press the M button right click key event and just choose any um any key from that has this icon doesn't matter which key you choose I'll show you why right so we choose it uh select this node uh go to right top right corner input key click on this little keyboard here and then press the M button M for music M for menu right uh once you did that now every time you press M it's this is going to fire off um some sometimes you also need uh if if it doesn't work on your character or on some other blueprint then you would need to do this I'll show you real quick event begin play enable input oops Target self player controller get player controller yeah so if for some reason this does not register then you need to do um you need to enable input it's an optimization that basically not every blueprint is able to receive input from the keyboard and does it you know it's better to tell which blueprints are able to receive input then all of them being able to receive input right in in this case this is a level blueprint so it doesn't matter as much I just wanted to get give you heads up if you're going to be customizing it anyway for pressed um the first time I press it I want the menu to pop in right so and then second time I press M I want the menu to disappear so press will have a flip-flop logic to it first time you press it a fires off second time you press it B fires off third time a fourth time B blah blah blah right should be should be pretty straightforward so first time I press it it should create menu widget like that easy but also after adding I'll just get it here after adding the menu widget to the blueprint it should um show the mouse right so for that I will need to get player controller I already have the player controller I drag out from it and I'll say set um Mouse visible no uh set mouse cursor yeah set show mouse cursor there we go this this is the one set show mous mouse cursor I'll tick mark that and electricity don't forget bam so uh when I press M it shows me the menu and it shows me the mouse and also it should uh not move the character anymore um around as I am in the menu so I'll expand from here and I'll set input mode game and UI just like that player controller uh should be you just double click on The Wire by the way to be able to branch off from The Wire just makes things cleaner so player controller get player controller same thing um in widget to focus on uh you could just use the where is it this widget right here if you want to I will yeah I I'll just use it like that it's a little bit you know could be cleaner let me try and clean things up as much as possible but yeah this is is the best I can do um in Mouse lock mode do not lock hide cursor during capture who car uh actually don't hide because I want you to see the cursor okay okay so that is that should be good compile save play nothing here I can move the mouse around to rotate I press M immediately Mouse Pops in I can pick a song and so on and everything's great right escape to to cancel right so now when I press M again the menu should stop being there so I will say if B if output B from the flipflop uh destroy no not destroy remove from parent huh that's interesting that's not there uh let's drag out from the menu widget itself like that remove from parent there we go that's the one so create menu widget I just drag out one more wire remove from parent and now I will connect B to you know that the electricity zip and this one now works let's make it cleaner actually I don't need a wire there I can just grab one from here like that it's a little bit yucky but should be fine okay remove from parent then we I'll just get another uh get player controller I don't want to just kind of use long wires here so I'm just getting another one um set Mouse uh cursor set show mouse cursor bam we turn off the mouse so this is not tick marked while this one is ticked and we also change the input mode set input mode game only player controller get player controller easy peasy all right compile save play M Mouse there m no mouse M Mouse there m no mouse M Mouse there yeah perfect okay uh one last thing before we move on if I press play M Mouse there pick a song I choose a song poop and now I need to press M again to get out of the menu but I've already selected the song the menu should disappear automatically right right so I want to not need to turn off the menu manually when I select the song it should turn off automatically and we can take care of that in our menu widget right here because we already have okay it fired off means we have managed to select a song so now all I need to do is just specify uh that it should be removed from parent Target is self right the vidget itself should be removed from the viewport and then uh we should get player controller set Mouse set show mouse cursor it shouldn't be shown and set input mode UI or sorry game only bam like that compile save play M pick a song choose a song Hit open there we go when it starts playing it let you it it turns off this again uh the lag was because of this delay of 2 seconds I think 2 seconds is too long so we will just do 1 second instead compile save play again try pick a song Good there we go yep one second and then we're back in the game nice so now we are able to import any song next chapter is going to be us being able to read from the imported um song Right read out the values so we'll be printing out a few things on the screen right chapter two all right chapter two so now let's make geometry or materials interact with or react to the audio that we import so the first step is actually to have some sort of an environment in which we can you know actually place our character and if I press play now it's very lonely there so I will be creating three things first thing is going to be just a plane on which the character can land you know so so that it it's not just falling all the time so I'll go here to the top uh left corner kind of menu quickly add to viewport button go to basic no sorry go to shapes and add a plane bam just like that and for the plane here I will you don't see it there's the menu I'll log the scale right here and I'll type in like a 100 in terms of the scale right and then make sure that the location you let's just set it all to zero right location is all 0 0 0 scale is 100 with that done now if I press play the character still Falls because it spawns yeah okay so we need to actually well um I really want to create a light source but I know that this is going to suck if I do so I'm going to change instead from here instead of lit I'm going to choose unlit like that then as I look around I can see where the plane is if you can't see it still uh you can just select the plane like that in in the right hand side menu and hit F button F to focus and now your um viewport will will focus in on the object that you have selected then with W ASD while holding the right house right Mouse button you can kind of navigate to it if you're too slow the camera move speed is here so you click on it increase the speed to let's say 16 let's do eight Z and then now we're zooming okay as long as you have changed from lit to unlit it should just show the color of the plane itself without any light so it's since the plane is white it shows white that's all we need right then um for this I will also create a basic player start position bam like that and I will just zero it out 0 0 0 and just move it up a little bit let's see there he is that's not a little bit so I I'll just say in the Z axis it should be like 100 so a meter above the plane okay if I press plane now you can see that it's now standing on the plane it's still pitch black and the only light source is the little logo uh on the chest of the character but it's uh at least you know has a plane to stand on then I will create um Point light no let's create a how do you call it like Spotlight let's create a spotlight so here under the quickly add to the project I'll go to lights and I'll choose Spotlight you can also add rectangular light if you want actually let's add a rectangular light why do we need to deal with spotlights rectangular light bam it is what it is then we just simply actually I'll zero it out as well F to zoom in uh now the camera is way too fast there we go move it up and now we can actually change from unlit back to LIT to see what's what's going on like that um that's where the C uh character will be looking at when it spawns so I will just move it around by the way if you don't see the movement arrows uh move rotate and scale icon ions are here so I can choose rotate can rotate it or if you just select the object and you click on W that's move e is rotate R is scale that also works right okay let me press play there we go you know some sort of a environment if I hit M then I can pick a song and I can just run around with some nice music okay you will hate the song by the end of this video by the way or or maybe you don't really hear it I have no idea no way to I can only see the gra it doesn't matter okay so we have this basic setup and the last thing is our listen blueprint that I select here I'll also zero it out so it's some somewhere here I kind of want it to be positioned actually um right below the light somewhere here perfect so now what I want this is going to be like middle of the chapter um in the middle of the chapter we will have four boxes that react to the sound right so that that's that's what we're that's what we're doing I will go into this listen blueprint and here I'll start creating some um script as script right so first of all how often do we evaluate um how often by the way I'm in the event graph how often do we evaluate the music that's playing you know how often do we update the value that we evaluate that's going to be every every chance we get and that is exactly what event tick does just ticks as often as it can right event tick so this is going to fire off impulses like crazy and we will just get magnitudes get magnitude from or four frequencies right because here we're analyzing the output like so and here we're getting the magnitude for the analyzed um music right and the frequencies you can see that it asks you for a list again this is a single value icon this is a list icon or array so what I need to do is I need to make an array make array and here I can add like a frequency that I want to analyze I can add multiple but for now we'll just do one um so let's say what's what's a good like 200 um hertz frequency we and we will be kind of cutting through the song at that particular band and we'll see how strong the sound is at that particular frequency and then from the magnitudes um since this is only one I can just say um get a copy I can just get one right and then I can print it print string and notice that when I say print it since this is a number it immediat goes like oh you don't want to print a word this is basically used defining how long the the the the the the word that's printed on the screen should stay before right so it automatically connects to duration rather than the string no no no you disconnect with the control control key drag backwards to disconnect and you drag it into the inst string input like so it automatically converts it to text or to string in this case and then don't forget the electricity and this is going to be firing off like crazy the moment we start uh playing the game right again very heavy for the computation but necessary in this case press play Zero you know it's completely silent because of that it's zero but if I am pick a song the good song up dates great okay Escape out of that so now we have a value that changes I want to make a box dance according to that value and then I will want to make four boxes dance so let me save that so to do so I will just sorry thinking yeah we need a box so I'll go to the viewport tab here and I'll add a cube bam just a cube and then for the cube well actually basic shape material sure we we just use default material that's fine so we have a cube here then back in the event graph I can grab the cube easy bam and I can set World transform H set relative transform not World well it actually doesn't matter because it's just yeah set World transform whatever do we need a transform though sorry give me a second I We Can Make It Shake but let's make it scale instead so uh we don't need a transform uh set world scale 3D instead set world scale 3D and I'll just connect the electricity from my so we're printing the value and we will also be using the same value to scale the cube in the Z Direction which means the Y X and Y directions should be one you know the scale of them should be one while the Z is going to be jumping around so we need to make drag out from new scale make Vector make Vector it's right in sorry again make Vector right there now we can add multiple values and this one only connects to the Z input and X is one and Y is one so now at every every tick it takes that Cube that we have here and it updates its scale according to the strength of the sound at 2 200 frequency like the yeah you get what I mean play the cube is oh yeah right I forgot sorry I'll go back to audio visualization and here the cube is just there actually that's pretty cool I I'll keep it there so the cube is kind of intersecting with the ground don't worry about it let's just play I play the cube is right there huh okay it didn't crash but damn it didn't like the collisions right let's not do that again and let's save save all and then do it again play M pick a song anywhere you go and there's there's our Cube I just want to jump on it real bad come on just y now it just Clips through so you can see wait this very loud so you can see how jit this is and it's going to be a problem right but before we solve this problem there's there's another thing that we need to solve and that is how do you do it for multiple cubes right because oops wrong blueprint because right now we only have one cube right but what if I want to show four bands or six bands or 12 bands well first of all we need done four or six or 12 cubes so I'm going to make some copies of it of this uh holding down the ALT key I think nope crl Ctrl V copy paste um and I guess I just paste them from left to right along the X Direction so that's one crl c contrl v that's two contrl c contrl v that's three there we go and then I just select all three of them come on all four of them sorry and I just move them so that they are around you know they're located around the middle point somewhere there good enough okay let me also move them up yoink and now we're Gucci okay if I now check the map this is how it looks like um I really want to rotate this though and move it in the back a bit play yeah that seems okay right so now with the four boxes I want to transform those four boxes at four different bands so first of all we need four uh a list of four items not one item or not sorry not yeah not one item so I will add pin right here and I'll do it two more times um so the first band that we analyze is going to be like 50 second one can be 200 third one can be 400 and fourth one will be a th000 okay so now this is going to change a little bit right and let me just delete everything after get magnitude for frequencies because suddenly we're dealing with a list of things we can't just get well technically we can but it's going to be a little bit of a iffy not not not not as nice so instead we're going to make it a little bit a little bit nicer a little bit more elegant delete get magnitude for frequencies we have a list that keeps updating right so what we do is for each uh drag out from magnitudes and type in for each Loop for each of these magnitudes oh it automatically automatically executes as well that's cute what's that no never mind uh for for each of these magnitudes as they are updating right or rather these are frequencies and then we get magnitudes of these frequencies as they are updating it's going to go through them one by one one by one again one by one again at every tick right so we will then need to one second thinking thinking still thinking need to think still thinking still thinking no it needs to be other way around right yeah it needs to be other way around we will be using for each Loop but we will not be using it on the magnitudes instead we will be using it on the cubes the array the list of Cubes so what we need to do first is create a list of Cubes that we have easy we just uh drag in Cube Cube one you can shift and and drag multiple we have these four cubes and I will just drag out from the first one and type in make array make array there we go add pin pin pin Cube one uh Cube two Cube three make sure that they are you know in the proper order or else your bands will be out of whack and then for this array we will say for each Cube just go through them and uh do the for each Loop for each Loop execute like that for each Loop and in the loop body we will say well set relative or set world scale set relative scale 3D and it's is going to ask you okay what's the target well the target is going to be the array element you know as it's going through the list of four cubes it's going to pick the correct one you know as the Target and for the uh new scale 3D we will right click promote to no sorry uh uh not right click we will make a vector we will just make a vector out of these three values uh X will always be one y will always be one Z is going to be the tricky one okay now how do we get from these magnitudes a correct um XY Z oh sorry a correct uh value from from this list how do we get the correct item that matches up with the list that we have here right so that Cube one or just Cube uh gets the values from band 50 Cube one uh band 200 Cube two band 400 Cube 3 band 1,000 well we get item or not get item get get a copy from these magnitudes and then here notice that uh as it's going through the cubes you know from the first one to the last one it also gives you array index so it tells you which Cube It's currently looking at well we can use that to get the appropriate band or the the appropriate magnitude and then we just simply connect it to the ZET and that's all it's a little bit wiry uh we I will be cleaning this up but this should work so let's just compile save play right now nothing's playing right so all of them are like just flat because it's all zero but if I pick a song uh yep there we go we have a jittery you know super jittery um interaction right it is reacting to the sound all right now we did this is like the middle of this chapter as you can see in the timeline right hopefully it's the middle fingers crossed next step is going to to make those values softer so that they don't pulsate like like freaking crazy right so yeah this is going to be the second part of the chapter and then third part of the chapter is going to be the material creating the material it's going to be fun because the material will look cool you saw in the start of the video yeah you you saw it you saw it so when it comes down to softening the values actually there are multiple ways of how to do it and I'm I'm going to try to uh teach you um one that's a little bit simpler to understand but might not be the most optimal but for beginners as well as honestly intermediate users this should be definitely good enough so first of all uh let's somewhat disconnect the cube manipulation part from the get magnitudes for frequencies using control key hold it down disconnect the wires just like that and let's just move down this whole portion of the script so that it's not in the way we will be we will fix it a little bit later so the first step is actually after you get the frequencies right you want to separate them out into um different bands and then you work with them not as a list but individually with every band and you soften every band and then you reassemble them into a softened um I don't know how to call it the smoothed list smooth array right so we will for these magnitudes we will be using as per usual for each Loop which basically just goes through you know Bam Bam Bam Bam Bam Bam Bam Bam Bam Bam Bam Bam constantly going through these four um magnitudes and re-up dating them at every every tick I should have the tick here there we go okay so as it's going through them then it should well first of all the array elements um if you check um Power of 0.3 grab 1 second bear with me Bam Bam graph um no uh other way around other way abort abort Mission how do I um I go here 0.3 delete that and then I go here x uh like that play huh how graph give me a graph there we go so the issue is that low frequencies um that that we have and can can I zoom into this where's one there's one one one to one so so it ends ends right here where where my mouse is right so the the issue is that the frequencies that we currently have um they shoot off to the space like crazy right and what us uh raising to the power of 0.3 for instance does it makes it not shoot out it kind of bends down the curve right so a very large frequency or very large magnitude gets kind of squished down to uh you know it still goes I think it goes to Infinity uh if it's if x is infinite and you raise Infinity by 0.3 yeah it's still infinite right it still goes to Infinity in in terms of the magnitude but much slower right and that's what we want so we're softening the numbers we're we're giving it a soft cap and it's very easy to do so for these um magnitudes we use array element and we just say power and the exponent of the power is 0.3 that's it so all of those kind of wacky very high column looking things they just kind of get squished down very very much um this is very useful for anything that goes out of whack uh keep that in mind very useful uh even though it's it's very geeky and I feel dirty saying it then as it's going through these four values we will create a branch Branch asking if the array index is zero equals equality equals zero does it equal zero if it equals zero then it should calculate for is there a faster way to do this maybe but I don't no let's keep it simple um if it's zero then it should calculate for the first band then it should soften the first band if it's false then it should move on to check if the ray index is one or not hope that that makes sense right so first of all uh and it's going to be a lot of copies so bear with me again uh if you just want the script patreon supporters get all of this for free as long as they support the channel of course Link in the video description below so now I am going to say one second I'm really quickly thinking we need to create variables we need to create variables so I'm going to say so let's create let's create um right here under variables press the little plus sign and here we will create a new variable called um accumulated value for band zero what would be a short shorter version of it ACC um value zero ACC value zero and it's going to be the flavor of it is going to be a float number right it's going to be a float float number and then what we're going to do is we'll go um and and create one more variable bear with me this is going to be fine one more Val variable and we'll say recorded um recorded Rec values multiple values zero again recorded values and this is not going to be we're going to be recording a list of values so this is not going to be just a single number it's going to be an array a list so here with recorded values I go into variable type and here instead of um the Little Dot or Dash I change it to array right here make sure that recorded values is selected right okay now now now we're we're cooking now now we're going to be good so with that done we get this value right this is the current value and we will add it to we will record it to into this array so recorded values drag it into to onto the screen and choose get recorded values like that so this is our array and we will add uh array add like that and this value will be added into the array but only if it's if Branch says that it's true right um because we're we're working with band Z that the zero here for recorded values means that it's you know we're dealing with the first item we will have copies of this uh accumulated value one accumulated value two accumulated value three as well as recorded values one two and three right so for now we have a list onto which we just keep adding in one one after the other uh the record values right of of the magnitude at band zero right then we will ask if these recorded values and let me just drag them down a little bit like so we will ask how long is the list of US recording these values so uh length array length we ask for that and we get a number right and and we will ask is it smaller less is it less than let's say five right so we keep at every tick we keep adding the recorded values right of into the recorded values list we keep adding the values of the magnitudes from band zero and we keep growing that list and basically once it reaches five or more this will shoot out uh false true it will shoot out it will shoot out false right and if it shoots out false then what we do is we remove we kick out the first item right so it always has four items in the list right with the the uh fifth one or the the first one being removed constantly and more added right so it's a shifting list we always in doing so we will always measure the kind of in in this time frame the the current one as well as the five previous or four previous um evaluated numbers oh I'm doing a great job explaining this I'm I'm so proud of myself okay uh we will use a branch for this and I'll connect the electricity from the ad to Branch the trigger right and if this is more than five so if it if this turns out false then we will remove index remove index from where do we remove the index well from the same recorded values uh list like so and let me just make it a little bit nicer bam something like that okay so we're removing the index zero that's great from you know the first item on the list and if it's once it's removed then we're happy if it's not if it hasn't filled up yet filled in the the array yet then we just just continue passing through that that's that's that's fine okay then we will use uh for each Loop we will take the current list that we have and we will use for each loop on that list so the array is going to be the same uh this is so yucky in terms of wiring but it is what it is so that's for the recorded values right right we're going to be using the same array and this for each Loop should trigger no matter what no matter if the Branch goes true or false so it should trigger like that right both of the wires trigger this and then for each Loop will'll one second thinking we'll add this array element will be added to the accumulated value variable get accumulated value drag it in Connect that like so and that that's going to be added and then also it is going to be set um sorry accumulated value uh we drag it in again set accumulated value like that and loop body sets it okay we're almost there bear with me so what happens is you get um array of five elements right in the array five numbers 10 15 20 20 or I can wait notepad array of five elements comes in five 12 6 1 2 right what then this does and it it comes in as as a list that constantly keeps changing what this does for each Loop it goes through every single one of these numbers right and it takes an empty container which is accumulated value and it adds to that accumulated value uh container so what it does it just goes through them and it adds okay five plus next Loop or rather plus five + 12 next Loop + 6 + 1 + 2 right so we just keeps going through the loop uh for each of the items here and it just as them up so 17 23 26 and it's at the end of this once this is complete once this is completed it gives you um the give me a second thinking once it's completed it gives you uh sum of all of these elements maybe there's a faster some um Mass addition uh some accumulation get accumulated time no okay so it it just gets Mass addition of all of this so once it's complete what we want is we want an average of all of this right so we want an average of the current um frame or the current kind of evaluation as well as the five that were before it so that we soften and there's no jittering so it it kind of softly increases or decreases right get understand where I'm going with this so as it's completing we will um divide once this is completed the accumulated value uh give me a second I'm I'm I'm still thinking yeah it should just be like that the accumulated value should be divide by the length of the rectangle Val which is most of the time is going to be five but you know uh at first like three or four frames it's not going to be five so um we divide by the length of accumulated values array like that Boop just like that and here the output that we will get is going to be um the softened version of band zero right of the magnitudes from band zero the issue is that we have four bands so we kind of need to do this over and over and over again and I'll show you how to optimize it a little bit so that it's not so obnoxious and the way you do it is you just uh take your variables VAR Ables variables take your variables um the rec value zero and accumulated value zero drag them over to the left hand side like so select everything after them don't select the branch and the like these checks we will need them to be naked but select everything else like so right click and choose collapse to function it makes this function right here we will need to clean a few things up inside of the fun it's basically like a a group of of components that act as one node very very useful uh very useful thing but we need to clean it up quite quite a bit so first of all uh the inputs uh because we have so many yucky um you know um h very say um we have way too many inputs and you can see that this connects like three times disconnects two times no let's clean this this up if you select the node uh on the right hand side you see all of its inputs and I'm just going to remove some of them um so for instance ne new item is literally the current value right the current value of the array so I'm just going to say uh current number bam current number then for the recorded values I'm just going to yeah I'm just going to name it uh instead of Target array we say recorded values like that uh and I don't need other two inputs for this I will just use one here it's going to freak out don't worry about it but I I just remove uh other two here and for accumulated value that that's exactly you know I I do exactly the same thing a q value like that but also one more thing that I will do is I will create an output right because what what do I want this to spit out well if I double click on it and I look here remember it gives me a smooth version a smooth smooth out value so if I go back to the event graph by clicking on here here I can select this function and I can choose um to add an output by clicking this icon right here and name it smooth number or smooth value smooth value oh also B is not required I'll just delete the B as well so those are complaining that's fine smooth value asks me what's the flavor and is it a list or not it's not a list so it is a single thing and the flavor of it is going to be FL float float is basically number with digits after the comma okay we're happy we're we're we're getting there now if also I want to rename my new function to something that is not not that so to do so I just need to you know you double click on it you get into it and here where you have the starting node which says new function you just give it a new name name and I'll say smooth smooth smooth out a stream of numbers it's a long one but it's it's a correct correct uh name for the function and then notice that return node has been created goes back to uh to the end and here the return node just connects to smooth value and when should it be triggered sorry uh the smooth value output connects to the actual smooth value smoth value input connects to the smoo value output right here and when should it be triggered when when the loop ends when this Loop ends so complet it connects to the return node right now it's time to clean things up so there's a bunch bunch of Errors just simply because I have deleted the inputs um so now it doesn't have you can see it doesn't have connections uh very easy to make connections you just redraw them right so recorded values connects here now these two will be happy with it um then here the accumulation we don't press those the adding in to the values that needs the to be a long wire accumulated value or actually let's just do a node here like that and then connect it like so a little bit cleaner a little bit nicer these node icons or buttons they dots they don't cost anything so it's just for cleaning purposes accumulated value connects to the addition and just keeps getting accumulated and then recorded values also needs to connect to the addition here don't forget once you compile all of the errors will be gone the only issue that we will have is here it says set accumulated value zero but what if you connect something that is not accumulated value zero what if you connect something that is you know completely um different right so so you you connect to to this node to this move out stream node uh for the value the variable that you collect connect is not accumulated value zero but accumulated value one then suddenly this doesn't work because it still writes into accumulated value zero you can't use this node uh in this context so I will delete it I will delete this node and instead I will write right um we can just drag out from here set float um um set Float by ref sorry uh the context not not the context but um naming skipped my head um it's not set float it's set by ref set by ref value set by reference right so you reference this instead of specifying which particular variable you want and the value of it let's drag all the way to here okay again accumulated value connects to the Target and then we drag all the way to here and now the value is you know the accumulation we set it and we keep adding to it and the loop body connects to the as as the trigger okay now we're Gucci compile it's red y hello be no longer exist on rades that's fine isn't it this should be fine compile there oh I I need to disconnect okay disconnect disconnect with control control key you disconnect from the event graph and now now it's happy all right now we're guci now we're cooking so now we are going to be getting the the the the uh smooth values right right here and what we're going to be doing is we're going to be adding them to the smooth array so we're going to be making one more uh variable just click on the plus sign I missed click on the plus sign and call it uh smooth smoothed array let me make this a bit bigger so that you can see smoothed array like that drag it in get smoed array add to the array this triggers it and the value is this and that just gets added to the Smo array okay finally we're we're we're we're cooking now all we need need to do is just kind of repeat it three times but it's going to be copy and pasting right so it's not not a big deal all right so it goes through it checks if we're at band zero and it runs this if we are if we are not then it should create another Branch like here and it should check equal is IT band one then if it's not ban zero is IT band one and if it is then it's going to make a smooth uh smooth out version of the numbers from band one then if we need to we create or not if we need to but so this is if it's true we will just copy this if it's not band one then we check I'm just contrl C control V we will check if it's band to and again contrl c contrl v and if it's not band two if it's false again we will check is IT band three then perhaps well it should be band three because it's only like four of them so 0 1 two three right so the false doesn't does will never trigger here it's it's going to be true always if everything else fails all right so we have that logic then I will just simply take um this smoo out uh function just the function without the variables I'll connect true to here contrl c contrl v true to here and true to here all right now the boring stuff right oh also I should have just taken these as well because you will be always adding to this smoed array right so let me just delete this and really quickly redo contrl c contrl v that's the group because you're always adding to the smooth array right um whatever smooth version you get of the four bands this is not sustainable if you need to do you know like uh 100 um element analysis at the same time like this method is not not sustainable you would need to use more elegant uh but more more of a black boxy type of a approach um but for four bands this is absolutely fine in my opinion okay we have um these values we can't just simply reuse them and also don't forget to connect the power um output to the current number input for all three of these like that okay so we can't reuse them we need new ones you know for the recorded values for band One recorded values for band two recorded values for band three um I will just simply select accumulate or recorded values contrl c contrl v v v I'm just making copies of it I'll just rename them uh so recorded values one recorded values two recorded values three I'll just select one by one drag them in get get oh that's it drag it in get recorded values two get recorded values three and just simply connect them just like that I'm trying to remember how I used to H doesn't matter okay then I will do the same thing with accumulated values two three a copy paste right and then one accumulated value one accumulated value two accumulated value three easy clunky but easy and then I just simply connect them like so all right compile save we're Gucci we're good to go now there is an issue and the issue is called our Smo array we will get um one second the isue is called our smooth array will constantly get it will constantly increase more and more because we're adding more and more and more values at every tick right we're just adding adding adding adding and never removing right so it's going to be per each tick our smooth array will get four values second tick 8 values 30 take 12 16 24 or 20 24 and so on right so we need to somehow clear the the array right so at this point uh I will make a sequence so sequence of events right uh it's going to make it a little bit cleaner right this is kind of done uh we get a smooth array but I once a single frame calculation is completed uh then I will make a sequence so for each Loop completed we create a sequence from it and then I'll say what needs to what needs to happen after what well first of all we need to wait my cat is screaming so first of all what we need to do is actually to um move the boxes or scale the boxes according to the smooth array values that we get and that's that's uh very straightforward we just connect then zero you know the first trigger from the sequence quence to our for each Loop input here right and what is going to be moving the boxes well that's going to be the smoo array right so the values will be red from the smooth array as it's um calculating how much it should scale not move sorry scale the boxes so from here I just fish out a variable called Smooth array get smoo array and we transform the boxes as I said before the accumulation of the values will just keep increasing more and more so suddenly we'll have more values than we have boxes and it's going to be weird um and they will just lock up because they will always just read the first three elements in the list so what we want to do is once this is done once the boxes are transformed then we will clear the array right uh I need to remember uh yeah we will just simply for then one we will clear array uh not set there we go utilities array clear uh which array should be cleared well you guessed it the smooth array get smooth array again clear and now it's reset to zero all right we're done we're done I promise I promise we're done so compile save check for errors so what happens at every frame of the not frame but like tick of the game um these four magnitudes are uh four magnitudes are created from these four bands right then each of the these magnitudes is split apart into separate segments and are smoothed out smoing happens by accumulating over time a number of magnitudes which is five I believe five magnitudes for each band adding them up and dividing them by the amount of how many magnitudes were saved right to average it's literally you know you add up the numbers you divide them by the number of the numbers and you get the average so we average them out right in doing so when the beat kind of increases then it's going to be a slower um increase rather than a jittery jittery mess it's much more averaged out once we have the values of these bands smoothed we add them to an empty array at the start it's empty first second third fourth right we just P populate the array with four elements then this loop at that point this Loop ends right and it's it this one triggers completed triggers it goes through here and the sequence starts playing first thing that plays is this this line right here it goes through every single box that we have here four of them and it choose is first box gets the first item from the smoo list second box gets the second item third box gets the third item blah blah blah blah blah right and it scales them according to it that's all it does once that is done this triggers then one and then the smooth array gets oops the smooth array gets uh zero zeroed out so everything is cleared from it and then the cycle continues another tick triggers uh the new magnitudes are recorded and blah blah blah blah right uh and this gets updated the smooth um values get updated and the boxes kind of move a little bit more let's see it in action play M pick a song finger nope good there we [Music] go much much cleaner and the cool part is that if I go into my uh functions move out a stream of numbers and here instead of five I use 15 so we average out 15 um time intervals rather than five and I choose the same song this is going to move much smoother right so you can control the jitteriness of it F1 by the way for for uh frame frame view frame wireframe wireframe view all right this was the I promise this was the most boring portion of the whole uh the whole tutorial or course uh next the next ones will be more interesting all right next up let's make a ball dance that sounds sounds weird but but I'm keeping it first step is to get some materials in here and the way you do materials in Unreal Engine if you don't know is you use a mega scans Library typically if you need some custom materials then you just download them you know purchase them and download them from the internet and use a slightly different pipeline or workflow P pipeline but in terms of Mega scans very easy uh it's it's almost a built-in Library it's kind of a built-in Library you go to window nope you don't you go to do you go to window sorry uh you go to create quickly add to the viewport uh to the project sorry uh quick cell Bridge right here click on that it will open up a new tab for you which will say bridge and it might ask you to uh sign in right and you sign in and then you can download you know a bunch of assets and so on for for free uh for your project which is very high quality very great stuff I'm I'm really happy with what they have here uh more importantly uh the materials right so I have already downloaded um this rock cliff material uh from Mega scans and I will just click on this it's medium quality doesn't matter I'll export it as medium quality and you can see that it immediately creates a new folder for me called Mega scans surfaces rock cliff and here I have my material instance not just that though if I double click on this particular material instance I can also see that there's um the parent material which basically oh you can't see it pop there's a parent material which basically means that there's a whole whole new world right uh behind what Mega scans kind of presents to you and since this is much more of a beginner kind of let let's get used to audio visualization type of a course we will not be diving into that at what we will be doing though let's go back in here what we will be doing though is creating our own material that can make a sphere that basically pulsates according to the music according to the beat and that's going to be awesome before we do that though I want to create a sphere in where where are we viewport there we go um viewport tab right here I want to create a sphere uh in my listen blueprint instead of these boxes so that um you know the material kind of looks cool on it um on a box the seams will not be as nice you kind of want soft object objects for this kind of amorphous um displacement so to create a sphere uh we go instead of selection mode we go to uh modeling mode right here we go for model no we go for create I'm being stupid uh and we choose sphere right I can place the sphere anywhere doesn't doesn't really matter where where we place it we have ourselves a sphere a few things to change about the sphere first of all the radius I kind of want it like a meter in radius like a big boy a big sphere if we need to we will scale it up even further then subdivision type box that's great uh subdivisions 16 the problem is that if I change like 16 or eight or four or two well you can really see two but you can't really see beyond 16 how many polygons there are and we will need a lot of polygons so instead I will tick mark here show wireframe to see the polygons and then here I increase to uh 32 nope 64 nope 128 nope 256 H sure I would like to go 512 but 256 seems to be okay then instead of uh in in not instead uh for the positioning I will say uh Target surface whatever pivot location should be centered just like that and then the movement should be like z0 Z zeroed out just like that perfect and I think we're good to go material we don't care about the material UV scale we don't care about that world space UV scale I don't care about that okay oh yep that's good we hit accept we hit accept we wait it's making it it's making it making a ball for us there we we go there there's our sphere the problem is how the hell do you get this sphere into this um actor right well you don't you kind of need to find its parent and also let's get out of the modeling mode into the selection mode here so to get the parent of a sphere that we have just created you can see here in the outliner uh you select it and here you see the the static mesh which has a funky name and you no you don't here on the right hand side bottom right hand side you see a mesh static mesh with a funky name you click on this little icon here that says browse to and once you click on it it just goes third person Maps generated gminas that's me um and the sphere right here so that's the static mesh that is represented here if I delete delete the sphere in here the static mesh still stays right let me re rephrase it for cool uh or not cool but really heavy sphere there we go that that's a better name right so now we have this this object right here I just double clicked on it we have this object right here that we can use anywhere in our Blueprints and the way you do that is if I go to my listen blueprint viewport I open up my content drawer and I navigate to where it is uh was it third person Maps generated get the minus there's the sphere I just drag and drop it in easy as that and now I have a sphere here right if I move it up let me move it up and actually let's move the boxes away a bit like that something like that compile look at it perfect now it's part of my thing my my blueprint right there's there's the sphere this should go higher now like that okay so with this done now now we have a sphere in here that's perfect the sphere will need materials so let's create a new cont uh in the content folder let's create a new uh folder called materials open up that one and create a new material in it and that material is going to be called uh Master not master but like a a sphere uh displacement sphere displacement or or something like that we will be using it on this sphere and I will um immediately go to my listen blueprint choose my really heavy sphere and for it inste for its material instead of world grid material I will expand this and choose uh something displacement displace a sphere displacement there we go that's it now they are connected now anything I change um in the material will reflect on this I can show you open up that one H interesting we are okay this this is a moment where we need to decide a few things so there is this new experimental uh material pipeline workflow that will become the main pipeline in further versions of un real engine but it's still experimental currently but I feel like for this tutorial to not become old I need to use it so we will be using it if you're following along um on an real engine version 5.3.2 5.1 5.4 even probably um you will need to enable the the the the the pipeline automat uh not automatically but by yourselves and the way you do it is if you go to settings you go to Project settings and here you choose substrate substrate substrate materials experimental you tick mark that uh it gives you a warning we don't listen to warnings substrate op peque material refraction we don't care substrate Advanced visualization shaders we don't care well uh let's choose the refraction why not right uh and then it asks you to restart now right so to restart for it to work and I will hit restart the moment I hit oh yeah save uh when I hit restart let's make this blinding um once I hit restart it's going to recompile every single Shader that we have this is going to take a little bit of time like 10 15 minutes maybe 5 so I will continue the lecture once this is done all right so after we have restarted Unreal Engine virtually nothing changed except that now all of the materials are written or or calculated with the new pipeline the substrate pipeline which is going to eventually replace uh the current one right let me position myself here so if I now open up this material right you can see that the nodes are a little bit different that's due to the new Pipeline and we have uhu like additional buttons or lever levers to pull to to make even nicer materials with that being said this can be replicated in the old workflow or old pipeline as well so first step is is to get remember that rock material that I have content dra uh where is it Mega scans surfaces Rock Come on load load okay double click load yeah there we go this rock material that we have we will be kind of using it not really we'll be using its texture so let me close that and explain it in a better way if I open up content drawer here where I have my sphere displacement material I can select all three of these textures with the shift key and just drag them in right here texture samples like that and sampling textures is really simple or or not sampling but attaching textures is very simple and let me just do the let's not do color yet actually let's let's put the color texture somewhere here for now and let's just work with these two so for instance normals right RGB right into normals wait for it bam there there there's your normals you know on the sphere previewed if I hit save since this is our sphere displacement material I go in here looks great I think this is a medium level um material so if I zoom in really close yeah you can see the pixels from really up close but D who who cares it's going to be moving either way there's going to be other problems at at play so that's just from normals right and then here this texture sample is um a unique one if I select it you can see that the name of the texture is um blah blah blah doesn't matter doesn't matter doesn't matter at at the end o r DP o r DP means first one o is ambient occlusion second second one R is reflection or sorry roughness roughness second R is roughness and then DP is displacement this is a heavily condensed texture which uses RGB values channels to kind of compress three different textures into one file right so R uh red channel is the ambient occlusion and it just straight up connects like that let me disconnect the normal Vector for now just just so that you can see H and you won't be able to okay doesn't matter trust me bro trust me bro so that that's your ambient occlusion maybe if I connect that to the base color you can see it better no wait doesn't doesn't work in the base color anyway trust me bro then second one is the roughness right that's easy we just connect that green channel to the roughness input like that easy peasy no additional kind of things to to to change and the third one is the blue Channel which is the displacement and the issue with the dis by the way from the roughness you can kind of kind of see the difference in the roughness I really hope that this is picking up yeah you can see there the difference in the roughness um the displacement um is actually like there's two ways of how you can displace uh stuff in Unreal Engine and the one that we're going to be using is the actual moving of the vertices of the mesh I guess it's more expensive than I'm not sure which one is more expensive but that's the one that we're going to be using either way so hey that it is what it is and it's called VP W position offset right and I technically I could just yink it in like that it won't really work as well because it's too weak but I could just take the blue Channel multiply it multiply by 100 and now connect that to World position Offset you know and it offsets and it offsets weird right and the reason why it's offsetting weird into One Direction is because this is just like strength that also has kind of a direction it's weird basically what we want is we want to give it a direction for each point for each verticy at which it should move right and we do that by using vertex normal vs not sure what WS world scale vertex normal WS what does vs mean who knows it's a mystery but basically this gives us uh the normals for every uh verticy and if I just connect them as my base color you can kind of see yeah you can kind of see them uh colored one second right so it converts the vector data into color data right so it g gives us a Vertex U normals of each phase very useful we use those and we then can multip ly so first multiplication strengthens the effect of this second multiplication multiply second multiplication let's do it this way gives that strength to the vector to the direction right so now if I connect this to my world position offset bam spiky boy let's disconnect base color let's connect our um normal map hey starts looking a little bit like a rock doesn't it hit save take a look at it in the in the viewport see if there are any glaring issu maybe 100 is a little bit too much isn't it okay let's turnone it down a little bit so instead of 100 let's do 20 five times less once we do 20 here it's it's going to be much calmer here than it is here but this is still pretty aggressive but hey that that is starting to look pretty damn nice let's walk around it yeah I love how it looks looks great okay awesome so we have ourselves a displaced sphere and of course the number or rather the displacement should be controlled through here so the the higher this number the more that sphere is going to be displaced also uh don't forget that we still have that color thing going on uh we will be using it but for now I just want to keep it as clean as as possible right because color kind of Heights problems and issues so we want this this to be a variable how do we make make it a variable well um you hold number one in your on your keyboard and click or you can just scalar scalar parameter you can do that as well right but uh the shortcut for me at least is holding One clicking right click and convert to parameter and then name it name the parameter we're basically creating a variable right and name the parameter loud you know how loud music is and we connect that to our B input right here and that is our loud loudness parameter and by default it is set to zero and minimum and maximum slider values we don't we don't deal with those we don't care okay for now uh we kind of put a pin in the material we'll come back to it but for now this is fine and we have ourselves a little you know a little cute material here then then then then this is a master material what we want is an instanced material and what I mean mean by that is uh Master materials for instance you can have a master material that has a um variable set to its color right so you have a master material called plain color and then you have derived materials from it instance materials called red blue green orange whatever right and and you change that variable to fit you know to become red blue green orange and so on so that that's the way it works and this is our Master material if I right click on it I can choose create material instance and I can say is sphere dis inst sphere displacement instance right so now I have you can see here material material instance if I double click on it completely different menu but the interesting bit is that now I have this scalar value that I can change in real time uh let me show it to you here so first of all I'll go to my uh listen blueprint I'll go to viewport select my really heavy sphere and here uh for its material I will change it from the regular one from the master material let's go into our materials I'll change it to material instance drag and drop in uh easier faster compile save virtually nothing changes right but now if I open up this sphere displacement instance I tickmark this um value and now I change this value you can see that I can displace this mesh in Real Time come on come on that that that's pretty neat that that's pretty damn cool isn't it I mean if if I over do it then there you know it's it's a little bit a little bit stretchy um this is due to lack of polygons right we are displacing quite a few polygons but um we would need more for this to be even cleaner but H this this seems to be quite quite nice already okay uh let me close that and now let's actually displace it Accord according to the music so I'll go back to my listen blueprint I'll go to my event graph and I will say all right so for this uh sphere that we have here actually we'll we'll we'll do we'll do one more trigger because here we have play the play the music we have here the tick actually um somewhere here I will create event begin play when we start the game really heavy sphere I'll just drag it in like so should have its create Dynamic material instance it should have its Dynamic material instance created so what we're going to do is basically we're fetching the material we're we're fetching ing the we we will be fetching that variable the loudness variable of the material and from this sphere we will get material we just get the material the current one that it has and we just slap it on the source material and we just connect it like so so it's getting the current material and it's creating another instance of it where it will be changing its um its values right and then all we actually need to do one second thinking we just need to set scalar parameter value parameter name should be the name that I chose here loud that's the parameter name I think caps lock like the L uppercase lowercase uh letters matter so make sure that the value is correct uh the name is correct and the value itself uh we we need to add up do we add up one second I'm [Music] thinking kind of yeah yeah we need to add up uh all of these smooth array values into one one value one big value that is going to be overall loudness right so unfortunately we'll need to do a few more Shenanigans with this okay let's drag this for to the left side a bit so the sequence when do things happen this will always be at the end right so let me just disconnect it and just drag it down to make sure that you know I I'll reconnect it later but we clear the values after the tick is over but when smooth array changes the boxes sure that's the I I will select all of this and just see to comment click the C button to comment that's the boxes right then I can take this smoo move the array get moved array I can do for each Loop for each element of the array so that's going to be the next thing that happens in the sequence it's going to add to this kind of a overall loudness uh variable so I'll create a new variable call it loudness and I'll just make a float out of it like that and just drag it in get loudness and basically as we're going through this array we just want to accumulate it right we want to add them all up into this number so it's going to be easy we take the number uh from the array you know element number one or element number zero and we add it to the loudness and that's the new loudness value right so we just grab the loudness again drag it in set loudness bam and that's uh it's triggered by the loop body so the way this works is um four numbers let's say four numbers come in yeah it is going to be four numbers four numbers come in first number goes in here gets added to the loudness list so it gets added in um and loudness is then set to that number so let's say okay uh where's my notepad I'll explain it with a notepad four numbers uh 5 4 uh 12 uh 1 right so this Loop is going to go four times first time around and uh currently uh loudness equals none or not a number right current l so first Loop five comes in five is picked because you know the loop starts array is one it fetches the first element of the array it fetches five right and five is added to loudness which is currently not even you know it it's it's empty it was empty so 5 plus empty is five right and then after this the loudness is set to five so we set the loudness to five after adding it right Loop ends next Loop begins currently uh loudness is now five and then four comes in 4 + 5 is 9 right so now loudness is set to nine and so on right and it goes four four times so 5 9 21 22 at the end of it loudness is 22 and that is accumulated you know all of these magnitudes accumulated into one number we have our loudness number once that is done all we need to do is grab this okay so C uh Cal calculate loudness like that then this happens and then actually set scalar parameter value does not happen once at the start it happens all the time right at on a tick so after loudness is calculated then we drag out here and we set scalar parameter value and what what that value needs to be well get loudness bam like that just like that um we might need to adjust of course some some some values but uh should be fine should be fine okay with that done this going to be c um send to material right this is useful and then last one is of course after everything is done the array smooth array that needs to be cleaned but also now the loudness value needs to be clean or else it's just going to keep adding in more and more right it's going to make it louder and louder so we set loudness to zero I just dragged it in uh and set to zero comment reset everything okay this should be good enough compile save play currently loudness is or actually also let let's do um uh print string and let's just print the loudness value on the screen play okay it's zero so there's no displacement M pick a song Good song [Music] open uh hello okay it's like three four in terms of value for for the loudness once the Beat Drops it's like eight I wanted to transform more right I want it to transform more so we can either ramp it up um where is it we can either ramp it up here or we can ramp it up inside of the material itself and I think I will do that inside of the should I do that inside of the material yeah yeah let's do it inside of the material so back in here where I have my displacement I have my my loudness multiplication H wonder why it's so smooth oh maybe it's smooth because it's I I'm smoothing it like crazy one second um five instead of 15 for smoothing iterations play M pick a song I'll choose this [Music] now it's like sevens and eights and nines H okay let's dial it in let's dial it in so the first thing um one second right here all right I think I think the only thing that we need to change is the exponent for the power I think we're just cramming down like pushing down the uh sorry we're softening the the curve remember the curve the mathematical curve we're softening it too much so I'll drop down the exponent to 0.5 rather than 0.3 and I think that's all we will need for this to kind of pick up instead of like fiveish let's go instead of five for this to go higher up once once the Beat Drops let's see [Music] okay there we go okay this is better and any further adjustments can be done by just multiplying then um the where is it multiplying this value before we feed it into the loudness uh to the material parameter okay we can we can move on uh okay so that's that's the displacement that's the displacement we we have it here also you can multiply it here if you want to you know whatever value you get you um multiply additionally by two and now it's going to be two times more aggressive if you want to all right now let's let's let's let's create a mask which is going to be a little bit annoying to do but I think we will manage so I want parts of this to Glow to glow and I want the mountains to stay normal but I want the inside of the core to be like orange hot core a missive material so what I'm going to do is I'll hold three on my keyboard and click can also type in constant 3 Vector same thing um I'll select it uh click here to choose a color and I'll give it like a very warm orange color something like that and I will not be plugging it into um the emissive color just yet or actually I can plug it into so that you can see what's going on uh press save now AIO visualization you know we have the sun um but I don't want it to be like that I want the mountains to kind of form around it um and then hide it and only when the beat really drops it should start glowing so first of all the intensity of it should should be controlled also by the by the loudness of the music the louder the music the more intense the the glow is so I'm going to multiply this value uh emissive color multiply connects now to theive color and I'll multiply this value by um well we need loudness right so I'm just going to crl c contrl v copy the that loudness parameter onto here and the problem is that if I just do this it might end up being too bright and too jittery um let's see because you don't really have a lot of yeah this is at zero why is it so oh my God this is laggy is it because I'm record it's because I'm recording isn't it [Music] yeah okay so it is working but I don't have control over it and I don't like that so I'm going to escape out of here also I say n trying to read prob oh remove from parent broke that's weird anyway uh we ignore we ignore if it's a problem then uh we will fix it if it's a onetime thing then we ignore right so this uh make having more control over this I will use remap value range remap value range and I will choose a bunch of inputs and targets right so basically I'll say what's the smallest loudness was the highest loudness uh that it should register and then everything uh and how it should kind of squeeze that um number range right it it's like remap numbers and then grass oper with like every programming language has certain ways of how to remap numbers anyway so our input low is going to be zero so I'm just um creating a scalar parameter is it scalar constant sorry it's just constant constant parameter and I'm connecting it to input if it's zero then the output should be zero but then if the loudness goes up to like 30 what should be the how much should it output I don't think it should output also like 30 it should outut like 10 cuz 30 is insane that that's way too uh Whatchamacallit like that it's it's way too too intense right so that's that's done that's done and now normal map goes like go away normal map no one needs you um and now we need to select areas okay this is going to be difficult this is going to be the tricky bit cuz now for this emissive map let me get it a little bit closer to the node for this emissive map we need to select areas that are not mountaintops and to do so we will need to use linear lurp linear interpolation all right and our linear interpolation sorry our linear interpolation will interpolate between um the a input is going to be our emissive map while the B input is going to just be nothing so basically we're just cutting away everything that is going to be below the threshold and for this we need a mask so white or black mask of the mountaintops of of the displacement oh this is getting yucky um okay but we can do that yeah we can do that okay let's let's really quickly disconnect the world position offset and disconnect the normal map we'll connect those later um we just like look at this sphere and I will connect the blue channel of my basically my displacement map as my base color so this is the displacement map on the sphere okay can we make it more contrasty I think we can so I can multiply it multiply this blue Channel all the way to here multiply and I'll connect it to base color to to see you know how how much brightness am I getting and I'll multiply it by like by like two does it make it brighter I don't know I will multiply it by five it definitely makes it brighter okay so if it makes it brighter that means that the tops the hill tops become brighter and brighter while the base stays dark kind of um I want now to have higher contrast and I think there's like a cheap contrast thing contrast yes cheap contrast perfect cheap contrast I'll connect result to the base color okay and now if I increase the contrast also I need the scalar value uh constant value sorry constant value right click constant choose the first one uh connect that to the contrast it's set to zero but if I set it to like 10 hell yeah okay oh it's just there though so five is a little bit too much what if we do two for the brightness okay two is like a lot of areas I don't like that seam one bit that seam is annoying I hate that seam that seene is seam is bad yucky yucky yucky yucky ew e ew anyway so how would this work oh yeah yeah this is the map right so I can connect uh the contrast white areas would then glow no uh White areas will be cropped out and black back areas the a input will glow so if I do this uh connect the contrast no not into B God damn it connect the cheap contrast into Alpha like that and connect Alpha into my emissive color instead of just you know everything is connected to the emissive color bam then technically it should work the problem is that right now it's set to zero so that that that that's kind of annoying um but if if we just do this for for just a second there we go okay okay so the valley is glow while the mountaintops don't that's that's what I wanted to see now we can connect it back and five is almost nothing glows while two is a lot of things glow that's good that means we just need to make another version of this so this is used for pulsating the light and this is going to be used contrl c contrl v is going to be used instead of a constant value to change um how much of the the the value is flooded with theive color so we're we're changing the mask in real time as well so if uh input high is set to 30 actually the this is going to be a little bit more complicated one input low is zero input high is 30 in Target low is going to be what was the number where what was the number where uh it was almost no black spots I think it was like five and this is going to be two yeah yeah five you can see clearly here and this is going to be two for Target high and now we are kind of good to go cheap contrast disconnects from the base color okay let me double check uh comment control the mask comment come on comment comment uh control the light intensity okay oh yeah uh that comment control the displacement okay save without normal Maps so this is going to look real ugly but let's let's check let's let's try this out okay just a sphere pick a song anywhere you [Music] go yeah oh it's going to explode isn't it explode nice there are issues well um you can see the seam right the seam is uh there because of the uh Whatchamacallit the the just the tiling the the UV seams right um which is sad but um it's it's part part of life part of life spheres have to have seams let's make it a little bit nicer so now um without having anything selected in the material two-sided I turn this on so that both sides are are going to be visible that's going to hide the seam a little bit better then the displacement was okay a is I think it was okay then the base color can actually now come in and connect cuz now we're not hiding anything and the texture uh sorry the the normal map also can come in I'm just going to have them like here yeah that's good enough okay save that let's play this again I feel like this is going to hide it a little bit better okay sphere looks [Music] great [Music] hit [Music] it nice nice nice nice okay we have it going shall we make it more aggressive um I I think we shall so let's go into our listen blueprint and or actually wait there was one band that didn't really I think this one is is pretty weak sorry I have to test it again pick a song anywhere you [Music] go which one is the low one okay if I'm looking at the sphere from here this is the first band and this is the last one so a th000 is hitting pretty heavily but the first one is not and also wait uh when we play uh which band does the beat rely on the most all righty then restart let's see how much we lost I think I I saved quite quite quite a bit oh it's compiling shaders 5,000 okay we pause the video okay we're back I thankfully have saved quite recently so nothing really disappeared save your files uh that's that's important anyway so I managed to figure out what was the culprit of this not being as aggressive as what I not hoped but what I assumed it's going to be and it was the bands that I was using right so we did like 50 200 uh 400 and a th000 right but the problem is that the Beat Drops at much lower frequencies you know the bo you know that that is a much lower frequency beat than the you know of of the um 200 uh ,000 Herz and then above so now if tweeting I guess it's called Uh so now if I play the same song at much lower frequencies it's very loud for me um let's wait now it's going to the beat is going to drop much harder see that looks kind of cool doesn't it all right so that works great I think it's even a little bit too great uh the multiplication here for the displacement I'll have like influence of 1.5 save and also for my listen blueprint I will move the boxes even further out from the sphere the sphere should move a little bit down like that and the boxes just kind of go even further out and they can also be a little bit higher all right so that is done let's compile save see how this looks like doesn't look that bad there's a shadow there's a sphere we're good to go so does this end our chapter 2 this actually ends chapter 2 I thought we will never make it let's end it on a good note uh this a different kind of song right now in chapter three we will move on to using Rhino grasshopper importing models from Rhino into un real engine and moving those models according to the song that plays right so again we will use the same same procedure if you don't have Rhino if you don't have uh uh grasshopper no worries as long as you are able to download the files from the from patreon uh you can follow along just as easily if you can't uh then you know this this is the end this is where the uh course ends but basically there's not going to be additional information when it comes down to functionality so for those of you who are here just for the unreal engent portion hope you enjoyed the video leave a like subscribe and those of you who are nerdy for Rhino I'll see you in you chapter three I guess okay chapter 3 let's go so you will need an element as well as a wall a surface on which that element is styled parametrically you know and it kind of reacts to attractor points or whatever have you I have here a little script well not a little but like a grasshopper script that I already did to test out you know I need to make sure that this works before I show it to you and it does seemed to work and let me just do one thing that I always forget by focals it's just a plugin for grasshopper that enables me to you know show you the names of the notes that I'm using but basically the the initial setup is very very simple you need to uh first of all go to units type in units and change your units to centimeters because that is what in real engine uses and if you're importing stuff that's in millimeters or meters the scale is uh will be out of w back second of all create a box that is uh looking at Negative X Direction and it it I know that it's weird that it's looking at Negative X don't worry about it just just create a a box like that um the measurements of my box here this is going to be like a placeholder for the element by the way is around 110 CM so 1.1 m in its length 3 ft a little bit over 3 ft in the length and then 20 cm in its height and around 40 cm in its width right 40 20 110 and then for the arch here it's it's made out of uh dup Edge F10 it's made out of four control Point nerves curve that is just extruded and I believe the distance between the ends is um 4,000 CM 40 m is it 40 m that sounds like it's a lot wait thinking 400 is 4 M 4,000 is 40 m okay so it's 4 4,000 cm and the height of it is going to be around yeah it's 5 m 5 m High okay now this surface and and it can be whatever surface you want to be it does not need to necessarily be this shape right we reference in into our grass oper file as a b oops wrong wrong button now I need to get used to this set one B There we go and we will divide up this surface into a grid of points right so I will say uh divide surface divide divide surface like that um I will use reparameterize on the S input of my Surface like so reparameterize so that the UVS that come out will be um locked to be be between zero and one um in in the range rather than telling me the coordinates in cenm I don't need that um then in terms of Divisions I'll just use yink the values from what I 12 by 115 12 for the U value 115 you just double click and type 115 for the V value by the way I do assume that you have at least intermediate level knowledge of grasshopper well no at least beginner level knowledge of grasshopper to follow along if you don't there's plenty of I'm going to be making a grasshopper for beginner's course wait for that anyway uh we have ourselves a grid and for that grid to work I basically want to eliminate all of the points here and all of the points here because if we start placing um these elements on the end points here that's going to be a little bit annoying a little bit you know Bad Jojo so we want to end at this road uh row to do so it's pretty simple you just remove or call index call index for the points God damn it for the points and your index needs to be SL slash z um to create a panel with zero in it hit enter to get another line one oh sorry minus one so you remove the first item in the list as well as the negative one which is the last item in the list if I connect it now it's going to freak out and tell me that uh text to integer failed because it's it has multiple lines and here you can just fix it by right clicking on the panel and choosing uh multi-line data and Ticking that and now it's fine now it reads every line as a separate entity okay with that done I how did I do this ah yeah okay so with that done now I will take this B again and I will populate it populate geometry I will populate it with random points uh 10 random points SL sl10 or you can just type in panel and then write 10 here don't hit enter click somewhere outside connect that that works as well SL sl10 is just faster see doesn't matter so 10 points populated on this uh surface and then I will do I interpolate them yeah I will interpolate a curve through them this is going to be very random very weird you know like that with the Curve uh interpolated I will project the curve um onto project a curve onto a b I'll project this curve onto a b uh the B being my initial form I'm in the way am I not like that b being my initial surface and U the curve that I just generated being projected on the beup but the distance or sorry the direction not the direction should be in the Z oh sorry in the Y AIS right so I'll just change this to oops to Y bam and now I get that that squiggle thing projected onto the surface and it's it's just a fast way of how to do a quick Squig squiggly line right on the surface easy as that with that line done now I will measure the distance between each of these points uh what's the closest distance from each of these points to the line and we can just use pull Point command on this pull Point those are the points that will be we will be pulling and that is the curve um the thing is that now if I connect you know all of these points they are in one um graph in one data tree right so meaning that they're in separate data branches and as they're being pulled on the Curve curve I don't think that they are getting duplicated unless there's multiple curves no there's two but they are not getting duplicated it's just that we don't need a data tree system here this can be just a cloud of points for all we care so I will right click on the P input and choose flatten to get rid of the data tree information so now the distances that come out will be in centimeters right and I can kind of show no doesn't matter uh will be in centimeters right and I kind of want to convert them to a range between zero and one because it's much easier to deal with you know a a proportion rather than distances or centimeters or what whatever so I will remap numbers like that the source domain is going to be um well range wait not range bounce bounce bounds you know getting the minimum distances and maximum distance that's the source domain and they get squished to be in the domain between zero and one that's all we need and then we get our answers right so now if I multiply this by any number is is just going to be um cleaner I guess right it's going to be easier for me to uh convert this to degrees for instance right um speaking of which now I should uh one second thinking thinking thinking still thinking UVS no we used the points I think did we use the points no we do use UVS okay I'm sorry um just like we oh I'm being such a stupid Buck um since we use the points here without them being called you know this does not do anything so instead of using just divide surface points I will be using the cult points like that and actually just like I'm calling the points I will be contrl c contrl v i will be coling the UVS as well the coordinates of those points right and with those UVS I will be evaluating evaluate surface surface evaluating the surface this B right gets evaluated at those particular UVS the reason why I'm doing this is because then I get the frames here and those are basically planes if I zoom in zoom zoom zoom zoom hello ples wait are they very small 10 10 cm let's do 100 cm planes that's weird it should show uh one second thinking still thinking unted UV oh that's reparameterized and this is not reparameterized so we need to reparameterize this one as well yeah so you right click on the S input and chose reparameterize and now we're good and 1 meter is too big for the plane so I'll make them smaller um like 20 cm something like that perfect so here we have our planes great and then uh with the planes uh which which are the frames I just need to rotate them according to how close they are to the curves right we're doing an attractor Point type of a script right so I'm going to use rotate 3D and I think the planes should be flattened yeah they should flatten that output so I'll use rotate 3D the planes will be what is being rotated the angle I right click on the a input it's going to be degrees change to degrees um the center is going to be the center of the plane so they're going to rotate around their own Center Point and the angle well that comes from remap numbers and you can see here that I already did the graph mapper and another remap numbers here and I think that's that's what we're going to yeah let's not Jazz things up we will do the same thing graph mapper this just remaps any you connect that remap numbers to the graph mapper right click uh where is it graph types B here and you can remap so that you know if uh you had 0.3 before now it becomes 0.1 or 0.25 before it becomes 0.1 if you had uh 0 5 before it become 0 four five right so it you can adjust how fast values increase and decrease so we do this kind of a siny thing well I did an opposite of that doesn't matter we we'll adjust accordingly um so that's done and then from these values now we remap remap numbers again but this time our Target domain is going to be SL slash and we write down the minimum degree and the maximum degree I need to check 30 to 130 okay SL slash3 to 130 so now I can explain this we measure the distance between all of our grid point points that we have here to the closest curve that we just this squiggle so the closest point from each of these um planes gets measured the distance gets measured and we get it here then the distances get squished to fit in between zero and one the proportion stays is just you know we we divide them up so that uh the whole range is is squished between 0 and one then we apply this kind of uh curve to it so that it um it takes a while for the number to increase and it takes a while for the number to decrease right and then at the end of it we um convert it or we expand it into a range of what kind of degrees we expect to have which is 30 by 130 and those are now our degrees that we will use on these planes right so we rotate them the question is okay what's the angle around what are we rotating them that's going to be the Y AIS the green Vector of each plane right green is y AIS so we can just deconstruct plane like that grab its y AIS and connect that to the axis input here so now all of the planes are um rotated and I actually at this point can show you what what's what's going on I'm just by the way hiding all of the preview of everything except the final out uh like this output here I can do a quick sdl line sdl uh so start Direction and then length is going to be like uh let's do a meter long lines and you can see that hm yucky well uh it's not going to be like that because this is looking in the opposite direction but uh still um they rotate according to how close they are to the curve you know the this uh this lines and I can change that by changing the graph mapper it's very hard to see with line segments right okay let's move on let's actually position our element onto this plane right so to do that we will use Orient just a regular Orient um it's going to ask us for okay what's the geometry that you want to orient that's going to be our B rep right here our box so I reference it in as a b connect the original plane from which is going to be oriented is World XY and this is the default World XY which is great and it's going to be oriented to all of these planes that we have here bam taam we have ourselves a parametric wall that does things right and by default it's set to 30 but when it is wait is it upside down it feels like it's upside down wait um how does it look like if it's 30 to 30 yeah so 30 is like that and 130 or whatever it was it raises it right and we can control by how much basically you can control the wave oh this looks nice this looks lovely okay we keep it so we get ourselves a parametric wall that is somewhat random because of this but other than that you have quite quite quite quite a bit of control um with that being said I have modeled out should select it I have modeled out this subd shape instead if you want the subd shape uh and you can't be bothered to model it um or any shape you want if you can't be bothered to model it patreon support the channel Link in the video description you you get all the files I'm just going to keep repeating that anyway so the this subd shape I want to use that instead of the box right so I just reference in subd set one sub um and just connect that to my Orient like that oh it's going to be crashy isn't it oh no oh no oh can I escape oh no okay don't do that no don't just connect subd convert it into a mesh first okay thank God that works uh I disconnect this immediately and uh mesh from subd really oh there it is mesh from subd like that and uh density uh should be for testing just zero and just connect that as our geometry there we go okay we have ourselves the you know a little bit more elegant element here a little bit nicer if I do custom preview uh then you can see the ah Cat come on no no not now that is working so if I do custom preview then you can see you know that element in action which looks pretty nice anyway now we need this logic this orientation logic to be transferred from grasshopper into Unreal Engine and I already have uh in in this uh YouTube channel I have shown ways of how to do that but we are going to be be um somewhat repeating it just for the sake of clarity and that everyone's on the same page what we will be doing is we will be creating um I can show you we'll be creating this kind of a list of things index X location Y location Z location X rotation y rotation Z rotation right we'll be creating this kind of a panel and we will be streaming it or saving it as a Excel spreadsheet and then we will be using that in a real engine reading that and placing the element according to the data from the Excel spreadsheet that's how we make it kind of talk should work hopefully we'll see right so now after orienting um I can just do first of all indexing index is easy I will just create a panel SL SL index write index enter that's the name of the row or column of the column that's the name of the column then uh I will just count I'll use series I'll just count how many elements are there right so list length list length connects to count series it just counts you know 1,480 one but we started counting from zero so, 1482 elements and I'll just merge them merge that and that and that's it that's our setup right so I right click flatten right click flatten to make sure that everything's in one list we're happy we can go right so that's the index now for the location location is very easy to breing break apart that is literally just the uh plane origin XYZ coordinates right so I can just deconstruct plane deconstruct plane like that I get the origin I can deconstruct point and I get the XYZ uh coordinates and then all I need to do is just uh copy this bad boy right here well I don't need the series only this x connects to this I'll just copy it two times like that like that y connects to this Z connects to this and I can just eliminate the D3 inputs we don't need them and this is going to be xcore lock Lo ycore Loc and zcore lo oops okay so that's done uh we have now we will be able to just place the elements but now we need the rotation values right which is difficult really difficult the way we're going to do okay and the reason why it's difficulties because um we need the Y pitch role uh rotation uler rotations rather than the regular rotations that are used here in in in in Grasshopper And to do that we need a script we need to actually write code which is very very annoying but um we can do that or rather we don't need to do that I will I will pay past the code into somewhere there is going to be in the video description maybe a notepad file or something like that that you can just copy paste right into your files that's going to be accessible to everyone uh right but this is the C script that we need to write right and it basically takes the transformation information of this Orient and converts it to UL rotations I can show you um and I'll I'll yeah let's do it slowly copy paste um like that and then it gives us degrees degrees degrees in um oh there's no type hint okay uh it gives us degrees for uh roll pitch and Y and uh Unreal Engine X Y and Z right if I double click on the C script and wait there we go it loads in and you don't care about anything here but what you care about is this area right here which basically it it f fetches the get y pitch roll from the rotation values that it get gets from the translation values wait translation transform from the transform value sorry sorry anyway I'll I'll uh copy and paste this I'll I'll just make sure that when you create your own C script that it works so let me do it real quickly uh double click C uh C script there we go zoom in get rid of out a needs more friends ABC get rid of Y just leave the X in here right click on the X write uh transform without any any capital letters name it transform a needs to be uh GH capital letters roll small letters and real engine UE capital letters X basically um the logic for this is the output is grasshopper roll but in Unreal Engine it should be connect uh connect yeah the output is grasshopper roll but in Unreal Engine it should connect to Unreal engine's X Rotator uh input right again GH y on sorry GH pitch and real engine y GH yo and real engine Z okay now now we're kind of cooking I'll right click on the transform here and I'll choose set data item no sorry uh type hints I'll choose type hints and I will find transform hint like that uh the name a does not exist in the current context there's no a what do you mean oh yeah that's if I double click on this it's probably going to have yeah a equals null there's no a so it's complaining right so this is where we copy and paste the code at this point right so let me just get it and you will have this in the video description like that copy and I just instead of a equals null crl V this whole thing right play it's happy with us I can connect the X to here it works perfectly fine right so we use that okay now um I will just borrow this x y z location crl c contrl v and this is going to be X rot y rot Z Rod okay and then for uh the roll I can't just connect it like that because okay I'm I'm trying to think of how how I can explain this so there is the left hand coordinate system and right hand coordinate system basically the difference between them is um if I right here you can see here in the corner YX Z or even better I can show you here um left hand core the net system versus uh there we go images that that that that that that that the these these coordinate systems notice that they are different guess what Unreal Engine uses one while Rhino uses the other suddenly all of the rotations and all of the alignments really mess up and it's very annoying to get them to work but we will but because of that we will need to do a few things um and one of them we already skipped and we will need to come back to it so the first thing that we need to do and I'll double check yep uh the y direction Y location is actually going to go in reverse right so Y location we create a negative like that and Y connects to negative and then it connects to to Y location like so then for uh let me just disconnect that real quick there we go then for rotations I need to double check degrees yeah that's fine oh this gives us radians oh yeah yeah this gives us radians so we do degrees for all three of these for all three outputs degrees and only the Z rotation will need to rotate in a opposite way I think opposite as well as 180° should be added uh 180° I think because um yeah 180° because the element is looking away from the positive x-axis but easier to add here so negative and then plus SL sl18 add that in okay minimize minimize minimize all right we're done well kind of done uh now we just need to assemble everything into one data stream and then then we we're we're Gucci we're flying right so I will use merge to merge all of these and I think grafting is yeah yeah uh so we the output of all of these needs to be grafted and simplified uh that's a mistake on my end I should have done this before graph simplify so that they all come in in separate data streams uh data branches but at the same time once we merge them all together they will be merged in rows which is very very useful and that's going to save us was a lot of time with editing okay and then I merge all of these and I'll show you how they look like once we are done okay we're done bam then SL slash if I show you the panel first row second row third row and so on the thing about CSV files the Excel spreadsheet files is that they need to be divided by the comma so different columns for each row need to be divided by the comma so what we'll do is we'll join text that's the wrong one text join we'll join the text and the joining character is going to be the comma like that and now the result the resulting panel is exactly what we had in here right T right so now to save this we right click stream destination and we just find I already have one GH CSV but I'll make another one um g h CS CSV YouTube YT and for the files not all files but am I blind CSV comma separated value files there we go right hit save we're Gucci now you just need to click on stream contents and now every time you update anything in your grasshopper file here this is going to update and is going to overwrite the existing CSV file right finally we can go back to um Unreal Engine here in the blueprints I'm going to to create a new blueprint class uh I'm going to fast am I not in the blueprints in the blueprint folder rightclick on the empty space and choose blueprint class should be here in the blueprint folder right click on the empty space create a blueprint class choose actor and write parametric wall or something like that you know the name for the blueprint also import or we can't import yet uh we need to create a struct we need to create a logic of how to read the CSV file that we just wrote in grasshopper so we right click and I think it's under input no it's not damn it um blueprint yeah it's it's under blueprint structure we create a structure for reading and we will say um grasshopper read struct GH read struct doesn't matter the name doesn't matter of this double click on that and here basically what we need to do is describe every column um that that we will have so we will have uh six columns in total index doesn't matter index we ignore index we'll have X lock y lock z loock x rot y r z Rod right so here first one rename xor lock float then we click on ADD variable it's going to immediately be float again uh y lock actually I'm just going to add add add add there we go zet rot uh Z Lock sorry Z Lock then X rot y rot Z Rod there we go location location location rotation rotation rot rotation XY Z XY Z yeah everything's fine save that and close it and you will never open it ever again basically um then uh to import the CSV file you just click on import you [Music] choose well you find where it is there we go GH CSV YouTube hit open and it's going to ask you okay this is a data table for sure but is going to ask you what's the struct that it should follow what's the structure and we will find um GH read struct the one that we have created select that hit apply and now if I double click on this data table you can see all of the nice values that that we have here awesome X lock y lock Z Lock X Rod y Rod Z Rod we will now read those values in this parametric wall um parametric Wall actor right so I just double click on that that actor open full blueprint editor there we go and now let's get rid of everything in the event graph we'll create new ones if we need to let's go to viewport and and and and and and sorry thinking real hard real fast thinking still thinking actually let's yeah let's just add a cube and we will be rotating cubes for now and then later we'll replace the cubes with our actual panels that's going to be fine um let's go to the construction script so the construction script is what runs before you even begin playing right so you can Define that you know a thing should copy itself like 20 times and it's going to be shown being copied 20 times in the viewport even without you running the game event graph events only happen during play time during run time right so that's that's the uh main main difference between the um event graph and the Construction Construction script so for for this to to work first of all we need to um get data table we are in construction script by the way get data table uh row names we need the rows and our data table is is the grasshopper CSV YouTube data table like that we get the row names and now we need to go through every single one of the rows one by one um so we will uh for each Loop you know it this by now right for each Loop and we will get um the actual rows from the names right so from this array element we will get data uh table row so We're looping through the whole data table and we're getting the rows uh don't forget to here also select the same data table or else it's going to freak out right here and here these two data table table important and here we have the row and we will break the row into these outputs we break it and now we can use this outputs to um add instance damn yeah we need add one second I'm thinking I'm thinking I'm thinking I'm still thinking um damn it uh let let me see if this will work no this won't work okay so let's go back in here um the cube is a static mesh not an instant static mesh so if you multiply the cube many many times it's going to not be happy and real engine is not going to be happy instead what you want to have is instant static mes that's not a problem to do all we need to do is just delete that Cube and instead add instance static me mesh instance static mesh and we'll just call it element element right right now it's empty because it does not have any form associated with it but if you select it and here on the right hand side you click on none then you can choose whichever you know shape you want and I want the cube Cube please just a regular Cube please there it is just a cube compile and it's not going to display I don't remember why uh I'll need to remember remember why come on remember why we'll figure it out I guess right anyway um for now it's not displaying but uh I'll I'll I'll I'll see I'll see we go back to construction script and now we can drag it in here and we can add instance yeah there we go add instance so we're adding an instance uh if row is found the instance should be added and it should read these values and create a transform right so what I'm going to do is make transform make transform and location that's going to be make vector and we basically just connect X location Y location Z location to the make Vector then for rotation is going to be trickier it's going to be make Rotator not make Vector but make Rotator X rotation y rotation Z rotation and for the scale we don't care it's just going to be 111 we we don't mess with the scale right and technically if I compile and save this yeah there we go there we go there it is there it is now the boxes are indeed there happy happy happy okay uh now if I just go to my map I can just drag this in and I can see well it's very hard to see but I can kind of see the boxes here doing their thing maybe at this point we should make this a little bit bigger so I'm going to increase the attenuation radius a bit to like 2,000 and that that should that should make it nicer right so this is how you can have like 2,000 Cat come on no no this is how you can have like uh 2,000 boxes well in this case boxes and not not sacrifice any performance whatsoever it looks kind of nice as well even with the boxes okay now let's go to the um event graph and make it make them spin right that that's that's what we want to do so in the event in the event graph what we're going to do is we're going to say um on every tick so event tick event tick um get this element and get so I just drag and drop it in get this element and get instance instance count so basically count how many boxes in this case how many elements do we have and then we will for Loop we will create a loop sorry it's not going to be the first index it's going to be the last index like that and we're just going to go through every single box and we're going to update its um orientation right or right it's it's transformation so We're looping through the boxes and what we're going to be doing is um what's the best way so we're going let's say We're looping looping looping and we're at box number 585 so this index will be used to get item from from um from these boxes right what are we looping through though one second no that's going to be fine uh so we will use a command called update instance transform and it's going to be for the element right and here it asks us actually for what's the index index you know what's the instance index easy that's the current index at you know of the loop in which we're at easy peasy and loop body just connects to here I think yeah so this triggers every time and now okay during this whole thing as the Transformations are updated new instance transform should be should be made right so the new instance transform is okay make transform that's easy nope not relative make transform a new one scale 111 that's fine but the location actually location doesn't matter and rotation matters right so location we can just get um how do we get the location oh I know I know a way I know a way compile go back to the construction script and this the value that we get for each you know the transformation that we create for each of the boxes or elements we can just save it into a variable right into a list into an array so here uh under variables I'm just going to create right uh click on the plus sign for the variable and I'll say uh saved transforms saved transforms and the flavor of it is transform and it's going to be an array so top right corner you change it to an array here because we're going to be keep we'll keep adding to the array right maybe not saved transforms I will rename this to initial initial transforms so this is where it starts from right initial transforms bam uh get initial transforms and then add uh to this array and we're going to be adding this uh make transform the transform that we just made we're going to be adding it to the initial transform array like that and now the of course the wires need to go through this add just like so so for as We're looping through the whole list right and creating those boxes we're saving their Transformations so that in the event graph once we're in the event graph we can take the initial transforms get initial transforms and we can um get a copy from them so we can extract a particular index from the list of transforms of that particular element that we're about to update and we can break break the transform to get the location also you can get a scale if you want to and the rotation is going to be the only thing that's going to be updated and actually not just not even the whole rotation but only the Y rotation the Z and the X will not be we just transform it like that right so we can break Rotator not into XIs just break Rotator and here we can make Rotator and X as well as Z will be you know not not will not change why will change okay almost there almost there so now now now now uh we need to get the loudness remember let me compile this real quick listen blueprint uh event graph PE PE PE here uh there we from smoooth array we just record the loudness and then we parse that loudness into our material we'll do the same thing with the grasshopper so at this uh stage where we send it to material we'll we will also send it to our wall right so after print string we can say get all actors of class and we will find parametric Wall actor that we have created get a copy right of the parametric W actor and now we need to write into a variable that we have in our parametric Wall actor and to do that we need to create an actor here or sorry a variable here so on variables I click the plus sign I say loudness make it into a float and it's not an array so I'll change its flavor to single drag and drop in get loudness right compile uh then back in the listen blueprint we will set loudness cuz now this uh with these two nodes we're in the parametric wall uh where we're getting into the parametric wall uh blueprint from our listen blueprint right and we're just going to set the loudness according to the loudness here actually that that variable is uh I don't think it's pedagogical for me to use the same variable name so here I'll change loudness to parametric cloud parametric cloud like that and here we will set I need to compile and here we will set parametric cloud with the loudness um variable that we have in our listen blueprint get loudness bam like that perfect okay compile save now uh I will of course save everything [Music] and connect the parametric Cloud to pitch to the new as the new rotation and we will just check if the if things move at all uh where's my wall oh there it is it's just very dark M pick a song uh music music music p H so it doesn't move it doesn't move because of one thing and that is where we have update instance transform in our parametric wall blueprint uh Mark render State dirty this needs to be tick marked so that we um push the render of it even when it's well not necessarily not ready but oh you can see that immediately it shows up and if I pick a song Good [Music] [Music] open okay that works uh but it Works poorly so let's make it work better right cuz we have original values right of this pitch uh these pitch values and they are between 30 and 130 because I I know because that's what we wrote here 30 to 130 the problem is that um what's the problem the problem is that in Unreal Engine everything is kind of rotated 90° downwards so 30 becomes minus 60 it is what it is so just deal with it so while in grasshopper we Define something as 30 to minus 30 in a real engine that's going to be uh - 60 up to 40 no uh 70 up to 70 right minus 60 up to no up to 40 up to 40 yeah - 60 up to 40 okay so what we need to do here in Unreal Engine is take this loudness value and we need to map range clamped and we need to say that when it's not playing when there's no loudness at all it should be zero but when it's playing you know what's the max maximum um around 25 according to what I saw with the numbers on the screen you know with the how big the numbers got it was 25 30ish um and then for the output range um that's going to be minus 60 at minimum and at maximum when it's loud it should lock into the existing pitch that we have exported this with so this is always going to be the maximum of how much the whole um wall transforms itself right and locks itself down and then I connect that to the pitch like that compile save play hope that it doesn't crash pick a song anywhere you [Music] gowhere I'm waiting for the louder music oh yeah hell yeah all right so that's working save um now all we need to do is replace the element the cube with you know not a cube so I'm going to go to content right click new folder shapes or geometry geometry double click and uh here in Rhino I will just um for my subd I will make another mesh from subd but this one will have density of one it could have a density of two if you want to and I'll just bake it right so here we have have a mesh version of my subd and then I just export it you understand what's happening right uh I'm basically just exporting this um I can't export a subd into an real engine it's not going to understand what it is but it doesn't understand meshes and I'll just weld the mesh as well just so that it's clean and nice and dandy and I'll just export it as uh fbx file bam I have it somewhere here I have it somewhere here element there we go and just hit save my options for exporting are like these map Rhino Z to fbx Y that's sck marked right and just hit save and then it's going to export once you've done that that then you just H import you navigate to your file open failed failed to create asset content detex import type no mesh is found in animation what okay we try again 35 kilobytes fine it's fine open okay fine I override this then I don't know why uh it's it's not not not being good to me right now so motion Builder element element element YouTube fbx save that is saved okay close that import YouTube open oh feel to Great acid geometry please okay okay I restarted in real engine and it seems like it just just works now okay so if you have this problem just restart and real engine and then you're good to go anyway uh we have ourselves the element I just selected it I will build nanite for it or actually yeah I will build nanite for it everything else is fine we don't need to change anything else import smoothing Gro yeah whatever um and here we get ourselves the static mesh um element um that we're after and it's it's materially is set to you know to black but if you open it up and recompile it it's going to be turning white um I will just make it a little bit less white like that save overly bright uh materials are a little bit annoying um right so with that done now this is our element and now we can yes please uh now we can open up our parametric wall blueprint go to the viewport select the element and switch the cube for our element like that material automatically updates compile save oh they're uh in inverted for some freaking reason H interesting interesting why why why why why why why so 180 was not necessary I guess I assume that's fine I'll I'll show you how to how to fix it for now I just need to make sure that it works so let's find [Music] music yeah they're kind of [Music] moving okay and they're going downwards which is weird because they should be going other way around so I think I messed up with this um but at the same time this seems to be okay um so my guess is 180 is not necessary here the cool part part is that now I can just dis uh disconnect 180 from here like that like troubleshooting this kind of system is very easy I just disconnect I don't even need to do anything here I just go back to my blueprints right click on my data table reimport go to my uh parametric wall compile bam automatically re recompiles this looks correct right unless they will start moving upwards then then that's that's going to be bad yeah they are all looking upwards so that ain't good but that's fine we will we will make this work I wonder why did the last [Music] ones [Music] all right okay so it's almost working it's it's almost working so what we need um this is looking upwards um so that's minus 60 right um 1 second- 60 is upwards and then it goes downwards so we don't need it minus 60 anymore it's it's weird um like the con conversion between the right right hand side coordinate system to left hand side coordinate system is is always always funky so this indeed does need to be 30 not 60 anymore or even more right play look at it is it looking downwards now it indeed is m pick a song I'm going to pick a simpler song like [Music] that yeah it's a bad song to test this out on because um the Bas line is very constant right so there there's no vibration from the beat there's almost no beat beat um but that seems to be working quite well one thing that I noticed is that it's very easy to reach the 25 overall loudness value so I'm going to go for 30 you know and just get that that ceiling up a little bit um let's do this again M pick a [Music] song any come on and there we go okay we are almost done we are almost done I'm I'm I'm I'm happy are you happy I'm happy so we do this uh 909090 we do this when you press play y that's good and then then we will get another one oh the the boxes though those can be on the opposite side right so I'm just going to go to listen blueprint viewport get those boxes in here F to them or focus on them and just yoink um the character spawns somewhere here so I'm going to place the boxes there yep that that sounds about right um this moves out a bit like that and the wall let's make two more lights uh one here e like that like that w H maybe maybe sliding Shadow like that let me just check nah I actually kind of like this more just a little bit higher here we go something like that and the brightness is okay attenuation could be slightly larger to 300 um this should be called this should be white I think we're done oh I I eliminate also the where is it event graph print string no need to print anymore the numbers we're done we're done we're done file save and just enjoy um where is it new editor window full screen it there we go M pick that song anywhere you go you [Music] [Music] belong woo all [Music] right [Music] [Music] I hope you enjoyed this one if you did leave a like subscribe tell me tell me in the comments it was a long one I know I had I tried to explain as much as possible it is uh a little bit more difficult of a proceed procedure than just to do visual stuff to do visual stuff that kind of reacts to another medium but it is fun and hopefully you will kind of it will get your mind going and you'll figure out ways of how you can incorporate into your own Creations even if you're not into audio visualization but perhaps you know as an architect there is also a way of how to use sound for you right in your designs with that said I'm going to go and sleep now thanks for watching bye
Info
Channel: Gediminas Kirdeikis
Views: 5,894
Rating: undefined out of 5
Keywords: architeture, design, arch, architec, proces, how, client, clients, rhino, family, house, lithuania, company, very, good, architecture, vray, d5render, render, real time, free, for free, alternative, rtx, gpu, bim, revit, archicad, section, dynamic, drawing, visualarq, visualark, visual, arq, v ray, v-ray, skechup, material, rhinoinsiderevit, rhinoinside, rhino.inside, .insiderevit, zaha, hadid, beam, block, ibeam, grasshopper, gh, adaptive, shecule, schedule, cinematic, d5, d5 render, course, tut, ue5, unreal engine, archviz, VR, virtual, reality
Id: LOC11v8AO5s
Channel Id: undefined
Length: 244min 29sec (14669 seconds)
Published: Tue Feb 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.