How to create own dsp modules?

Hi,
still kinda new to juce.
I created my own algoritm and I would like to use it in a ProcessorChain. However there has to be some functions to get it done. Is there any best practice on how to implement them? What arguments do they need to work properly? Is there any class I can inherit from to make the implementation more easy? If not are the following functions all i need?

void prepare();
void process();
void reset

This is a class skeleton that will compile when used with ProcessorChain :

template <typename SampleType> class MyProcessor
{
  public:
    MyProcessor() {}
    void prepare(const juce::dsp::ProcessSpec &spec) noexcept
    {
        // prepare impl here...
    }
    void reset()
    {
        // reset impl here...
    }
    template <typename ProcessContext> void process(const ProcessContext &context)
    {
        // process impl here...
    }
};

However, I’d suggest reconsidering if you really want to be using ProcessorChain to begin with. It doesn’t really do anything magical and is not particularly flexible. You can’t for example reorder the processors in the chain or add/remove processors at run time, it’s all compile time. (I know there’s the argument that because of the heavy use of templates, the compiler could potentially figure out some additional optimizations, but I am highly skeptical about that without seeing any concrete benchmark results.)

Hmm okay thank you. What would you suggest me to use instead of the ProcessorChain to add/remove/reorder Processors withn the runtime?

The AudioProcessorGraph can do all of that:

https://docs.juce.com/master/classAudioProcessorGraph.html
https://docs.juce.com/master/tutorial_audio_processor_graph.html