-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++ wrapper set_calc_function also calculates a sample of output #8
Comments
you're right. i was oblivious to this when i was writing these examples but ran into this problem in this C++ wrapper. i ended up overriding the template <typename UnitType, void (UnitType::*PointerToMember)(int)>
void set_calc_function(void)
{
mCalcFunc = make_calc_function<UnitType, PointerToMember>();
ClearUnitOutputs(this, 1);
} my idea would be to overload this method so that it takes an argument, which can be one of the enum values |
Yep. I also just ran into an issue because of this. Happy enough I figured out how it is solvable in my case; i.e. simply not calling the calculation myself in the constructor and making sure |
I raised this issue here: It seems OK to use For this reason I'm in agreement:
This would be a breaking change, but TBH I haven't seen signs that this wrapper has been used much at all (@snappizz's example above being the exception), so maybe this could be acceptable after polling users and devs to see if anyone depends on this currently. (I haven't received any responses to my post to the user list a week ago.) @snappizz, how do you feel about strictly maintaining backwards compatibility on this? This may be a good opportunity to revisit the design more generally of some of these SCUnit wrappers? |
hey, sorry it took me so ridiculously long to get back on this. i was taking a break from SC development. really appreciate your efforts in investigating the problems with this interface, this is stuff that i've thought about for a while and i'm glad to see it discussed. currently, in core and sc3-plugins, these are all the uses of
there could be other third-party ugens using this C++ wrapper that we don't know about, since this repository has helped bring the wrapper to attention. fortunately i recommended the oldschool C wrapper as example 1a and C++ as example 1b, so i don't think i've necessarily spread it to many people aside from present company. overall, i agree that the amount of damage possible by breaking compatibility is probably not to worry about. removing i don't think this needs a plugin API version change in core, since we should try to make this change quickly because we're on the verge of releasing 3.10. i don't want to be in a situation where the |
I just got down to debugging random server hangs in a plugin I built off the c++ wrapper examples, and I discovered that set_calc_function also calculates a sample of output, so calling it first before initializing state variables sometimes results in problems. I feel that either the wrapper should be changed to mimic the behavior of SETCALC, or the examples should be changed to put calls to set_calc_function after initializing state variables, and getting rid of step 3, "calculate one sample of output".
The text was updated successfully, but these errors were encountered: