I made an eight voice chorus patch with eight separate short delays. It won’t load to the owl, I get the “memory overflow” message. Help please. I don’t know what the problem is.
Send us a link to the patch please (it doesn’t have to be published).
// global noise generator
Noise noise;
static const int GENLIB_LOOPCOUNT_BAIL = 100000;
// The State struct contains all the state and procedures for the gendsp kernel
typedef struct State {
CommonState __commonstate;
Delay m_delay_10;
Delay m_delay_13;
Delay m_delay_14;
Delay m_delay_7;
Delay m_delay_9;
Delay m_delay_8;
Delay m_delay_12;
Delay m_delay_11;
SineCycle __m_cycle_17;
SineCycle __m_cycle_20;
SineCycle __m_cycle_16;
SineCycle __m_cycle_19;
SineCycle __m_cycle_18;
SineCycle __m_cycle_15;
SineCycle __m_cycle_22;
SineCycle __m_cycle_21;
SineData __sinedata;
int __exception;
int vectorsize;
t_sample samplerate;
t_sample m_C_1;
t_sample m_Exp_2;
t_sample m_Push_4;
t_sample m_A_3;
t_sample m_D_5;
t_sample m_B_6;
// re-initialize all member variables;
inline void reset(t_param __sr, int __vs) {
__exception = 0;
vectorsize = __vs;
samplerate = __sr;
m_C_1 = ((int)0);
m_Exp_2 = ((int)0);
m_A_3 = ((int)0);
m_Push_4 = ((int)0);
m_D_5 = ((int)0);
m_B_6 = ((int)0);
m_delay_7.reset(“m_delay_7”, samplerate);
m_delay_8.reset(“m_delay_8”, samplerate);
m_delay_9.reset(“m_delay_9”, samplerate);
m_delay_10.reset(“m_delay_10”, samplerate);
m_delay_11.reset(“m_delay_11”, samplerate);
m_delay_12.reset(“m_delay_12”, samplerate);
m_delay_13.reset(“m_delay_13”, samplerate);
m_delay_14.reset(“m_delay_14”, samplerate);
__m_cycle_15.reset(samplerate, 0);
__m_cycle_16.reset(samplerate, 0);
__m_cycle_17.reset(samplerate, 0);
__m_cycle_18.reset(samplerate, 0);
__m_cycle_19.reset(samplerate, 0);
__m_cycle_20.reset(samplerate, 0);
__m_cycle_21.reset(samplerate, 0);
__m_cycle_22.reset(samplerate, 0);
genlib_reset_complete(this);
};
// the signal processing routine;
inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
vectorsize = __n;
const t_sample * __in1 = __ins[0];
const t_sample * __in2 = __ins[1];
t_sample * __out1 = __outs[0];
t_sample * __out2 = __outs[1];
if (__exception) {
return __exception;
} else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) )) {
__exception = GENLIB_ERR_NULL_BUFFER;
return __exception;
};
t_sample add_196 = (m_A_3 + ((t_sample)0.01));
// the main sample loop;
while ((__n--)) {
const t_sample in1 = (*(__in1++));
const t_sample in2 = (*(__in2++));
t_sample add_293 = (in1 + in2);
__m_cycle_15.freq(((t_sample)0.34));
t_sample cycle_162 = __m_cycle_15(__sinedata);
t_sample cycleindex_163 = __m_cycle_15.phase();
t_sample add_187 = (cycle_162 + ((int)1));
t_sample mul_150 = (add_196 * add_187);
t_sample mul_142 = (mul_150 * ((int)240));
t_sample tap_127 = m_delay_7.read_linear(mul_142);
__m_cycle_16.freq(((t_sample)0.13));
t_sample cycle_166 = __m_cycle_16(__sinedata);
t_sample cycleindex_167 = __m_cycle_16.phase();
t_sample add_189 = (cycle_166 + ((int)1));
t_sample mul_155 = (add_196 * add_189);
t_sample mul_145 = (mul_155 * ((int)243));
t_sample tap_131 = m_delay_8.read_linear(mul_145);
__m_cycle_17.freq(((t_sample)0.05));
t_sample cycle_170 = __m_cycle_17(__sinedata);
t_sample cycleindex_171 = __m_cycle_17.phase();
t_sample add_191 = (cycle_170 + ((int)1));
t_sample mul_152 = (add_196 * add_191);
t_sample mul_147 = (mul_152 * ((int)247));
t_sample tap_135 = m_delay_9.read_linear(mul_147);
__m_cycle_18.freq(((t_sample)0.02));
t_sample cycle_174 = __m_cycle_18(__sinedata);
t_sample cycleindex_175 = __m_cycle_18.phase();
t_sample add_193 = (cycle_174 + ((int)1));
t_sample mul_154 = (add_196 * add_193);
t_sample mul_149 = (mul_154 * ((int)251));
t_sample tap_141 = m_delay_10.read_linear(mul_149);
t_sample div_204 = ((((tap_141 + tap_135) + tap_131) + tap_127) * ((t_sample)0.25));
t_sample out1 = div_204;
__m_cycle_19.freq(((t_sample)0.01));
t_sample cycle_176 = __m_cycle_19(__sinedata);
t_sample cycleindex_177 = __m_cycle_19.phase();
t_sample add_194 = (cycle_176 + ((int)1));
t_sample mul_144 = (add_196 * add_194);
t_sample mul_159 = (mul_144 * ((int)253));
t_sample tap_158 = m_delay_11.read_linear(mul_159);
__m_cycle_20.freq(((t_sample)0.03));
t_sample cycle_172 = __m_cycle_20(__sinedata);
t_sample cycleindex_173 = __m_cycle_20.phase();
t_sample add_192 = (cycle_172 + ((int)1));
t_sample mul_153 = (add_196 * add_192);
t_sample mul_148 = (mul_153 * ((int)249));
t_sample tap_137 = m_delay_12.read_linear(mul_148);
__m_cycle_21.freq(((t_sample)0.08));
t_sample cycle_168 = __m_cycle_21(__sinedata);
t_sample cycleindex_169 = __m_cycle_21.phase();
t_sample add_190 = (cycle_168 + ((int)1));
t_sample mul_156 = (add_196 * add_190);
t_sample mul_146 = (mul_156 * ((int)245));
t_sample tap_133 = m_delay_13.read_linear(mul_146);
__m_cycle_22.freq(((t_sample)0.21));
t_sample cycle_164 = __m_cycle_22(__sinedata);
t_sample cycleindex_165 = __m_cycle_22.phase();
t_sample add_188 = (cycle_164 + ((int)1));
t_sample mul_151 = (add_196 * add_188);
t_sample mul_143 = (mul_151 * ((int)241));
t_sample tap_129 = m_delay_14.read_linear(mul_143);
t_sample div_197 = ((((tap_129 + tap_133) + tap_137) + tap_158) * ((t_sample)0.25));
t_sample out2 = div_197;
m_delay_7.write(add_293);
m_delay_14.write(add_293);
m_delay_13.write(add_293);
m_delay_12.write(add_293);
m_delay_11.write(add_293);
m_delay_10.write(add_293);
m_delay_9.write(add_293);
m_delay_8.write(add_293);
m_delay_7.step();
m_delay_8.step();
m_delay_9.step();
m_delay_10.step();
m_delay_11.step();
m_delay_12.step();
m_delay_13.step();
m_delay_14.step();
// assign results to output buffer;
(*(__out1++)) = out1;
(*(__out2++)) = out2;
};
return __exception;
};
inline void set_C(t_param _value) {
m_C_1 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_Exp(t_param _value) {
m_Exp_2 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_A(t_param _value) {
m_A_3 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_Push(t_param _value) {
m_Push_4 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_D(t_param _value) {
m_D_5 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
inline void set_B(t_param _value) {
m_B_6 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
};
} State;
///
/// Configuration for the genlib API
///
/// Number of signal inputs and outputs
int gen_kernel_numins = 2;
int gen_kernel_numouts = 2;
int num_inputs() { return gen_kernel_numins; }
int num_outputs() { return gen_kernel_numouts; }
int num_params() { return 6; }
/// Assistive lables for the signal inputs and outputs
const char *gen_kernel_innames[] = { “in1”, “in2” };
const char *gen_kernel_outnames[] = { “out1”, “out2” };
/// Invoke the signal process of a State object
int perform(CommonState *cself, t_sample **ins, long numins, t_sample *outs, long numouts, long n) {
State self = (State *)cself;
return self->perform(ins, outs, n);
}
/// Reset all parameters and stateful operators of a State object
void reset(CommonState cself) {
State self = (State *)cself;
self->reset(cself->sr, cself->vs);
}
/// Set a parameter of a State object
void setparameter(CommonState *cself, long index, t_param value, void *ref) {
State *self = (State *)cself;
switch (index) {
case 0: self->set_A(value); break;
case 1: self->set_B(value); break;
case 2: self->set_C(value); break;
case 3: self->set_D(value); break;
case 4: self->set_Exp(value); break;
case 5: self->set_Push(value); break;
default: break;
}
}
/// Get the value of a parameter of a State object
void getparameter(CommonState *cself, long index, t_param *value) {
State *self = (State *)cself;
switch (index) {
case 0: *value = self->m_A_3; break;
case 1: *value = self->m_B_6; break;
case 2: *value = self->m_C_1; break;
case 3: *value = self->m_D_5; break;
case 4: *value = self->m_Exp_2; break;
case 5: *value = self->m_Push_4; break;
default: break;
}
}
/// Get the name of a parameter of a State object
const char *getparametername(CommonState *cself, long index) {
if (index >= 0 && index < cself->numparams) {
return cself->params[index].name;
}
return 0;
}
/// Get the minimum value of a parameter of a State object
t_param getparametermin(CommonState *cself, long index) {
if (index >= 0 && index < cself->numparams) {
return cself->params[index].outputmin;
}
return 0;
}
/// Get the maximum value of a parameter of a State object
t_param getparametermax(CommonState *cself, long index) {
if (index >= 0 && index < cself->numparams) {
return cself->params[index].outputmax;
}
return 0;
}
/// Get parameter of a State object has a minimum and maximum value
char getparameterhasminmax(CommonState *cself, long index) {
if (index >= 0 && index < cself->numparams) {
return cself->params[index].hasminmax;
}
return 0;
}
/// Get the units of a parameter of a State object
const char *getparameterunits(CommonState *cself, long index) {
if (index >= 0 && index < cself->numparams) {
return cself->params[index].units;
}
return 0;
}
/// Get the size of the state of all parameters of a State object
size_t getstatesize(CommonState *cself) {
return genlib_getstatesize(cself, &getparameter);
}
/// Get the state of all parameters of a State object
short getstate(CommonState *cself, char *state) {
return genlib_getstate(cself, state, &getparameter);
}
/// set the state of all parameters of a State object
short setstate(CommonState *cself, const char *state) {
return genlib_setstate(cself, state, &setparameter);
}
/// Allocate and configure a new State object and it’s internal CommonState:
void *create(t_param sr, long vs) {
State *self = new State;
self->reset(sr, vs);
ParamInfo *pi;
self->__commonstate.inputnames = gen_kernel_innames;
self->__commonstate.outputnames = gen_kernel_outnames;
self->__commonstate.numins = gen_kernel_numins;
self->__commonstate.numouts = gen_kernel_numouts;
self->__commonstate.sr = sr;
self->__commonstate.vs = vs;
self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(6 * sizeof(ParamInfo));
self->__commonstate.numparams = 6;
// initialize parameter 0 (“m_A_3”)
pi = self->__commonstate.params + 0;
pi->name = “A”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_A_3;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
// initialize parameter 1 (“m_B_6”)
pi = self->__commonstate.params + 1;
pi->name = “B”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_B_6;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
// initialize parameter 2 (“m_C_1”)
pi = self->__commonstate.params + 2;
pi->name = “C”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_C_1;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
// initialize parameter 3 (“m_D_5”)
pi = self->__commonstate.params + 3;
pi->name = “D”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_D_5;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
// initialize parameter 4 (“m_Exp_2”)
pi = self->__commonstate.params + 4;
pi->name = “Exp”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_Exp_2;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
// initialize parameter 5 (“m_Push_4”)
pi = self->__commonstate.params + 5;
pi->name = “Push”;
pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
pi->defaultvalue = self->m_Push_4;
pi->defaultref = 0;
pi->hasinputminmax = false;
pi->inputmin = 0;
pi->inputmax = 1;
pi->hasminmax = true;
pi->outputmin = 0;
pi->outputmax = 1;
pi->exp = 0;
pi->units = “”; // no units defined
return self;
}
/// Release all resources and memory used by a State object:
void destroy(CommonState *cself) {
State *self = (State *)cself;
genlib_sysmem_freeptr(cself->params);
delete self;
}
} // Dev_default::
Is this what you mean?