DPF with Max Gen
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

603 lines
20KB

  1. #include "gen_exported.h"
  2. namespace gen_exported {
  3. /*******************************************************************************************************************
  4. Cycling '74 License for Max-Generated Code for Export
  5. Copyright (c) 2016 Cycling '74
  6. The code that Max generates automatically and that end users are capable of exporting and using, and any
  7. associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author
  8. and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a
  9. copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software,
  10. and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  11. The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the
  12. Software must contact the copyright owner to determine if a license for commercial use is available, and the
  13. terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries
  14. to licensing (at) cycling74.com. The determination of whether a use is commercial use or non-commercial use is based
  15. upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or
  16. other business whether for-profit or non-profit so long as the use itself is not a commercialization of the
  17. materials or a use that generates or is intended to generate income, revenue, sales or profit.
  18. The above copyright notice and this license shall be included in all copies or substantial portions of the Software.
  19. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  20. THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  21. THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  22. CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. DEALINGS IN THE SOFTWARE.
  24. *******************************************************************************************************************/
  25. // global noise generator
  26. Noise noise;
  27. static const int GENLIB_LOOPCOUNT_BAIL = 100000;
  28. // The State struct contains all the state and procedures for the gendsp kernel
  29. typedef struct State {
  30. CommonState __commonstate;
  31. Delay m_delay_11;
  32. Delay m_delay_10;
  33. Delay m_delay_12;
  34. Delay m_delay_6;
  35. Delay m_delay_7;
  36. Delay m_delay_8;
  37. Delay m_delay_13;
  38. Delay m_delay_15;
  39. Delay m_delay_14;
  40. Delay m_delay_17;
  41. Delay m_delay_16;
  42. Delay m_delay_9;
  43. int __exception;
  44. int vectorsize;
  45. t_sample m_roomsize_20;
  46. t_sample m_revtime_19;
  47. t_sample m_damping_24;
  48. t_sample m_dry_21;
  49. t_sample m_bandwidth_23;
  50. t_sample m_tail_22;
  51. t_sample m_history_5;
  52. t_sample m_early_18;
  53. t_sample m_history_1;
  54. t_sample m_history_4;
  55. t_sample samplerate;
  56. t_sample m_history_3;
  57. t_sample m_history_2;
  58. t_sample m_spread_25;
  59. // re-initialize all member variables;
  60. inline void reset(t_param __sr, int __vs) {
  61. __exception = 0;
  62. vectorsize = __vs;
  63. samplerate = __sr;
  64. m_history_1 = 0;
  65. m_history_2 = 0;
  66. m_history_3 = 0;
  67. m_history_4 = 0;
  68. m_history_5 = 0;
  69. m_delay_6.reset("m_delay_6", 7000);
  70. m_delay_7.reset("m_delay_7", 5000);
  71. m_delay_8.reset("m_delay_8", 16000);
  72. m_delay_9.reset("m_delay_9", 6000);
  73. m_delay_10.reset("m_delay_10", 15000);
  74. m_delay_11.reset("m_delay_11", 12000);
  75. m_delay_12.reset("m_delay_12", 48000);
  76. m_delay_13.reset("m_delay_13", 10000);
  77. m_delay_14.reset("m_delay_14", 48000);
  78. m_delay_15.reset("m_delay_15", 48000);
  79. m_delay_16.reset("m_delay_16", 48000);
  80. m_delay_17.reset("m_delay_17", 48000);
  81. m_early_18 = 0.25;
  82. m_revtime_19 = 11;
  83. m_roomsize_20 = 75;
  84. m_dry_21 = 1;
  85. m_tail_22 = 0.25;
  86. m_bandwidth_23 = 0.5;
  87. m_damping_24 = 0.7;
  88. m_spread_25 = 23;
  89. genlib_reset_complete(this);
  90. };
  91. // the signal processing routine;
  92. inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
  93. vectorsize = __n;
  94. const t_sample * __in1 = __ins[0];
  95. const t_sample * __in2 = __ins[1];
  96. t_sample * __out1 = __outs[0];
  97. t_sample * __out2 = __outs[1];
  98. if (__exception) {
  99. return __exception;
  100. } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) )) {
  101. __exception = GENLIB_ERR_NULL_BUFFER;
  102. return __exception;
  103. };
  104. t_sample expr_317 = ((m_roomsize_20 * samplerate) * 0.0029411764705882);
  105. t_sample expr_316 = safepow(0.001, safediv(1, (m_revtime_19 * samplerate)));
  106. t_sample add_221 = (expr_317 + 5);
  107. t_sample expr_311 = safepow(expr_316, add_221);
  108. t_sample mul_298 = (expr_317 * 1);
  109. t_sample expr_315 = (-safepow(expr_316, mul_298));
  110. t_sample mul_297 = (expr_317 * 0.81649);
  111. t_sample expr_310 = (-safepow(expr_316, mul_297));
  112. t_sample mul_295 = (expr_317 * 0.63245);
  113. t_sample expr_308 = (-safepow(expr_316, mul_295));
  114. t_sample mul_296 = (expr_317 * 0.7071);
  115. t_sample expr_309 = (-safepow(expr_316, mul_296));
  116. t_sample mul_227 = (expr_317 * 0.41);
  117. t_sample add_224 = (mul_227 + 5);
  118. t_sample expr_314 = safepow(expr_316, add_224);
  119. t_sample mul_226 = (expr_317 * 0.3);
  120. t_sample add_223 = (mul_226 + 5);
  121. t_sample expr_313 = safepow(expr_316, add_223);
  122. t_sample mul_225 = (expr_317 * 0.155);
  123. t_sample add_222 = (mul_225 + 5);
  124. t_sample expr_312 = safepow(expr_316, add_222);
  125. t_sample rsub_306 = (1 - m_bandwidth_23);
  126. t_sample mul_292 = (expr_317 * 0.000527);
  127. int int_291 = int(mul_292);
  128. t_sample mul_260 = (m_spread_25 * 0.376623);
  129. t_sample add_259 = (mul_260 + 931);
  130. t_sample rsub_256 = (1341 - add_259);
  131. t_sample mul_267 = (int_291 * rsub_256);
  132. t_sample mul_232 = (m_spread_25 * (-0.380445));
  133. t_sample add_231 = (mul_232 + 931);
  134. t_sample rsub_228 = (1341 - add_231);
  135. t_sample mul_241 = (int_291 * rsub_228);
  136. t_sample mul_276 = (m_spread_25 * 0.125541);
  137. t_sample add_258 = (mul_276 + 369);
  138. t_sample rsub_257 = (add_259 - add_258);
  139. t_sample mul_274 = (int_291 * rsub_257);
  140. t_sample mul_290 = (expr_317 * 0.110732);
  141. t_sample mul_234 = (m_spread_25 * (-0.568366));
  142. t_sample add_230 = (mul_234 + 369);
  143. t_sample rsub_229 = (add_231 - add_230);
  144. t_sample mul_248 = (int_291 * rsub_229);
  145. t_sample add_275 = (mul_276 + 159);
  146. t_sample mul_283 = (int_291 * add_275);
  147. t_sample add_233 = (mul_234 + 159);
  148. t_sample mul_255 = (int_291 * add_233);
  149. // the main sample loop;
  150. while ((__n--)) {
  151. const t_sample in1 = (*(__in1++));
  152. const t_sample in2 = (*(__in2++));
  153. t_sample mul_165 = (in1 * m_dry_21);
  154. t_sample mul_153 = (in2 * m_dry_21);
  155. t_sample mul_155 = ((in1 + in2) * 0.707);
  156. t_sample mix_323 = (mul_155 + (rsub_306 * (m_history_5 - mul_155)));
  157. t_sample mix_305 = mix_323;
  158. t_sample tap_201 = m_delay_17.read_linear(mul_296);
  159. t_sample mul_197 = (tap_201 * expr_309);
  160. t_sample mix_324 = (mul_197 + (m_damping_24 * (m_history_4 - mul_197)));
  161. t_sample mix_199 = mix_324;
  162. t_sample tap_207 = m_delay_16.read_linear(mul_297);
  163. t_sample mul_203 = (tap_207 * expr_310);
  164. t_sample mix_325 = (mul_203 + (m_damping_24 * (m_history_3 - mul_203)));
  165. t_sample mix_205 = mix_325;
  166. t_sample tap_303 = m_delay_15.read_linear(mul_298);
  167. t_sample mul_294 = (tap_303 * expr_315);
  168. t_sample mix_326 = (mul_294 + (m_damping_24 * (m_history_2 - mul_294)));
  169. t_sample mix_301 = mix_326;
  170. t_sample tap_195 = m_delay_14.read_linear(mul_295);
  171. t_sample mul_191 = (tap_195 * expr_308);
  172. t_sample mix_327 = (mul_191 + (m_damping_24 * (m_history_1 - mul_191)));
  173. t_sample mix_193 = mix_327;
  174. t_sample tap_266 = m_delay_13.read_linear(mul_267);
  175. t_sample mul_264 = (tap_266 * 0.625);
  176. t_sample tap_209 = m_delay_12.read_linear(add_224);
  177. t_sample tap_210 = m_delay_12.read_linear(add_223);
  178. t_sample tap_211 = m_delay_12.read_linear(add_222);
  179. t_sample tap_212 = m_delay_12.read_linear(add_221);
  180. t_sample mul_215 = (tap_211 * expr_312);
  181. t_sample mul_217 = (tap_210 * expr_313);
  182. t_sample mul_219 = (tap_209 * expr_314);
  183. t_sample mul_213 = (tap_212 * expr_311);
  184. t_sample tap_240 = m_delay_11.read_linear(mul_241);
  185. t_sample mul_238 = (tap_240 * 0.625);
  186. t_sample sub_184 = (mix_301 - mix_205);
  187. t_sample sub_181 = (mix_199 - mix_193);
  188. t_sample sub_180 = (sub_184 - sub_181);
  189. t_sample mul_163 = (sub_180 * 0.5);
  190. t_sample add_188 = (mul_163 + mul_217);
  191. t_sample add_179 = (sub_184 + sub_181);
  192. t_sample rsub_177 = (0 - add_179);
  193. t_sample mul_162 = (rsub_177 * 0.5);
  194. t_sample add_187 = (mul_162 + mul_215);
  195. t_sample add_185 = (mix_301 + mix_205);
  196. t_sample add_183 = (mix_199 + mix_193);
  197. t_sample sub_182 = (add_185 - add_183);
  198. t_sample mul_164 = (sub_182 * 0.5);
  199. t_sample add_189 = (mul_164 + mul_219);
  200. t_sample add_178 = (add_185 + add_183);
  201. t_sample mul_161 = (add_178 * 0.5);
  202. t_sample add_186 = (mul_161 + mul_213);
  203. t_sample tap_273 = m_delay_10.read_linear(mul_274);
  204. t_sample mul_271 = (tap_273 * 0.625);
  205. t_sample tap_289 = m_delay_9.read_linear(mul_290);
  206. t_sample tap_247 = m_delay_8.read_linear(mul_248);
  207. t_sample mul_245 = (tap_247 * 0.625);
  208. t_sample tap_282 = m_delay_7.read_linear(mul_283);
  209. t_sample mul_280 = (tap_282 * 0.75);
  210. t_sample mul_287 = (tap_289 * 0.75);
  211. t_sample sub_286 = (mix_305 - mul_287);
  212. t_sample mul_285 = (sub_286 * 0.75);
  213. t_sample add_284 = (mul_285 + tap_289);
  214. t_sample tap_254 = m_delay_6.read_linear(mul_255);
  215. t_sample mul_252 = (tap_254 * 0.75);
  216. t_sample mul_176 = (mul_164 * m_tail_22);
  217. t_sample mul_174 = (mul_162 * m_tail_22);
  218. t_sample add_160 = (mul_176 + mul_174);
  219. t_sample mul_175 = (mul_163 * m_tail_22);
  220. t_sample mul_173 = (mul_161 * m_tail_22);
  221. t_sample add_159 = (mul_175 + mul_173);
  222. t_sample sub_168 = (add_160 - add_159);
  223. t_sample mul_172 = (mul_219 * m_early_18);
  224. t_sample mul_170 = (mul_215 * m_early_18);
  225. t_sample add_158 = (mul_172 + mul_170);
  226. t_sample mul_171 = (mul_217 * m_early_18);
  227. t_sample mul_169 = (mul_213 * m_early_18);
  228. t_sample add_157 = (mul_171 + mul_169);
  229. t_sample sub_167 = (add_158 - add_157);
  230. t_sample add_154 = (sub_168 + sub_167);
  231. t_sample add_166 = (add_154 + in1);
  232. t_sample sub_279 = (add_166 - mul_280);
  233. t_sample mul_278 = (sub_279 * 0.75);
  234. t_sample add_277 = (mul_278 + tap_282);
  235. t_sample sub_270 = (add_277 - mul_271);
  236. t_sample mul_269 = (sub_270 * 0.625);
  237. t_sample add_268 = (mul_269 + tap_273);
  238. t_sample sub_263 = (add_268 - mul_264);
  239. t_sample mul_262 = (sub_263 * 0.625);
  240. t_sample add_261 = (mul_262 + tap_266);
  241. t_sample out1 = (mul_165 + add_261);
  242. t_sample add_156 = (add_154 + in2);
  243. t_sample sub_251 = (add_156 - mul_252);
  244. t_sample mul_250 = (sub_251 * 0.75);
  245. t_sample add_249 = (mul_250 + tap_254);
  246. t_sample sub_244 = (add_249 - mul_245);
  247. t_sample mul_243 = (sub_244 * 0.625);
  248. t_sample add_242 = (mul_243 + tap_247);
  249. t_sample sub_237 = (add_242 - mul_238);
  250. t_sample mul_236 = (sub_237 * 0.625);
  251. t_sample add_235 = (mul_236 + tap_240);
  252. t_sample out2 = (mul_153 + add_235);
  253. t_sample history_304_next_318 = fixdenorm(mix_305);
  254. t_sample history_198_next_319 = fixdenorm(mix_199);
  255. t_sample history_204_next_320 = fixdenorm(mix_205);
  256. t_sample history_300_next_321 = fixdenorm(mix_301);
  257. t_sample history_192_next_322 = fixdenorm(mix_193);
  258. m_delay_17.write(add_187);
  259. m_delay_16.write(add_188);
  260. m_delay_15.write(add_189);
  261. m_delay_14.write(add_186);
  262. m_delay_13.write(sub_263);
  263. m_delay_12.write(add_284);
  264. m_delay_11.write(sub_237);
  265. m_delay_10.write(sub_270);
  266. m_delay_9.write(sub_286);
  267. m_delay_8.write(sub_244);
  268. m_delay_7.write(sub_279);
  269. m_delay_6.write(sub_251);
  270. m_history_5 = history_304_next_318;
  271. m_history_4 = history_198_next_319;
  272. m_history_3 = history_204_next_320;
  273. m_history_2 = history_300_next_321;
  274. m_history_1 = history_192_next_322;
  275. m_delay_6.step();
  276. m_delay_7.step();
  277. m_delay_8.step();
  278. m_delay_9.step();
  279. m_delay_10.step();
  280. m_delay_11.step();
  281. m_delay_12.step();
  282. m_delay_13.step();
  283. m_delay_14.step();
  284. m_delay_15.step();
  285. m_delay_16.step();
  286. m_delay_17.step();
  287. // assign results to output buffer;
  288. (*(__out1++)) = out1;
  289. (*(__out2++)) = out2;
  290. };
  291. return __exception;
  292. };
  293. inline void set_early(t_param _value) {
  294. m_early_18 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  295. };
  296. inline void set_revtime(t_param _value) {
  297. m_revtime_19 = (_value < 0.1 ? 0.1 : (_value > 360 ? 360 : _value));
  298. };
  299. inline void set_roomsize(t_param _value) {
  300. m_roomsize_20 = (_value < 0.1 ? 0.1 : (_value > 300 ? 300 : _value));
  301. };
  302. inline void set_dry(t_param _value) {
  303. m_dry_21 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  304. };
  305. inline void set_tail(t_param _value) {
  306. m_tail_22 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  307. };
  308. inline void set_bandwidth(t_param _value) {
  309. m_bandwidth_23 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  310. };
  311. inline void set_damping(t_param _value) {
  312. m_damping_24 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  313. };
  314. inline void set_spread(t_param _value) {
  315. m_spread_25 = (_value < 0 ? 0 : (_value > 100 ? 100 : _value));
  316. };
  317. } State;
  318. ///
  319. /// Configuration for the genlib API
  320. ///
  321. /// Number of signal inputs and outputs
  322. int gen_kernel_numins = 2;
  323. int gen_kernel_numouts = 2;
  324. int num_inputs() { return gen_kernel_numins; }
  325. int num_outputs() { return gen_kernel_numouts; }
  326. int num_params() { return 8; }
  327. /// Assistive lables for the signal inputs and outputs
  328. const char *gen_kernel_innames[] = { "in1", "in2" };
  329. const char *gen_kernel_outnames[] = { "out1", "out2" };
  330. /// Invoke the signal process of a State object
  331. int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) {
  332. State* self = (State *)cself;
  333. return self->perform(ins, outs, n);
  334. }
  335. /// Reset all parameters and stateful operators of a State object
  336. void reset(CommonState *cself) {
  337. State* self = (State *)cself;
  338. self->reset(cself->sr, cself->vs);
  339. }
  340. /// Set a parameter of a State object
  341. void setparameter(CommonState *cself, long index, t_param value, void *ref) {
  342. State *self = (State *)cself;
  343. switch (index) {
  344. case 0: self->set_bandwidth(value); break;
  345. case 1: self->set_damping(value); break;
  346. case 2: self->set_dry(value); break;
  347. case 3: self->set_early(value); break;
  348. case 4: self->set_revtime(value); break;
  349. case 5: self->set_roomsize(value); break;
  350. case 6: self->set_spread(value); break;
  351. case 7: self->set_tail(value); break;
  352. default: break;
  353. }
  354. }
  355. /// Get the value of a parameter of a State object
  356. void getparameter(CommonState *cself, long index, t_param *value) {
  357. State *self = (State *)cself;
  358. switch (index) {
  359. case 0: *value = self->m_bandwidth_23; break;
  360. case 1: *value = self->m_damping_24; break;
  361. case 2: *value = self->m_dry_21; break;
  362. case 3: *value = self->m_early_18; break;
  363. case 4: *value = self->m_revtime_19; break;
  364. case 5: *value = self->m_roomsize_20; break;
  365. case 6: *value = self->m_spread_25; break;
  366. case 7: *value = self->m_tail_22; break;
  367. default: break;
  368. }
  369. }
  370. /// Get the name of a parameter of a State object
  371. const char *getparametername(CommonState *cself, long index) {
  372. if (index >= 0 && index < cself->numparams) {
  373. return cself->params[index].name;
  374. }
  375. return 0;
  376. }
  377. /// Get the minimum value of a parameter of a State object
  378. t_param getparametermin(CommonState *cself, long index) {
  379. if (index >= 0 && index < cself->numparams) {
  380. return cself->params[index].outputmin;
  381. }
  382. return 0;
  383. }
  384. /// Get the maximum value of a parameter of a State object
  385. t_param getparametermax(CommonState *cself, long index) {
  386. if (index >= 0 && index < cself->numparams) {
  387. return cself->params[index].outputmax;
  388. }
  389. return 0;
  390. }
  391. /// Get parameter of a State object has a minimum and maximum value
  392. char getparameterhasminmax(CommonState *cself, long index) {
  393. if (index >= 0 && index < cself->numparams) {
  394. return cself->params[index].hasminmax;
  395. }
  396. return 0;
  397. }
  398. /// Get the units of a parameter of a State object
  399. const char *getparameterunits(CommonState *cself, long index) {
  400. if (index >= 0 && index < cself->numparams) {
  401. return cself->params[index].units;
  402. }
  403. return 0;
  404. }
  405. /// Get the size of the state of all parameters of a State object
  406. size_t getstatesize(CommonState *cself) {
  407. return genlib_getstatesize(cself, &getparameter);
  408. }
  409. /// Get the state of all parameters of a State object
  410. short getstate(CommonState *cself, char *state) {
  411. return genlib_getstate(cself, state, &getparameter);
  412. }
  413. /// set the state of all parameters of a State object
  414. short setstate(CommonState *cself, const char *state) {
  415. return genlib_setstate(cself, state, &setparameter);
  416. }
  417. /// Allocate and configure a new State object and it's internal CommonState:
  418. void *create(t_param sr, long vs) {
  419. State *self = new State;
  420. self->reset(sr, vs);
  421. ParamInfo *pi;
  422. self->__commonstate.inputnames = gen_kernel_innames;
  423. self->__commonstate.outputnames = gen_kernel_outnames;
  424. self->__commonstate.numins = gen_kernel_numins;
  425. self->__commonstate.numouts = gen_kernel_numouts;
  426. self->__commonstate.sr = sr;
  427. self->__commonstate.vs = vs;
  428. self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(8 * sizeof(ParamInfo));
  429. self->__commonstate.numparams = 8;
  430. // initialize parameter 0 ("m_bandwidth_23")
  431. pi = self->__commonstate.params + 0;
  432. pi->name = "bandwidth";
  433. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  434. pi->defaultvalue = self->m_bandwidth_23;
  435. pi->defaultref = 0;
  436. pi->hasinputminmax = false;
  437. pi->inputmin = 0;
  438. pi->inputmax = 1;
  439. pi->hasminmax = true;
  440. pi->outputmin = 0;
  441. pi->outputmax = 1;
  442. pi->exp = 0;
  443. pi->units = ""; // no units defined
  444. // initialize parameter 1 ("m_damping_24")
  445. pi = self->__commonstate.params + 1;
  446. pi->name = "damping";
  447. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  448. pi->defaultvalue = self->m_damping_24;
  449. pi->defaultref = 0;
  450. pi->hasinputminmax = false;
  451. pi->inputmin = 0;
  452. pi->inputmax = 1;
  453. pi->hasminmax = true;
  454. pi->outputmin = 0;
  455. pi->outputmax = 1;
  456. pi->exp = 0;
  457. pi->units = ""; // no units defined
  458. // initialize parameter 2 ("m_dry_21")
  459. pi = self->__commonstate.params + 2;
  460. pi->name = "dry";
  461. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  462. pi->defaultvalue = self->m_dry_21;
  463. pi->defaultref = 0;
  464. pi->hasinputminmax = false;
  465. pi->inputmin = 0;
  466. pi->inputmax = 1;
  467. pi->hasminmax = true;
  468. pi->outputmin = 0;
  469. pi->outputmax = 1;
  470. pi->exp = 0;
  471. pi->units = ""; // no units defined
  472. // initialize parameter 3 ("m_early_18")
  473. pi = self->__commonstate.params + 3;
  474. pi->name = "early";
  475. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  476. pi->defaultvalue = self->m_early_18;
  477. pi->defaultref = 0;
  478. pi->hasinputminmax = false;
  479. pi->inputmin = 0;
  480. pi->inputmax = 1;
  481. pi->hasminmax = true;
  482. pi->outputmin = 0;
  483. pi->outputmax = 1;
  484. pi->exp = 0;
  485. pi->units = ""; // no units defined
  486. // initialize parameter 4 ("m_revtime_19")
  487. pi = self->__commonstate.params + 4;
  488. pi->name = "revtime";
  489. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  490. pi->defaultvalue = self->m_revtime_19;
  491. pi->defaultref = 0;
  492. pi->hasinputminmax = false;
  493. pi->inputmin = 0;
  494. pi->inputmax = 1;
  495. pi->hasminmax = true;
  496. pi->outputmin = 0.1;
  497. pi->outputmax = 360;
  498. pi->exp = 0;
  499. pi->units = ""; // no units defined
  500. // initialize parameter 5 ("m_roomsize_20")
  501. pi = self->__commonstate.params + 5;
  502. pi->name = "roomsize";
  503. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  504. pi->defaultvalue = self->m_roomsize_20;
  505. pi->defaultref = 0;
  506. pi->hasinputminmax = false;
  507. pi->inputmin = 0;
  508. pi->inputmax = 1;
  509. pi->hasminmax = true;
  510. pi->outputmin = 0.1;
  511. pi->outputmax = 300;
  512. pi->exp = 0;
  513. pi->units = ""; // no units defined
  514. // initialize parameter 6 ("m_spread_25")
  515. pi = self->__commonstate.params + 6;
  516. pi->name = "spread";
  517. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  518. pi->defaultvalue = self->m_spread_25;
  519. pi->defaultref = 0;
  520. pi->hasinputminmax = false;
  521. pi->inputmin = 0;
  522. pi->inputmax = 1;
  523. pi->hasminmax = true;
  524. pi->outputmin = 0;
  525. pi->outputmax = 100;
  526. pi->exp = 0;
  527. pi->units = ""; // no units defined
  528. // initialize parameter 7 ("m_tail_22")
  529. pi = self->__commonstate.params + 7;
  530. pi->name = "tail";
  531. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  532. pi->defaultvalue = self->m_tail_22;
  533. pi->defaultref = 0;
  534. pi->hasinputminmax = false;
  535. pi->inputmin = 0;
  536. pi->inputmax = 1;
  537. pi->hasminmax = true;
  538. pi->outputmin = 0;
  539. pi->outputmax = 1;
  540. pi->exp = 0;
  541. pi->units = ""; // no units defined
  542. return self;
  543. }
  544. /// Release all resources and memory used by a State object:
  545. void destroy(CommonState *cself) {
  546. State *self = (State *)cself;
  547. genlib_sysmem_freeptr(cself->params);
  548. delete self;
  549. }
  550. } // gen_exported::