matthewscharles / metasound-plugins

Some custom nodes for UE5 Metasounds
5 stars 0 forks source link

Fix build issue on refactored SaHBank (in branch) #12

Closed matthewscharles closed 1 month ago

matthewscharles commented 1 month ago

MetasoundSahBankNode.cpp(174): error C2065: 'InputThresholdName': undeclared identifier On first refactor attempt

matthewscharles commented 1 month ago

InputThreshold seems to have fallen out of the private variables

matthewscharles commented 1 month ago

Notes from troubleshooting session (a little rushed!)

// Inputs
        TArray<FAudioBufferReadRef> InputSignals;
        TArray<FAudioBufferReadRef> InputTriggers;
        FFloatReadRef InputThreshold;

I had misnamed the operator, should be:

return MakeUnique<FSahBankOperator>(InputSignals, InputTriggers, InputThreshold);

Check this line:

Metadata.ClassName = { StandardNodes::Namespace, TEXT("SaHBank"), StandardNodes::AudioVariant };

(should be fine?)

Missed a capital letter when describing the namespace:

namespace SaHBankNodeNames
FName SignalParamName = *FString::Printf(TEXT("Signal %d"), i + 1);
FName TriggerParamName = *FString::Printf(TEXT("Trigger %d"), i + 1);
FName OutputParamName = *FString::Printf(TEXT("Output %d"), i + 1);

InputInterface.Add(TInputDataVertexModel<FAudioBuffer>(SignalParamName, FText::FromString(FString::Printf(TEXT("Input signal to sample %d."), i + 1))));
InputInterface.Add(TInputDataVertexModel<FAudioBuffer>(TriggerParamName, FText::FromString(FString::Printf(TEXT("Trigger signal %d."), i + 1))));
OutputInterface.Add(TOutputDataVertexModel<FAudioBuffer>(OutputParamName, FText::FromString(FString::Printf(TEXT("Sampled output signal %d."), i + 1))));

Still tripping up with

(129): error C2065: 'InputThresholdNameName': undeclared identifier

I think I need to set some time to look at this properly. leaving at this: 569a683

matthewscharles commented 1 month ago

Took another quick look after a break.

Scope-related issues:

The build is still failing for reasons I don't understand yet, and I suspect that this relates to pointers. The errors look pretty abstract/dense to me right now, so it's probably counter-productive to list them here.

Also mixed up with warnings to update to the new API, which I don't have the capacity for at this stage.

I think I've attempted too many steps in this case, and the time might be better spent studying the model through existing code on the main UE repo.

This was supposed to be a step through familiar territory towards the shift register, which I suspect was throwing similar errors from my quick build earlier. I already have a Metasound patch built for the shift register, so there isn't a practical need for the module right now.

Silver lining: the first Sample and Hold node looks very clear now compared to this! And I have a few items for a troubleshooting checklist.

Maybe time to grab a few more low-hanging fruit with some simpler modules :)