Hi. I would like to build a “thing” in metasounds, that spawns a sound at a given random interval.
I would like to be able to set a minimum delay and maximum delay, and within that delay range, the sound would be randomly spawned.
So lets say that I have a min value of 1 and a max value of 10.
That means that I want to spawn a sound, where the delay between the sounds, should be minimum 1 and maximum 10 seconds. Once a “play” has been triggered, the delay time should reset and a new random delay (between 1 and 10) should be set. Once that random delay time has been met, the sound should play, and a new random delay time should be set (within 1-10 seconds)
This is what I have done so far. But doens’t work as intended
Right now, my min/max is set to 5 and 10. In a perfect scanario world, I would like there to be a min/max random delay of 5 to 10 seconds between each sound is played.
I think this would work if the “trigger pipe” was reset each time it had been triggered, but I cannot do that since im not allowed to do logic loops in Metasounds.
I am essentially trying to re-make this device from fmod.
Hmm, guessing this can’t be done within a metasound then. Bummer. I hate to have to go back and forth between blueprints and metasounds just to control stuff like this.
If anyone is reading this and has a solution, please let me know.
It is indeed possible and it looks like you’re fairly close in your screenshot. Check out the Valley of the Ancients sample project and look at the MetaSound named sfx_banner_flaps_meta. It has three layers of flapping sounds that play repeatedly with different random intervals between repeats. Here’s a screenshot of one of the three layers:
Another thing that might be of interest to you is Dan Reynolds’ Soundscape plugin, which you can try out an early version of for yourself in many of the recent sample projects (Valley of the Ancients, Matrix Awakens City, and I think the Medieval Game Environment). You can even copy the plugin to your own project and use it there. He has a couple of videos on his YouTube channel that go through it—here is the first one.
It’s designed for creating ambient soundscapes and has loads of customizable parameters—one of those being the spawn interval min and max. I believe they’re planning it to be added as an engine plugin in the relatively near future.
Thanks. That seems to be it. Amazingness I owe you a beer!
By the way:
Hi.
If i have a “On play” that connects to a trigger repeat that is then connected to a wave player and press “play”, i get a constantly re-triggering sound with a polyphony/concurrency of 1. How do I control polyphony/concurrency to something different? Currently it is 1 no matter what I do.
Thanks again!
Are you saying you want the sound to finish playing after the next sound begins? (i.e. prevent the re-trigger of the wave player from chopping off the tail?)
For that, you would need to set up a second wave player, since a wave player can only have one sound at a time. I’ve done this with music where I have two wave players and alternate between which one plays the next sound and it works well. It could get a little messy if you need a lot more of them, but it should still work.
No, this is just a side question. Has nothing to do with the min/max delay thing:)
Just in general, how do I control polyphony on metasounds. How do I get a single wave player module to not restart play, when getting a “play” pulse. I mean, to play multiple sounds on top of each other if that makes sense.
Or maybe you need a new wave player for each sound? Seems kind of odd that if that is the case.
All I want to do is to use the trigger repeat and have it trigger a wave file. Lets say that it is retriggering every 0.5 seconds. at 0 seconds it plays a sound. then at 0.5 it stops the sound and plays the sound again. then at 1 it stops the sound and plays it again.
This is the default behaviour. How do I change that?
So it wont stop the sound everytime it plays a new one, and I can hear tails blend into each other etc.
I want to control min/max polyphony of any given sound.
Ah yes, I understand more clearly now but my answer remains the same.
From what I understand, wave players can only have one “instance” of a sound inside of it, so in order to have multiple sounds layering on top of one another, you would need multiple wave players.
Though now I’m curious as well and would like to know if there’s a better way of doing it. If there is, then I’m sure it could be found in the Lyra sample project. I’ll have a look through there tomorrow.