Skip to content

Instantly share code, notes, and snippets.

@mattetti
Last active June 3, 2021 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattetti/e89739a006591289e72c5252da1de877 to your computer and use it in GitHub Desktop.
Save mattetti/e89739a006591289e72c5252da1de877 to your computer and use it in GitHub Desktop.
UE5 metasounds stuff

You can check out the Early Access version that has shipped but also follow along with development in UE5/Main on github. https://github.com/EpicGames/UnrealEngine/tree/ue5-main

MetaSounds are currently entirely written in a plugin and they can be extended by other plugins. Here's the MetaSound plugin source -- https://github.com/EpicGames/UnrealEngine/tree/ue5-main/Engine/Plugins/Runtime/Metasound

Probably the easiest way to experiment and get started is to just check out any of the existing MetaSound nodes and use them as a crib for how to make a new node. It's as easy as dropping in a new (single) cpp file in the project and compiling it. Check out specifically this folder: https://github.com/EpicGames/UnrealEngine/tree/ue5-main/Engine/Plugins/Runtime/Metasound/Source/MetasoundStandardNodes/Private

Here's, for example, the source for the stereo delay node: https://github.com/EpicGames/UnrealEngine/blob/ue5-main/Engine/Plugins/Runtime/Metasound/Source/MetasoundStandardNodes/Private/MetasoundStereoDelayNode.cpp

Note the boilerplate that is needed to define inputs/outputs, tooltips, vertex (pin) registration, types, defaults, etc. There is some boilerplate! One interesting technical detail of MetaSounds is that they feature "sample accurate" triggering for events through a special trigger pin type. Here's a node that shows that working:

https://github.com/EpicGames/UnrealEngine/blob/ue5-main/Engine/Plugins/Runtime/Metasound/Source/MetasoundStandardNodes/Private/MetasoundTriggerCounterNode.cpp Note the bifurcation of the render block using lambda's on the trigger reference

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattetti
Copy link
Author

mattetti commented Jun 3, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment