Randomizing Audio with MetaSounds [UE5]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome back to five minute meta sounds the show where we I don't know talk about meta sounds in unreal today we're going to be talking about all the ways that we can randomize and variationate our sounds so jumping straight into it we're in the meta sound graph thingo we don't know how to get here you'll need to go sounds meta Sound Source you've got a new meta sound well done so there are kind of three main Dimensions that we can randomize our sound in those being pitch pitch up and down time across this way and the actual sample itself so the the breadth so the first one is pitch now what we're gonna do is we're going to start as we do with most um meta sounds with a wave player so we have a wave player on play play sound let's go like I don't know chain mail one unfinished finish it mono to Mono so now if we hit play we are playing that same sound over and over again so let's variation ate this sound the first thing we're going to do is the pitch so on play we're going to grab a random float value between negative five and positive five this is a pretty big number uh this is in semitones we're going to plug this into the pitch shift and this is going to select a new number every time this is executed so now if we have a look [Music] there you go pretty simple so that's our kind of up and down variation the next one we're going to look at is selecting a random sample from a list there's a few ways we could do this uh one of them is by making an array variable so this could be called our sounds the type is going to be wave asset and we're gonna click the is array button so now if we were to drag this in this is an input of an array so when we actually play this sound we would need to set this object explicitly otherwise instead of using an input we could make a variable called wave array of type wave asset is array and this can be used as like a kind of like a static or like a preset so let's just use this for the time being now you might be able to see yeah you can see over my head we have this default values section what we can do which is very handy uh what we can do is we can select multiple files and we can just drag them straight into there and that will add them all into the array so you can see here we've got nine of them now what we will do is random get which is just going to select a random one of these values and output it here then we're going to put this into the wave asset slot and we can just put these one after the other so this is just going to be saying on play select a random number for the pitch variation then out of here into the random get get a random sample from this array that we've set up do we want any repeats no one is no zero is we do want to allow repeats this this basically just it's like Shuffle so we have nine samples in this array and it won't repeat any of them until all of them have been repeated so imagine we've got nine cards and we shuffle them and then we deal them out one by one and then when we're done we combine them all again shuffle them and then deal them out you know in a different order but we never get two of the same card until they're all dealt so that's basically what this no repeats thing is saying so anyway following the execution chain on next wave player this wave asset is the chosen asset with the chosen pitch unfinished we finish so now we hit play [Music] we're getting random sample and we are getting random pitch so the next thing we can do is randomize the kind of timing of how this is being played this might seem a little bit roundabout but it's so we prevent looping code we are going to do a trigger repeat with a period of the maximum kind of time frame that we want you know these sounds to kind of be randomized in so let's go like five seconds then whenever one of these repeats is triggered so every five seconds we are gonna get a random time between zero and let's just say 4.5 because our sample goes for half a second or something and we don't want to kind of play samples over the top of one another and then on next we're going to delay by this value that we've Chosen and then this will be going into where random pitch our random sample play it randomly We're not gonna finish it on finish because that would kill the sound too early this will give a warning but you can just delete it if you don't want to or sorry remove the interface if you wanted to like destroy it manually so if we hit play this will kind of just do its own thing and just play The Sounds in a pretty random fashion you know what I'm going to speed it up a little just because it's very slow so let's just do like a 2.5 second with a zero to two second delay so let's hit play [Music] foreign [Music] there we go so you can see you can actually see the execution pins happening visually so you can see this trigger repeat is every 2.5 seconds spitting out an input into the random time which then spits it straight into the trigger delay but then you can see that this delay is delaying it by a random amount so I hope that kind of makes sense now this isn't a true kind of looping randomizer so this is kind of just saying we have like a timeline this is time and we've segmented into you know two second intervals and each of these intervals will contain One play of the sound but the actual position within it will be completely random so we might get some that are close together we might get some that are far apart like this essentially it's just kind of randomizing the timing of the sound this might be useful for things like ambient sounds maybe it's like birds chirping maybe you've got like you know you've set up some kind of piano stuff like in breath of the wild where it will just play a random little piano fiddly diddly at you know random intervals and the benefit of doing this all inside the meta sound is that this doesn't run on the game thread this runs on its own thread completely separate from all of the the gameplay timers and delays and ticks and blah blah blah blah so that was just a short little example of how we can kind of get some random variation through meta sounds I hope you learned a little bit more about the interface but we will be exploring more and more complex things as this series goes on so I hope you are looking forward to it and as always if you want to support this channel monetarily you can do something as well as one dollar per month through patreon which is linked in the description and if you have any questions about tutorials or just Game Dev in general you can join our Discord server which is also in the description a big shout out to the twitch twitch people that are actually watching me record forward these videos if you do want to join us it's twitch.tv prismaticadev and with that being said We Say Goodbye [Music] goodbye [Music] thank you [Music]
Info
Channel: PrismaticaDev
Views: 8,849
Rating: undefined out of 5
Keywords: unreal engine metasounds, unreal engine 5.1 metasounds, metasounds ue5, metasounds tutorial, metasounds unreal engine 5, unreal engine audio visualizer, unreal engine audio settings, unreal engine audio reactive, ue5 audio tutorial, unreal engine sound design, unreal engine sound attenuation, unreal engine soundscape, metasounds variance, metasounds, metasounds games, unreal engine audio tutorial, unreal engine 5 audio tutorial, unreal engine 4 audio tutorial
Id: RLWeioN3LJc
Channel Id: undefined
Length: 9min 7sec (547 seconds)
Published: Thu Jan 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.