logue-sdk icon indicating copy to clipboard operation
logue-sdk copied to clipboard

NTS-1 mkII: unit_set_param_value() calls after unit_init() and before the first call of unit_render() destroy the parameter values

Open boochow opened this issue 10 months ago • 0 comments

A series of unit_set_param_value() calls occur just after unit_init() and before the first call of unit_render() have wrong parameter values(zero in most cases.) and they eventually destroy parameter values initialized in unit_init(). The parameter values of these unit_set_param_value() calls don't fit the value ranges defined in header.c and should be removed. As a workaround, I use a flag variable to indicate whether the first call of unit_render() has occurred and ignore all unit_set_param_value() calls before the first call of unit_render().

    inline int8_t Init(const unit_runtime_desc_t * desc) {
        started_ = false;
    .
    .
    fast_inline void Process(const float * in, float * out, size_t frames) {
        started_ = true;
    .
    .
    inline void setParameter(uint8_t index, int32_t value) {
        if (!started_) {
            return;
	}

boochow avatar Apr 28 '24 14:04 boochow