2021-01-13 17:37:25 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
# pragma once
# include "CoreMinimal.h"
2021-01-16 02:06:14 -04:00
# include "DSP/BufferVectorOperations.h"
# include "MetasoundAudioBuffer.h"
2021-01-13 17:37:25 -04:00
# include "MetasoundBuilderInterface.h"
2021-01-16 02:06:14 -04:00
# include "MetasoundDataReference.h"
2021-01-13 17:37:25 -04:00
# include "MetasoundDataReferenceCollection.h"
# include "MetasoundExecutableOperator.h"
# include "MetasoundFacade.h"
2021-01-16 02:06:14 -04:00
# include "MetasoundFrequency.h"
2021-01-13 17:37:25 -04:00
# include "MetasoundNode.h"
# include "MetasoundNodeRegistrationMacro.h"
# include "MetasoundNodeInterface.h"
# include "MetasoundOperatorInterface.h"
# include "MetasoundPrimitives.h"
2021-01-28 19:02:51 -04:00
# include "MetasoundStandardNodesNames.h"
2021-01-16 02:06:14 -04:00
# include "MetasoundTime.h"
2021-01-27 15:54:01 -04:00
# include "MetasoundTrigger.h"
2021-01-13 17:37:25 -04:00
# define LOCTEXT_NAMESPACE "MetasoundMathOpNode"
2021-01-16 02:06:14 -04:00
2021-01-28 19:02:51 -04:00
# define DEFINE_METASOUND_MATHOP(OpName, DataTypeName, DataClass, DisplayName, Description) \
2021-01-16 02:06:14 -04:00
class F # # OpName # # DataTypeName # # Node \
: public : : Metasound : : TMathOpNode < F # # OpName # # DataTypeName # # Node , : : Metasound : : TMathOp # # OpName < DataClass > , DataClass > \
{ \
public : \
2021-01-28 19:02:51 -04:00
static FNodeClassName GetClassName ( ) { return { : : Metasound : : StandardNodes : : Namespace , TEXT ( # OpName ) , TEXT ( # DataTypeName ) } ; } \
static FText GetDisplayName ( ) { return DisplayName ; } \
2021-01-16 02:06:14 -04:00
static FText GetDescription ( ) { return Description ; } \
2021-01-20 00:42:47 -04:00
static FName GetImageName ( ) { return " MetasoundEditor.Graph.Node.Math. " # OpName ; } \
2021-01-16 02:06:14 -04:00
F # # OpName # # DataTypeName # # Node ( const FNodeInitData & InInitData ) : TMathOpNode ( InInitData ) { } \
} ;
2021-01-13 17:37:25 -04:00
namespace Metasound
{
2021-01-28 19:02:51 -04:00
namespace MathOpDisplayNames
{
template < typename DataType >
const FText GetAddDisplayName ( )
{
static const FText DisplayName = FText : : Format ( LOCTEXT ( " AddNodeDisplayNamePattern " , " Add {0} " ) , FText : : FromString ( GetMetasoundDataTypeString < DataType > ( ) ) ) ;
return DisplayName ;
}
template < typename DataType >
const FText GetSubtractDisplayName ( )
{
static const FText DisplayName = FText : : Format ( LOCTEXT ( " SubtractNodeDisplayNamePattern " , " Subtract {0} " ) , FText : : FromString ( GetMetasoundDataTypeString < DataType > ( ) ) ) ;
return DisplayName ;
}
template < typename DataType >
const FText GetMultiplyDisplayName ( )
{
static const FText DisplayName = FText : : Format ( LOCTEXT ( " MultiplyNodeDisplayNamePattern " , " Multiply {0} " ) , FText : : FromString ( GetMetasoundDataTypeString < DataType > ( ) ) ) ;
return DisplayName ;
}
template < typename DataType >
const FText GetDivideDisplayName ( )
{
static const FText DisplayName = FText : : Format ( LOCTEXT ( " DivideNodeDisplayNamePattern " , " Divide {0} " ) , FText : : FromString ( GetMetasoundDataTypeString < DataType > ( ) ) ) ;
return DisplayName ;
}
template < typename DataType >
const FText GetRandRangeDisplayName ( )
{
static const FText DisplayName = FText : : Format ( LOCTEXT ( " RandRangeNodeDisplayNamePattern " , " RandRange {0} " ) , FText : : FromString ( GetMetasoundDataTypeString < DataType > ( ) ) ) ;
return DisplayName ;
}
}
2021-01-16 02:06:14 -04:00
template < typename TDerivedClass , typename TMathOpClass , typename TDataClass >
2021-01-13 17:37:25 -04:00
class TMathOpNode : public FNodeFacade
{
private :
class TMathOperator : public TExecutableOperator < TMathOperator >
{
private :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
TArray < TDataClassReadRef > OperandRefs ;
TDataClassWriteRef ValueRef ;
public :
static FVertexInterface DeclareVertexInterface ( )
{
static const FVertexInterface Interface (
FInputVertexInterface (
TInputDataVertexModel < TDataClass > ( TEXT ( " Operand1 " ) , LOCTEXT ( " MathOpMinTooltip " , " First value to operate on. " ) ) ,
TInputDataVertexModel < TDataClass > ( TEXT ( " Operand2 " ) , LOCTEXT ( " MathOpMaxTooltip " , " Second value to operate on. " ) )
) ,
FOutputVertexInterface (
TOutputDataVertexModel < TDataClass > ( TEXT ( " Out " ) , LOCTEXT ( " MathOpOutTooltip " , " Math operation result " ) )
)
) ;
return Interface ;
}
2021-01-28 19:02:51 -04:00
static const FNodeClassMetadata & GetNodeInfo ( )
2021-01-13 17:37:25 -04:00
{
2021-01-28 19:02:51 -04:00
auto InitNodeInfo = [ ] ( ) - > FNodeClassMetadata
2021-01-13 17:37:25 -04:00
{
2021-01-23 12:59:01 -04:00
FNodeDisplayStyle DisplayStyle ;
DisplayStyle . ImageName = TDerivedClass : : GetImageName ( ) ;
DisplayStyle . bShowName = false ;
DisplayStyle . bShowInputNames = false ;
DisplayStyle . bShowOutputNames = false ;
2021-01-28 19:02:51 -04:00
FNodeClassMetadata Info ;
2021-01-13 17:37:25 -04:00
Info . ClassName = TDerivedClass : : GetClassName ( ) ;
Info . MajorVersion = 1 ;
Info . MinorVersion = 0 ;
2021-01-28 19:02:51 -04:00
Info . DisplayName = TDerivedClass : : GetDisplayName ( ) ;
2021-01-13 17:37:25 -04:00
Info . Description = TDerivedClass : : GetDescription ( ) ;
Info . Author = PluginAuthor ;
Info . PromptIfMissing = PluginNodeMissingPrompt ;
Info . DefaultInterface = DeclareVertexInterface ( ) ;
2021-01-23 12:59:01 -04:00
Info . DisplayStyle = DisplayStyle ;
2021-01-16 02:06:14 -04:00
Info . CategoryHierarchy = { LOCTEXT ( " Metasound_MathCategory " , " Math " ) } ;
2021-01-13 17:37:25 -04:00
return Info ;
} ;
2021-01-28 19:02:51 -04:00
static const FNodeClassMetadata Info = InitNodeInfo ( ) ;
2021-01-13 17:37:25 -04:00
return Info ;
}
void Execute ( )
{
2021-01-16 02:06:14 -04:00
TMathOpClass : : Calculate ( OperandRefs , ValueRef ) ;
2021-01-13 17:37:25 -04:00
}
static TUniquePtr < IOperator > CreateOperator ( const FCreateOperatorParams & InParams , FBuildErrorArray & OutErrors )
{
const TMathOpNode & MathOpNode = static_cast < const TMathOpNode & > ( InParams . Node ) ;
// TODO: Support dynamic number of inputs
2021-02-03 14:36:36 -04:00
TDataClassReadRef Op1 = InParams . InputDataReferences . GetDataReadReferenceOrConstruct < TDataClass > ( TEXT ( " Operand1 " ) , TMathOpClass : : GetDefault ( & InParams . OperatorSettings ) ) ;
TDataClassReadRef Op2 = InParams . InputDataReferences . GetDataReadReferenceOrConstruct < TDataClass > ( TEXT ( " Operand2 " ) , TMathOpClass : : GetDefault ( & InParams . OperatorSettings ) ) ;
2021-01-13 17:37:25 -04:00
TArray < TDataClassReadRef > OperandRefs = { Op1 , Op2 } ;
return MakeUnique < TMathOperator > ( InParams . OperatorSettings , OperandRefs ) ;
}
TMathOperator ( const FOperatorSettings & InSettings , const TArray < TDataClassReadRef > & InOperands )
: OperandRefs ( InOperands )
2021-02-03 14:36:36 -04:00
, ValueRef ( TDataClassWriteRef : : CreateNew ( TMathOpClass : : GetDefault ( & InSettings ) ) )
2021-01-13 17:37:25 -04:00
{
}
virtual FDataReferenceCollection GetInputs ( ) const override
{
FDataReferenceCollection InputDataReferences ;
InputDataReferences . AddDataReadReference ( TEXT ( " Operand1 " ) , OperandRefs [ 0 ] ) ;
InputDataReferences . AddDataReadReference ( TEXT ( " Operand2 " ) , OperandRefs [ 1 ] ) ;
return InputDataReferences ;
}
virtual FDataReferenceCollection GetOutputs ( ) const override
{
FDataReferenceCollection OutputDataReferences ;
OutputDataReferences . AddDataReadReference ( TEXT ( " Out " ) , TDataClassReadRef ( ValueRef ) ) ;
return OutputDataReferences ;
}
} ;
public :
TMathOpNode ( const FNodeInitData & InInitData )
2021-01-28 19:02:51 -04:00
: FNodeFacade ( InInitData . InstanceName , InInitData . InstanceID , TFacadeOperatorClass < TMathOperator > ( ) )
2021-01-13 17:37:25 -04:00
{
}
} ;
// Standard Math Operations
template < typename TDataClass >
class TMathOpAdd
{
public :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
2021-02-03 14:36:36 -04:00
static TDataClass GetDefault ( const FOperatorSettings * InSettings )
2021-01-13 17:37:25 -04:00
{
return 0 ;
}
static void Calculate ( const TArray < TDataClassReadRef > & InOperands , TDataClassWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
* OutResult + = * InOperands [ i ] ;
}
}
} ;
template < typename TDataClass >
class TMathOpSubtract
{
public :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
2021-02-03 14:36:36 -04:00
static TDataClass GetDefault ( const FOperatorSettings * InSettings )
2021-01-13 17:37:25 -04:00
{
return 0 ;
}
static void Calculate ( const TArray < TDataClassReadRef > & InOperands , TDataClassWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
* OutResult - = * InOperands [ i ] ;
}
}
} ;
template < typename TDataClass >
class TMathOpMultiply
{
public :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
2021-02-03 14:36:36 -04:00
static TDataClass GetDefault ( const FOperatorSettings * InSettings )
2021-01-13 17:37:25 -04:00
{
return 1 ;
}
static void Calculate ( const TArray < TDataClassReadRef > & InOperands , TDataClassWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
* OutResult * = * InOperands [ i ] ;
}
}
} ;
template < typename TDataClass >
class TMathOpDivide
{
public :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
2021-02-03 14:36:36 -04:00
static TDataClass GetDefault ( const FOperatorSettings * InSettings )
2021-01-13 17:37:25 -04:00
{
return 1 ;
}
static void Calculate ( const TArray < TDataClassReadRef > & InOperands , TDataClassWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
const TDataClass & OperandValue = * InOperands [ i ] ;
if ( OperandValue = = 0 )
{
// TODO: Error here
return ;
}
* OutResult / = OperandValue ;
}
}
} ;
2021-01-16 02:06:14 -04:00
// Specialized Math Operations
template < >
class TMathOpAdd < FAudioBuffer >
{
public :
2021-02-03 14:36:36 -04:00
static FAudioBuffer GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
2021-02-03 14:36:36 -04:00
return FAudioBuffer ( InSettings ? InSettings - > GetNumFramesPerBlock ( ) : 0 ) ;
2021-01-16 02:06:14 -04:00
}
static void Calculate ( const TArray < FAudioBufferReadRef > & InOperands , FAudioBufferWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
OutResult - > Zero ( ) ;
return ;
}
const int32 NumSamples = InOperands [ 0 ] - > Num ( ) ;
if ( ! ensure ( NumSamples = = OutResult - > Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
FMemory : : Memcpy ( OutResult - > GetData ( ) , InOperands [ 0 ] - > GetData ( ) , sizeof ( float ) * NumSamples ) ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
const FAudioBuffer & Operand = * InOperands [ i ] ;
if ( ! ensure ( NumSamples = = Operand . Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
const float * OperandData = InOperands [ i ] - > GetData ( ) ;
float * OutData = OutResult - > GetData ( ) ;
if ( NumSamples % AUDIO_SIMD_FLOAT_ALIGNMENT )
{
for ( int32 SampleIndex = 0 ; SampleIndex < NumSamples ; + + SampleIndex )
{
OutData [ SampleIndex ] + = OperandData [ SampleIndex ] ;
}
}
else
{
const float StartGain = 1.0f ;
const float EndGain = 1.0f ;
Audio : : MixInBufferFast ( OperandData , OutData , NumSamples , StartGain , EndGain ) ;
}
}
}
} ;
template < >
class TMathOpSubtract < FAudioBuffer >
{
public :
2021-02-03 14:36:36 -04:00
static FAudioBuffer GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
2021-02-03 14:36:36 -04:00
return FAudioBuffer ( InSettings ? InSettings - > GetNumFramesPerBlock ( ) : 0 ) ;
2021-01-16 02:06:14 -04:00
}
static void Calculate ( TArray < FAudioBufferReadRef > & InOperands , FAudioBufferWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
OutResult - > Zero ( ) ;
return ;
}
const int32 NumSamples = InOperands [ 0 ] - > Num ( ) ;
if ( ! ensure ( NumSamples = = OutResult - > Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
FMemory : : Memcpy ( OutResult - > GetData ( ) , InOperands [ 0 ] - > GetData ( ) , sizeof ( float ) * NumSamples ) ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
const FAudioBuffer & Operand = * InOperands [ i ] ;
if ( ! ensure ( NumSamples = = Operand . Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
const float * OperandData = InOperands [ i ] - > GetData ( ) ;
float * OutData = OutResult - > GetData ( ) ;
if ( NumSamples % AUDIO_SIMD_FLOAT_ALIGNMENT )
{
for ( int32 SampleIndex = 0 ; SampleIndex < NumSamples ; + + SampleIndex )
{
OutData [ i ] - = OperandData [ i ] ;
}
}
else
{
Audio : : BufferSubtractInPlace2Fast ( OutData , OperandData , NumSamples ) ;
}
}
}
} ;
template < >
class TMathOpMultiply < FAudioBuffer >
{
public :
2021-02-03 14:36:36 -04:00
static FAudioBuffer GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
2021-02-03 14:36:36 -04:00
return FAudioBuffer ( InSettings ? InSettings - > GetNumFramesPerBlock ( ) : 0 ) ;
2021-01-16 02:06:14 -04:00
}
static void Calculate ( const TArray < FAudioBufferReadRef > & InOperands , FAudioBufferWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
OutResult - > Zero ( ) ;
return ;
}
const int32 NumSamples = InOperands [ 0 ] - > Num ( ) ;
if ( ! ensure ( NumSamples = = OutResult - > Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
FMemory : : Memcpy ( OutResult - > GetData ( ) , InOperands [ 0 ] - > GetData ( ) , sizeof ( float ) * NumSamples ) ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
const FAudioBuffer & Operand = * InOperands [ i ] ;
if ( ! ensure ( NumSamples = = Operand . Num ( ) ) )
{
// TODO: Error
OutResult - > Zero ( ) ;
return ;
}
const float * OperandData = InOperands [ i ] - > GetData ( ) ;
float * OutData = OutResult - > GetData ( ) ;
if ( NumSamples % AUDIO_SIMD_FLOAT_ALIGNMENT )
{
for ( int32 SampleIndex = 0 ; SampleIndex < NumSamples ; + + SampleIndex )
{
OutData [ SampleIndex ] + = OperandData [ SampleIndex ] ;
}
}
else
{
Audio : : MultiplyBuffersInPlace ( OperandData , OutData , NumSamples ) ;
}
}
}
} ;
template < >
class TMathOpMultiply < FFloatTime >
{
public :
2021-02-03 14:36:36 -04:00
static FFloatTime GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
return FFloatTime ( 1.0f ) ;
}
static void Calculate ( const TArray < FFloatTimeReadRef > & InOperands , FFloatTimeWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
OutResult - > SetSeconds ( OutResult - > GetSeconds ( ) * InOperands [ i ] - > GetSeconds ( ) ) ;
}
}
} ;
template < >
class TMathOpDivide < FFloatTime >
{
public :
2021-02-03 14:36:36 -04:00
static FFloatTime GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
return FFloatTime ( 1.0f ) ;
}
static void Calculate ( const TArray < FFloatTimeReadRef > & InOperands , FFloatTimeWriteRef & OutResult )
{
if ( ! ensure ( ! InOperands . IsEmpty ( ) ) )
{
return ;
}
* OutResult = * InOperands [ 0 ] ;
for ( int32 i = 1 ; i < InOperands . Num ( ) ; + + i )
{
const FFloatTime & OperandValue = * InOperands [ i ] ;
if ( OperandValue . GetSeconds ( ) = = 0.0f )
{
// TODO: Error here
return ;
}
OutResult - > SetSeconds ( OutResult - > GetSeconds ( ) / OperandValue . GetSeconds ( ) ) ;
}
}
} ;
2021-01-13 17:37:25 -04:00
template < typename TDataClass >
class TMathOpRandRange
{
public :
using TDataClassReadRef = TDataReadReference < TDataClass > ;
using TDataClassWriteRef = TDataWriteReference < TDataClass > ;
2021-02-03 14:36:36 -04:00
static TDataClass GetDefault ( const FOperatorSettings * InSettings )
2021-01-13 17:37:25 -04:00
{
return 0 ;
}
static void Calculate ( const TArray < TDataClassReadRef > & InOperands , TDataClassWriteRef & OutResult )
{
if ( InOperands . Num ( ) > 1 )
{
const TDataClass & Min = * InOperands [ 0 ] ;
const TDataClass & Max = * InOperands [ 1 ] ;
* OutResult = FMath : : RandRange ( Min , Max ) ;
}
else
{
// TODO: Error
}
}
} ;
2021-01-16 02:06:14 -04:00
template < >
class TMathOpRandRange < FFloatTime >
{
public :
2021-02-03 14:36:36 -04:00
static FFloatTime GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
return FFloatTime ( 0.0f ) ;
}
static void Calculate ( const TArray < FFloatTimeReadRef > & InOperands , FFloatTimeWriteRef & OutResult )
{
if ( InOperands . Num ( ) > 1 )
{
const FFloatTime & Min = * InOperands [ 0 ] ;
const FFloatTime & Max = * InOperands [ 1 ] ;
const float FloatResult = FMath : : RandRange ( Min . GetSeconds ( ) , Max . GetSeconds ( ) ) ;
OutResult - > SetSeconds ( FloatResult ) ;
}
else
{
// TODO: Error
}
}
} ;
template < >
class TMathOpRandRange < FFrequency >
{
public :
2021-02-03 14:36:36 -04:00
static FFrequency GetDefault ( const FOperatorSettings * InSettings )
2021-01-16 02:06:14 -04:00
{
return FFrequency ( 0.0f ) ;
}
static void Calculate ( const TArray < FFrequencyReadRef > & InOperands , FFrequencyWriteRef & OutResult )
{
if ( InOperands . Num ( ) > 1 )
{
const FFrequency & Min = * InOperands [ 0 ] ;
const FFrequency & Max = * InOperands [ 1 ] ;
const float FloatResult = FMath : : RandRange ( Min . GetHertz ( ) , Max . GetHertz ( ) ) ;
OutResult - > SetHertz ( FloatResult ) ;
}
else
{
// TODO: Error
}
}
} ;
2021-01-28 19:02:51 -04:00
// Definitions
DEFINE_METASOUND_MATHOP ( Add , Float , float , MathOpDisplayNames : : GetAddDisplayName < float > ( ) , LOCTEXT ( " Metasound_MathAddFloatNodeDescription " , " Adds floats. " ) )
DEFINE_METASOUND_MATHOP ( Add , Int32 , int32 , MathOpDisplayNames : : GetAddDisplayName < int32 > ( ) , LOCTEXT ( " Metasound_MathAddInt32NodeDescription " , " Adds int32s. " ) )
DEFINE_METASOUND_MATHOP ( Add , Int64 , int64 , MathOpDisplayNames : : GetAddDisplayName < int64 > ( ) , LOCTEXT ( " Metasound_MathAddInt64NodeDescription " , " Adds int64s. " ) )
DEFINE_METASOUND_MATHOP ( Add , Frequency , FFrequency , MathOpDisplayNames : : GetAddDisplayName < FFrequency > ( ) , LOCTEXT ( " Metasound_MathAddFrequencyNodeDescription " , " Adds frequency values. " ) )
DEFINE_METASOUND_MATHOP ( Add , FloatTime , FFloatTime , MathOpDisplayNames : : GetAddDisplayName < FFloatTime > ( ) , LOCTEXT ( " Metasound_MathAddFloatTimeNodeDescription " , " Adds time values. " ) )
DEFINE_METASOUND_MATHOP ( Add , AudioBuffer , FAudioBuffer , MathOpDisplayNames : : GetAddDisplayName < FAudioBuffer > ( ) , LOCTEXT ( " Metasound_MathAddBufferNodeDescription " , " Adds buffers together by sample. " ) )
2021-01-16 02:06:14 -04:00
2021-01-28 19:02:51 -04:00
DEFINE_METASOUND_MATHOP ( Subtract , Float , float , MathOpDisplayNames : : GetSubtractDisplayName < float > ( ) , LOCTEXT ( " Metasound_MathSubractFloatNodeDescription " , " Subtracts floats. " ) )
DEFINE_METASOUND_MATHOP ( Subtract , Int32 , int32 , MathOpDisplayNames : : GetSubtractDisplayName < int32 > ( ) , LOCTEXT ( " Metasound_MathSubractInt32NodeDescription " , " Subtracts int32s. " ) )
DEFINE_METASOUND_MATHOP ( Subtract , Int64 , int64 , MathOpDisplayNames : : GetSubtractDisplayName < int64 > ( ) , LOCTEXT ( " Metasound_MathSubractInt64NodeDescription " , " Subtracts int64s. " ) )
DEFINE_METASOUND_MATHOP ( Subtract , Frequency , FFrequency , MathOpDisplayNames : : GetSubtractDisplayName < FFrequency > ( ) , LOCTEXT ( " Metasound_MathSubractFrequencyNodeDescription " , " Subtracts frequency values. " ) )
DEFINE_METASOUND_MATHOP ( Subtract , FloatTime , FFloatTime , MathOpDisplayNames : : GetSubtractDisplayName < FFloatTime > ( ) , LOCTEXT ( " Metasound_MathSubractFloatTimeNodeDescription " , " Subtracts time values. " ) )
DEFINE_METASOUND_MATHOP ( Subtract , AudioBuffer , FAudioBuffer , MathOpDisplayNames : : GetSubtractDisplayName < FAudioBuffer > ( ) , LOCTEXT ( " Metasound_MathSubtractBufferNodeDescription " , " Subtracts buffers by sample. " ) )
2021-01-16 02:06:14 -04:00
2021-01-28 19:02:51 -04:00
DEFINE_METASOUND_MATHOP ( Multiply , Float , float , MathOpDisplayNames : : GetMultiplyDisplayName < float > ( ) , LOCTEXT ( " Metasound_MathMultiplyFloatNodeDescription " , " Multiplies floats. " ) )
DEFINE_METASOUND_MATHOP ( Multiply , Int32 , int32 , MathOpDisplayNames : : GetMultiplyDisplayName < int32 > ( ) , LOCTEXT ( " Metasound_MathMultiplyInt32NodeDescription " , " Multiplies int32s. " ) )
DEFINE_METASOUND_MATHOP ( Multiply , Int64 , int64 , MathOpDisplayNames : : GetMultiplyDisplayName < int64 > ( ) , LOCTEXT ( " Metasound_MathMultiplyInt64NodeDescription " , " Multiplies int64s. " ) )
DEFINE_METASOUND_MATHOP ( Multiply , Frequency , FFrequency , MathOpDisplayNames : : GetMultiplyDisplayName < FFrequency > ( ) , LOCTEXT ( " Metasound_MathMultiplyFrequencyNodeDescription " , " Multiplies frequency values. " ) )
DEFINE_METASOUND_MATHOP ( Multiply , FloatTime , FFloatTime , MathOpDisplayNames : : GetMultiplyDisplayName < FFloatTime > ( ) , LOCTEXT ( " Metasound_MathMultiplyFloatTimeNodeDescription " , " Multiplies time values. " ) )
DEFINE_METASOUND_MATHOP ( Multiply , AudioBuffer , FAudioBuffer , MathOpDisplayNames : : GetMultiplyDisplayName < FAudioBuffer > ( ) , LOCTEXT ( " Metasound_MathMultiplyBufferNodeDescription " , " Multiplies buffers together by sample. " ) )
2021-01-16 02:06:14 -04:00
2021-01-28 19:02:51 -04:00
DEFINE_METASOUND_MATHOP ( Divide , Float , float , MathOpDisplayNames : : GetDivideDisplayName < float > ( ) , LOCTEXT ( " Metasound_MathDivideFloatNodeDescription " , " Divide float by another float. " ) )
DEFINE_METASOUND_MATHOP ( Divide , Int32 , int32 , MathOpDisplayNames : : GetDivideDisplayName < int32 > ( ) , LOCTEXT ( " Metasound_MathDivideInt32NodeDescription " , " Divide int32 by another int32. " ) )
DEFINE_METASOUND_MATHOP ( Divide , Int64 , int64 , MathOpDisplayNames : : GetDivideDisplayName < int64 > ( ) , LOCTEXT ( " Metasound_MathDivideInt64NodeDescription " , " Divide int64 by another int64. " ) )
DEFINE_METASOUND_MATHOP ( Divide , Frequency , FFrequency , MathOpDisplayNames : : GetDivideDisplayName < FFrequency > ( ) , LOCTEXT ( " Metasound_MathDivideFrequencyNodeDescription " , " Divide frequency by another frequency. " ) )
DEFINE_METASOUND_MATHOP ( Divide , FloatTime , FFloatTime , MathOpDisplayNames : : GetDivideDisplayName < FFloatTime > ( ) , LOCTEXT ( " Metasound_MathDivideFloatTimeNodeDescription " , " Divide time by another time. " ) )
2021-01-16 02:06:14 -04:00
2021-01-28 19:02:51 -04:00
DEFINE_METASOUND_MATHOP ( RandRange , Float , float , MathOpDisplayNames : : GetRandRangeDisplayName < float > ( ) , LOCTEXT ( " Metasound_MathRandRangeFloatNodeDescription " , " Computes random float value in the range [Min, Max]. " ) )
DEFINE_METASOUND_MATHOP ( RandRange , Int32 , int32 , MathOpDisplayNames : : GetRandRangeDisplayName < int32 > ( ) , LOCTEXT ( " Metasound_MathRandRangeInt32NodeDescription " , " Computes random int32 in the range [Min, Max]. " ) )
DEFINE_METASOUND_MATHOP ( RandRange , Int64 , int64 , MathOpDisplayNames : : GetRandRangeDisplayName < int64 > ( ) , LOCTEXT ( " Metasound_MathRandRangeInt64NodeDescription " , " Computes random int64 in the range [Min, Max]. " ) )
DEFINE_METASOUND_MATHOP ( RandRange , Frequency , FFrequency , MathOpDisplayNames : : GetRandRangeDisplayName < FFrequency > ( ) , LOCTEXT ( " Metasound_MathRandRangeFrequencyNodeDescription " , " Computes random frequency value in the range [Min, Max]. " ) )
DEFINE_METASOUND_MATHOP ( RandRange , FloatTime , FFloatTime , MathOpDisplayNames : : GetRandRangeDisplayName < FFloatTime > ( ) , LOCTEXT ( " Metasound_MathRandRangeFloatTimeNodeDescription " , " Computes random time value in the range [Min, Max]. " ) )
2021-01-13 17:37:25 -04:00
}
# undef LOCTEXT_NAMESPACE // MetasoundMathOpNode