diff --git a/helper.py b/helper.py index 5ddf2a44..e7d029b6 100755 --- a/helper.py +++ b/helper.py @@ -407,7 +407,7 @@ struct {identifier} : Module {{""" for c in components['params']: source += f""" - params[{c['name']}_PARAM].config(0.f, 1.f, 0.f, "");""" + configParam({c['name']}_PARAM, 0.f, 1.f, 0.f, "");""" source += """ } diff --git a/include/dsp/digital.hpp b/include/dsp/digital.hpp index 79cb66e9..ecc6083b 100644 --- a/include/dsp/digital.hpp +++ b/include/dsp/digital.hpp @@ -151,6 +151,10 @@ struct Counter { reset(); } + int getCount() { + return count; + } + /** Returns true when the counter reaches `period` and resets. */ bool process() { count++; diff --git a/include/rack0.hpp b/include/rack0.hpp index 40797144..32e323d0 100644 --- a/include/rack0.hpp +++ b/include/rack0.hpp @@ -120,7 +120,7 @@ template DEPRECATED TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { TParamWidget *o = createParam(pos, module, paramId); if (module) { - module->params[paramId].config(minValue, maxValue, defaultValue); + module->configParam(paramId, minValue, maxValue, defaultValue) } return o; }