 Hey, what's up everybody? So in this video, I'm going to give a very basic quick start with MetaSounds and how to make some procedurally generated music with a tempo control for your games. All right, so the first thing we want to do is you want to create a new project in UE5. This is just the basic project with some sample content and you need to make sure that you got a plugins and that you do a search for MetaSound and so you want to make sure that this is enabled and so this talks a little bit about what MetaSound is. It is a way to, you know, graphically design some sounds for your game, for your video, for your whatever that you're making in Unreal Engine. You can create music with it, sequenced music, or you can use it for sound effects. There's a couple of different tutorials out. I'll put some links in the description if you want to learn more about different ways to use it. All right, so now that you have the plugin installed, if you right-click in your content browser and you go to sounds, you should now see that you have a MetaSound option and this is what a new one looks like. You have this on-play trigger, you have an output trigger, and you have the output audio. I will switch over now and show you one that I've already been working on. Okay, so here's how we use these triggers to feed into the main system here and to to receive them and to create the sound. Okay, so let's start with what I'm using for my kick sound here. So I'm coming in, I've got this the whole note trigger, so it's going to be hitting on the one of every progression through. And so what I've got going here is a little more complicated than the other ones because typically the way that you synthesize a kick sound is you have a note envelope on a pitch and that envelope quickly lowers the note and then you basically are gating the sound out of it with another envelope. And so in a very super simplistic way, that's kind of how that works. And so I'm generating a MIDI note here, fairly low. I've got this been set to 45. It's coming in, it's transforming the MIDI note to the frequency. It's multiplying that by this envelope. And so this float envelope is basically taking this initial pitch and lowering it quickly. And so then that's being fed into the frequency of a sine wave here, which is also going up and down. And that's being filtered here with another envelope being multiplied with that. And then that's coming into our main mixer here into our channel one. And I've got that set fairly loud because it's not a very loud sound. At least I wanted it to be louder because I wanted to have a little bit of an oomph to it to kind of a kick. And so let's take a look at what I'm calling my snare sound there. And this is actually happening on every half note. So on the one and three basically is where this is happening. And so it's coming in. I've got the half trigger. Let's see. I'm actually not using this envelope here. I can probably clean that up and delete that. We're coming in to this envelope and we're basically just creating a white noise just to kind of have a little kind of a snare-type sound. And we're having the decay time pretty pretty fast on that, attacking it immediately. And so it's the idea there is to try to get it to where it's, you know, a percussive sound. And then I've got this delay note that I'm adding on to here. I'm just adding like a 0.5 delay time and I'm kind of mixing out, you know, full dry and the wet is only at like a 0.6 here. And that kind of just adds a little bit more of a snare reverb type of thing to that. And I've got that coming out and going into channel two of the main mixer. And so that covers our kick in the snare sound. So let's see. Let me just drop this down to 0. And let's see if we can see what that sounds like just on its own. So now let's add a little bit of melody to it. Let's add this back to 1. And you can see that I've got that snare sound mixed pretty low because it's pretty abrasive. And I just kind of wanted to be in the background and just kind of be adding that additional rhythm to it. And so let's see. We've got two elements here so far. And one is sort of my bass and one is the other melody. And the bass is being triggered on the whole note. So, you know, it's triggering kind of along with the kick drum. And we're basically grabbing a random note between, you know, 60 and 72 in this range. This is sort of the middle range of the keyboard. We're pulling it in, you know, quantizing it to a MIDI note. We're basing the root note off of this other input that I've created, the MIDI key. And so this is so I can make sure that all of the melody elements are all on the same key. And so basically 0 is C, 1 is D, you know, and so you go up. And so another experiment I want to do with this is changing the root key of these to create a chord progression in another video. But for this, we're just keeping it within the same scale here. I'm using a major pentatonic on this. You know, we're not having a whole lot of notes here. So this is pretty okay for what I want to use. You've got tons and tons of scales, probably all of them here. We're just going to use this. We're pushing that frequency into a triangle because I kind of want it to be a sharp bass type sound. And let's see, we've got an envelope here that we're using for that. We're multiplying those and we're putting those into channel one of our melody mixer here. So then we come down to the melody trigger. This is being triggered on the quarter notes. So this is happening on four notes out of every progression. And so let's see, we're kind of coming in the same thing. We're doing the same note range on this. I was experimenting with this and I kind of like this bebop major. It kind of adds a little bit of the blue notes in. Once again, we're setting the root note using the same MIDI key over here. I've got that currently set to the key of D. And let's see, so we're coming in, we're multiplying the float. We're putting this into a square wave just to kind of change it up from the triangle a little bit. This is fun to experiment with. You can add lots of different ones of these like you've got, you know, a triangle. Let's see where all the generators are. So you've got, you know, your LFO, your noise, sol, sine, square, triangle. All of these are all built in. So you can stack these and experiment with these just like you can. If you have synthesizer keyboards and you can switch things around and plug things in, this is a software equivalent to that. And so basically I've got that coming out. I've got that going into another simple delay here with a very short delay time. I don't want to muddy up the rhythm or sorry, muddy up the melody too much. And I've got that coming out and going into this other the third input here of the mono mixer. And so basically, you know, I could use the wet and the drive this to kind of do the same thing. But I wanted to experiment with increasing this delay using an input in a future video. So I've got it set up like this. So basically then we've got the melody coming out and it's going into the third channel of our main mixer. And so we've got our kick, our snare, and our melody. And these are all being mixed and they're going out to the audio output. And when you hit play with all of it, this is how it sounds. So then you've got all the pieces playing. I can, let's see, if I go over here and change the ppm, I can change this to 250. And let's see, play again, it should be quite a bit faster. And so now I'll show how you can set these input values in a blueprint. Okay, so changing these inputs for Metastown through a blueprint is actually pretty easy. It took me a few minutes to figure it out. I had to look through some documentation, but I eventually figured out how to do it. So here's how to do it. Basically, you can drag your Metastown onto your scene to your level. And so I've got it right here already. It shows up as an ambient sound. You can see we've got everything already set over here. But your input variable doesn't show up over here for some reason. So the way that I change it, let's just do it in the level blueprint to be easy here. So basically, I've got a reference to the audio test one. And if you don't know how to do that, you can either drag it over from the other screen or you can make sure that you have it selected here. And then when you go to the blueprint, if you right click, it'll give you a create a reference for an audio test one. So that's a little nice trick for blueprints. So at any rate, we come into here, we grab the audio component of that. That's actually the Metastown. And we're going to get the parameter interface. And so this is the interface code of the audio component that allows us to change parameters. And so when we first come in, we are going to take that interface and we're going to set a float. And we're going to set the float of 50 on BPM. And so basically, when this starts, we're saying play this audio at 50 BPM. And I've just set up some little debugger quick keys here, one and two. And you can do this easily by right clicking and just hitting, you know, the key on your keyboard three or whatever, it'll allow you to do that. So I've got one here going when it's pressed, it uses this interface reference and we're setting the float to 200 of the name of BPM. And on this one, if we set it to two, we're basically just resetting it back to the original 50. I really dislike the fact that we have to use strings for these, but that's still kind of where we are right now. But this is how it works. And so let me show you, let me play and I'll show you how it works. Okay, so we're to go from here. So my next step with this is to try to build out a step sequencer. I've got a lot of experience in music production and I want to try to do some of the same things here. And so I'll make another video in the future showing how to do that type of thing. So make sure you subscribe if you like this type of content, Unreal Engine type content or cinematography video content as well. And, you know, like this video, feel free and share it to your friends or anyone that you think might like it and leave a comment if you have any questions and I'll try to make sure to answer them or, you know, make another video in the future explaining some more of these things. So thanks for watching.