I have a MetaSound with a Time parameter (variable) set up like this.
I would like to be able to adjust the Period parameter from a Blueprint so I can speed up and slow down the Period of the Trigger Repeat node while the audio is playing. Is that possible and if so how?
The only thing I could find in Blueprint was a Set Float Parameter node, but that doesn’t appear to work.
So I tried creating a Float variable and then piping that through to the Period variable like this.
However that just causes the audio to stop playing completely and even causes other audio sources that have nothing to do with this one to stop playing as well. Seems like it just breaks MetaSound completely. So I don’t think I’m supposed to do that.
Is it not possible to change an audio source at all while it is playing?
This may not answer your question about adjusting parameters while playing, but one solution to change your Period during playback is to use an envelope generator.
In this example the AD generator will sweep from 0.175 to 0.1 over 5 seconds.
Since the AD envelope generator will output its value at audio rate, it will be a nice smooth change. It’s controlled by a trigger, which can be called from your blueprint.
The “Set float par” is the right object but you should use an input in the MS graph rather than a variable (that’s for the graph only) and it needs to have the exact same name i.e., “Period”.
You don’t say what the values are that you’re casting from the BP but you prob need to map them as the time values are inverted e.g., 0.2 is faster than 0.7. Prob easier to use the BPM function to set the period and then just map the BP values to that either in the BP or the Metasound.
Super neat solution as values from game play is often to fast to use for smooth transitions. I’d just map it rather than apply the math but whatever works.