How to access mono processor instance from ProcessorDuplicator?

dsp_module

#1

I understand the pattern of using ProcessorDuplicator to duplicate mono processors and then using a ProcessorState to share state between them.

But what if the mono processor being managed by the ProcessorDulplicator doesn’t, or can’t use a ProcessorState for its state handling? How can I e.g. access a mono processor instance in order to call setter methods on it?

An example would be any state that utilises LinearSmoothedValue. If such state is shared amongst multiple instances in a ProcessorDuplicator then each instance is going to get every nth value from LinearSmoothedValue::getNextValue() where n is the number of duplicated instances, which obviously doesn’t work.

With the current API, the only way I can see around this is to make processors multi-channel, so a ProcessorDuplicator isn’t needed for multi-channel support, but this seems a waste given the convenience of ProcessorDuplicator.

It seems like ProcessorDuplicator needs a getInstance(int index) method analogous to ChainBase::get() that enables individual instances to be accessed after creation.

Jamie