Tutorial: Writing a Pitch Shift MetaSound Node

In this tutorial, I will write a new MetaSound node that performs a Doppler-Delay-based pitch shift on a real-time audio buffer.

https://dev.epicgames.com/community/learning/tutorials/KJWk/writing-a-pitch-shift-metasound-node

4 Likes

Thank you for this, very helpful! Iā€™m trying to build the stub code included in that tutorial and Iā€™ve come across two issues:

  1. In FVertexInterface it seems that TInputVertex has to be changed to TInputVertexModel, otherwise it throws a undefined error (Iā€™m guessing this is an API change)
  2. Iā€™m unable to compile this same stub as part of an empty custom plugin. I get these linker errors:

unresolved external symbol ā€œclass FName const Metasound::StandardNodes::Namespaceā€ (?Namespace@StandardNodes@Metasound@@3VFName@@anonymous_user_31e84eb0)

unresolved external symbol ā€œclass FName const Metasound::StandardNodes::AudioVariantā€ (?AudioVariant@StandardNodes@Metasound@@3VFName@@anonymous_user_31e84eb0)

These errors are shown as coming from line 1 of Intermediate\ProjectFiles\Module.MetaSoundsAmbi.cpp.obj.

MertaSoundsAmbi.cpp is the empty class that was created when I created an empty plugin with the same name, using the Plugins panel in the UE5 editor. I manually included the MetaSounds modules in the pluginā€™s dependencies in the .Build.cs file.

It seems that I fixed the unresolved symbol errors by adding the following to my plugin module cpp file:

namespace Metasound
{
	namespace StandardNodes
	{
		const FName Namespace = "UE";
		const FName AudioVariant = "Audio";
	}
...
1 Like

After fixing those issues, I am still getting some unresolved externals, what is the solution?

Thanks! This fixed it for me.

1 Like

Hello. Thanks for this tutorial.

I am new to the unreal engine and creating plugins, so your feedback is greatly appreciated. Building plugins with Visual Studio 2019, I am having trouble linking to many of the dependencies (i.e. cannot open source file ā€œMetasoundExecutableOperator.hā€).

To create my plugin I did the following:

  1. In a c++ project, I added a blank plugin.
  2. In the generated plugin files, I updated the .uplugin file as follows:
{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "metanode",
	"Description": "test node",
	"Category": "Other",
	"CreatedBy": "Brian",
	"CreatedByURL": "",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"CanContainContent": true,
	"IsBetaVersion": false,
	"IsExperimentalVersion": false,
	"Installed": false,
	"Modules": [
		{
			"Name": "metanode",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	],
	"Plugins": [
		{
			"Name": "Metasound",
			"Enabled": true
		}
	]
}
  1. I have also entered metasound modules in the Build.cs file:
PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"MetasoundGraphCore",
				"MetasoundEngine",
				"MetasoundFrontend",
				// ... add other public dependencies that you statically link with here ...
			}
			);
			
		
		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",
				"MetasoundGraphCore",
				"MetasoundEngine",
				"MetasoundFrontend",

				// ... add private dependencies that you statically link with here ...	
			}
			);
  1. I copied the code presented in the tutorial into the .cpp file of my plugin. I also commented out the boiler plate class and implmentation code that appears when generating a blank plugin (i.e. class derived form IModuleInterface with virtual void methods StartupModule() and ShutdownModule() ā€“ I am assuming this stuff is not needed for a metasound node implementation).

From my understanding, the required header files should be found based on my entries in the .uplugin and Build.cs file. But clearly I am missing somethingā€¦

Did you manage to find the solution to this?

Answer for me was not using ā€˜namespace Metasoundā€™ incase that helps anyone else in the future.