I too am running into a few design headache's / queries regarding custom voice classes derived from JUCE's synth voice class.
Most of my issues have been solved by creating the various components of my Synth as AudioProcessors and hooking them up into an AudioProcessorGraph.
So dealing with things like filter cutoff parameters and delay parameters is becoming much more flexible.
However, I am still having the issue that my WaveTableOscillator class is being implemented as a member of my derived synth voice class. The various functions within the voice class for rendering the voice and noteOn call the oscillators output to fill the buffer and also in turn set it's frequency.
I need access to a few paramters of my oscillator within my derived synth voice (fine tune etc. for modulation and GUI param changes). As previouslty stated in this thread the getVoices() function returns a SynthVoice and the only way i can call my derived voices functions/access its member variables is to perform a dynamic cast.
I'm wondering whether dynamic casting in this instance really is the best / only option or not ? It's working but is it an ugly work around ? I'm working through the various Meyers texts and think im getting a reasonable understanding of the consequences of dynamic casts.
Does anyone have any advice in regards to this ?
Any help for a still "in learning" C++ programmer would be most appreciated.