Variables in Metasounds

Hey Cyber_punk, welcome to the forums!

Often the first mistake most people that are new to MetaSounds will make is assuming that MetaSound graphs will behave similarly to Blueprints or other visual scripting languages.

MetaSounds is a graph for processing buffers, (batches of audio samples that are sent to the audio renderer). Under the hood, this is done using a “directed acyclic graph” (DAG), which means the entire graph is evaluated simultaneously for each audio buffer. MetaSound graphs do not execute commands like Blueprints. (Triggers in MetaSounds are not the same as execution.) A good analogy here is the Material graph, which similarly does not have command execution—it’s a rendering graph. This means that variables like floats, ints, strings, and time are only updated once per buffer.

Why have these limits? Because the DAG enables sample-accurate precision for audio source generation and manipulation, arguably(?) the coolest aspect of MetaSounds.

I highly recommend you check out the video below by Epic’s Dan Reynolds—he dives deeper into the technical aspects of MetaSounds and covers much more than I can summarize in a forum post. Hopefully this gives you a bit more insight and points you in the right direction toward shifting your logic to “thinking in terms of buffers.”