Closed morganpackard closed 11 years ago
It may not be necessary to actually create the object. Could be more efficient to just have the base class not rely on the core object in any way.
I think there are advantages to both approaches. Leaving Generator_
and ControlGenerator_
as abstract makes it very clear that tick()
(and other required methods) MUST be overridden in subclasses, whereas if they have default empty implementations it might be easier to forget.
The default Generator
and ControlGenerator
smart pointer template classes using a "passthrough" object as their default mGen should allow them to be used as-is for parameters to other Generators without crashing, and the "passthrough" classes are very lightweight, so I don't know if efficiency is that big of a concern.
All in all, I'm pretty indifferent on this, so if you feel like it's more convenient for the base classes to be concrete, that's fine with me too.
What do you think about this issue now that we've made some strides? I think Generator subclasses should always provide reasonable default values for their inputs, and having this explode when you fail to do so is a good way to identify the source of error. Otherwise you could be tracking down why the hell your thing's not working, when it all comes down to the fact that the default "Passthrough" control generator is spitting out zeros.
I haven't come across a need for the default pass-through mgens. I'd be fine with the base class blowing up if you try to tick it.
Sent from my iPhone
On Apr 14, 2013, at 1:58 PM, "Nick D." notifications@github.com wrote:
What do you think about this issue now that we've made some strides? I think Generator subclasses should always provide reasonable default values for their inputs, and having this explode when you fail to do so is a good way to identify the source of error. Otherwise you could be tracking down why the hell your thing's not working, when it all comes down to the fact that the default "Passthrough" control generator is spitting out zeros.
— Reply to this email directly or view it on GitHubhttps://github.com/TonicAudio/Tonic/issues/6#issuecomment-16355983 .
Cool, marking as closed then.
PassThroughGenerator_ shouldn't be necessary.
Generator
andControlGenerator
should be non-abstract, and work on their own, just with no effect.Any parameter which takes one of these should not be required to be set. The automatically-instantiated
Generator
andControlGenerator
should be able to work just fine as-is, rather than crashing, which is what happens now.