Hi! Creating a separate topic from the one I just posted as this is a different question- I’ve got a labeled parameter that’s changing the volumes of different layers of music. I’d like to be able to change the label every X to Y seconds so things won’t be repetitive. Is there a way to do this (the label change every X to Y seconds) directly in Fmod Studio, or will it need to be done in Unity? Thanks for your help, as always!
The easiest way would be:
- Create a scatterer instrument in the same event as the music.
- Position this instrument such that is it always triggered and never untriggered. (The easiest way to do this is to put it on a parameter sheet and stretch it out to the full length of the parameter.)
- Set the scatterer instrument’s Min & Max Spawn interval to X and Y.
- Add a command instrument to the scatterer instrument’s playlist.
- Select the command instrument, and set its command type to “Set Parameter,” its target to your labelled parameter, and its value to whatever value you want to set the parameter to. (If you want to set the parameter to a random value, set the command instrument’s value to the parameter’s middle label, then attach to the value property a random modulator set to 100%.)
The scatterer instrument will select an entry in its playlist every X to Y seconds. Since the only entry in its playlist is the command instrument that sets the parameter’s label, the parameter’s label will be set every X to Y seconds.
I should mention that each time the command instrument is selected, there is a chance that it sets the parameter’s label to its current label instead of to a new label, resulting in no apparent change. If this is unacceptable, you will have to use another method.
I just posted this and it seems a little related to this topic:
After testing my original solution to my question (lol) I was wondering about how to time the command instruments being called. The answer here is exactly what I was looking for in terms of using a scatterer with one command instrument in its playlist. To add to that, Joseph was saying:
I should mention that each time the command instrument is selected, there is a chance that it sets the parameter’s label to its current label instead of to a new label, resulting in no apparent change. If this is unacceptable, you will have to use another method.
One way to prevent one value from being selected twice is to use two command instruments, one set to pick a random value from one half of the total possible values, and one that selects a value from the other half. Then you play these two instruments in sequence repeatedly. It won’t get as fully random results, but it will prevent the same value from being selected twice in a row. Doesn’t have to be half and half either, any two subsets of the total will work.
I’ve never done this on command instruments, but it’s great for when you have few enough variations of an asset that you’re getting the same one twice too often, or if some of them are just too similar and you want to make sure they don’t play back to back. Like if your assets themselves have some pitch variation to them, you can put the higher half in one multi and the lower half in another to guarantee that they alternate between high and low. (Footstep samples are usually pretty consistent within each foot, but that’s a potential use case.)
Thanks so much for the response! I’m going to do some testing, but it’s possible that I’ll not want the label to be set to the current label instead of a new one. TCP’s fix for this seems great (thank you too!) but I was wondering if you might have another idea? Thanks again!
Another method would be to have multiple command instruments (one for each possible value of the parameter) in a multi instrument’s playlist instead of using a randomization modulator. This method would allow you the parameter’s value to jump to any other while taking advantage of how “shuffle” playlist selection mode already avoids selecting the same playlist entry twice in a row.
That being said, TCP’s method would take considerably less time and effort to set up. If you don’t particularly care about being able to jump from any parameter value to any other parameter value, it’s a better option.