Collection of DPF-based plugins for packaging
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.

569 lines
18KB

  1. #include "gen_exported.h"
  2. namespace gen_exported {
  3. /*******************************************************************************************************************
  4. Copyright (c) 2012 Cycling '74
  5. Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  6. and associated documentation files (the "Software"), to deal in the Software without restriction,
  7. including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
  9. subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all copies
  11. or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  13. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  14. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  15. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  16. OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. *******************************************************************************************************************/
  18. // global noise generator
  19. Noise noise;
  20. static const int GENLIB_LOOPCOUNT_BAIL = 100000;
  21. // The State struct contains all the state and procedures for the gendsp kernel
  22. typedef struct State {
  23. CommonState __commonstate;
  24. Delay m_delay_12;
  25. Delay m_delay_11;
  26. Delta m_delta_22;
  27. Delta m_delta_38;
  28. Delta m_delta_41;
  29. Delta m_delta_31;
  30. Delta m_delta_28;
  31. Delta m_delta_25;
  32. Delta m_delta_44;
  33. Delta m_delta_35;
  34. Phasor m_phasor_34;
  35. Phasor m_phasor_21;
  36. Sah m_sah_23;
  37. Sah m_sah_27;
  38. Sah m_sah_42;
  39. Sah m_sah_26;
  40. Sah m_sah_24;
  41. Sah m_sah_43;
  42. Sah m_sah_36;
  43. Sah m_sah_29;
  44. Sah m_sah_40;
  45. Sah m_sah_37;
  46. Sah m_sah_30;
  47. Sah m_sah_39;
  48. Sah m_sah_32;
  49. Sah m_sah_33;
  50. Sah m_sah_46;
  51. Sah m_sah_45;
  52. double m_history_5;
  53. double m_history_6;
  54. double m_history_7;
  55. double samples_to_seconds;
  56. double m_history_4;
  57. double m_history_2;
  58. double m_history_3;
  59. double samplerate;
  60. double m_y_1;
  61. double m_history_9;
  62. double m_history_8;
  63. double m_resonance_13;
  64. double m_y_10;
  65. double m_window_19;
  66. double m_ratio_20;
  67. double m_blur_17;
  68. double m_ratio_18;
  69. double m_window_15;
  70. double m_cutoff_14;
  71. double m_mix_16;
  72. int vectorsize;
  73. int __exception;
  74. // re-initialize all member variables;
  75. inline void reset(double __sr, int __vs) {
  76. __exception = 0;
  77. vectorsize = __vs;
  78. samplerate = __sr;
  79. m_y_1 = 0;
  80. m_history_2 = 0;
  81. m_history_3 = 0;
  82. m_history_4 = 0;
  83. m_history_5 = 0;
  84. m_history_6 = 0;
  85. m_history_7 = 0;
  86. m_history_8 = 0;
  87. m_history_9 = 0;
  88. m_y_10 = 0;
  89. m_delay_11.reset("m_delay_11", 96000);
  90. m_delay_12.reset("m_delay_12", 96000);
  91. m_resonance_13 = 0;
  92. m_cutoff_14 = 2250;
  93. m_window_15 = 100;
  94. m_mix_16 = 0.5;
  95. m_blur_17 = 0.25;
  96. m_ratio_18 = 0.5;
  97. m_window_19 = 100;
  98. m_ratio_20 = 2;
  99. samples_to_seconds = (1 / samplerate);
  100. m_phasor_21.reset(0);
  101. m_delta_22.reset(0);
  102. m_sah_23.reset(0);
  103. m_sah_24.reset(0);
  104. m_delta_25.reset(0);
  105. m_sah_26.reset(0);
  106. m_sah_27.reset(0);
  107. m_delta_28.reset(0);
  108. m_sah_29.reset(0);
  109. m_sah_30.reset(0);
  110. m_delta_31.reset(0);
  111. m_sah_32.reset(0);
  112. m_sah_33.reset(0);
  113. m_phasor_34.reset(0);
  114. m_delta_35.reset(0);
  115. m_sah_36.reset(0);
  116. m_sah_37.reset(0);
  117. m_delta_38.reset(0);
  118. m_sah_39.reset(0);
  119. m_sah_40.reset(0);
  120. m_delta_41.reset(0);
  121. m_sah_42.reset(0);
  122. m_sah_43.reset(0);
  123. m_delta_44.reset(0);
  124. m_sah_45.reset(0);
  125. m_sah_46.reset(0);
  126. genlib_reset_complete(this);
  127. };
  128. // the signal processing routine;
  129. inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
  130. vectorsize = __n;
  131. const t_sample * __in1 = __ins[0];
  132. t_sample * __out1 = __outs[0];
  133. if (__exception) {
  134. return __exception;
  135. } else if (( (__in1 == 0) || (__out1 == 0) )) {
  136. __exception = GENLIB_ERR_NULL_BUFFER;
  137. return __exception;
  138. };
  139. double mul_2327 = (m_resonance_13 * 0.125);
  140. double exp_2328 = exp(mul_2327);
  141. double mul_2326 = (exp_2328 * 0.882497);
  142. double mul_2322 = (mul_2326 * mul_2326);
  143. double expr_2437 = safediv(((m_cutoff_14 * 2) * 3.1415926535898), 44100);
  144. double cos_2325 = cos(expr_2437);
  145. double mul_2324 = (cos_2325 * mul_2326);
  146. double mul_2323 = (mul_2324 * -2);
  147. double add_2321 = ((mul_2323 + mul_2322) + 1);
  148. double mstosamps_2393 = (m_window_15 * (samplerate * 0.001));
  149. double mstosamps_2309 = (m_window_19 * (samplerate * 0.001));
  150. double rsub_2296 = (1 - m_ratio_20);
  151. double mul_2295 = (rsub_2296 * 1000);
  152. double div_2294 = safediv(mul_2295, m_window_19);
  153. samples_to_seconds = (1 / samplerate);
  154. double rsub_2380 = (1 - m_ratio_18);
  155. double mul_2379 = (rsub_2380 * 1000);
  156. double div_2378 = safediv(mul_2379, m_window_15);
  157. // the main sample loop;
  158. while ((__n--)) {
  159. const double in1 = (*(__in1++));
  160. double noise_2247 = noise();
  161. double abs_2264 = fabs(noise_2247);
  162. double mul_2270 = (abs_2264 * m_blur_17);
  163. double noise_2246 = noise();
  164. double abs_2263 = fabs(noise_2246);
  165. double mul_2267 = (abs_2263 * m_blur_17);
  166. double noise_2330 = noise();
  167. double abs_2348 = fabs(noise_2330);
  168. double mul_2354 = (abs_2348 * m_blur_17);
  169. double noise_2332 = noise();
  170. double abs_2350 = fabs(noise_2332);
  171. double mul_2360 = (abs_2350 * m_blur_17);
  172. double noise_2249 = noise();
  173. double abs_2266 = fabs(noise_2249);
  174. double mul_2276 = (abs_2266 * m_blur_17);
  175. double noise_2248 = noise();
  176. double abs_2265 = fabs(noise_2248);
  177. double mul_2273 = (abs_2265 * m_blur_17);
  178. double noise_2331 = noise();
  179. double abs_2349 = fabs(noise_2331);
  180. double mul_2357 = (abs_2349 * m_blur_17);
  181. double noise_2329 = noise();
  182. double abs_2347 = fabs(noise_2329);
  183. double mul_2351 = (abs_2347 * m_blur_17);
  184. double mul_2318 = (mul_2322 * m_y_10);
  185. double mul_2319 = (mul_2323 * m_y_1);
  186. double phasor_2315 = m_phasor_21(div_2294, samples_to_seconds);
  187. double add_2293 = ((phasor_2315 + m_history_9) + 0.5);
  188. double mod_2292 = safemod(add_2293, 1);
  189. double delta_2272 = m_delta_22(mod_2292);
  190. double sah_2252 = m_sah_23(mul_2270, delta_2272, 0);
  191. double sah_2271 = m_sah_24(mstosamps_2309, delta_2272, 0);
  192. double mul_2260 = (sah_2271 * mod_2292);
  193. double sub_2291 = (mod_2292 - 0.5);
  194. double mul_2290 = (sub_2291 * 3.1415926535898);
  195. double cos_2289 = cos(mul_2290);
  196. double mul_2279 = (cos_2289 * cos_2289);
  197. double add_2287 = ((phasor_2315 + m_history_8) + 0.75);
  198. double mod_2286 = safemod(add_2287, 1);
  199. double delta_2269 = m_delta_25(mod_2286);
  200. double sah_2250 = m_sah_26(mul_2267, delta_2269, 0);
  201. double sah_2268 = m_sah_27(mstosamps_2309, delta_2269, 0);
  202. double mul_2259 = (sah_2268 * mod_2286);
  203. double sub_2285 = (mod_2286 - 0.5);
  204. double mul_2284 = (sub_2285 * 3.1415926535898);
  205. double cos_2283 = cos(mul_2284);
  206. double mul_2278 = (cos_2283 * cos_2283);
  207. double add_2314 = ((phasor_2315 + m_history_7) + 0);
  208. double mod_2313 = safemod(add_2314, 1);
  209. double delta_2257 = m_delta_28(mod_2313);
  210. double sah_2256 = m_sah_29(mul_2276, delta_2257, 0);
  211. double sah_2277 = m_sah_30(mstosamps_2309, delta_2257, 0);
  212. double mul_2262 = (sah_2277 * mod_2313);
  213. double sub_2312 = (mod_2313 - 0.5);
  214. double mul_2311 = (sub_2312 * 3.1415926535898);
  215. double cos_2310 = cos(mul_2311);
  216. double mul_2281 = (cos_2310 * cos_2310);
  217. double add_2308 = ((phasor_2315 + m_history_6) + 0.25);
  218. double mod_2307 = safemod(add_2308, 1);
  219. double delta_2275 = m_delta_31(mod_2307);
  220. double sah_2254 = m_sah_32(mul_2273, delta_2275, 0);
  221. double sah_2274 = m_sah_33(mstosamps_2309, delta_2275, 0);
  222. double mul_2261 = (sah_2274 * mod_2307);
  223. double tap_2300 = m_delay_12.read_linear(mul_2262);
  224. double tap_2301 = m_delay_12.read_linear(mul_2261);
  225. double tap_2302 = m_delay_12.read_linear(mul_2260);
  226. double tap_2303 = m_delay_12.read_linear(mul_2259);
  227. double mul_2282 = (tap_2303 * mul_2278);
  228. double mul_2288 = (tap_2302 * mul_2279);
  229. double mul_2298 = (tap_2300 * mul_2281);
  230. double sub_2306 = (mod_2307 - 0.5);
  231. double mul_2305 = (sub_2306 * 3.1415926535898);
  232. double cos_2304 = cos(mul_2305);
  233. double mul_2280 = (cos_2304 * cos_2304);
  234. double mul_2297 = (tap_2301 * mul_2280);
  235. double phasor_2399 = m_phasor_34(div_2378, samples_to_seconds);
  236. double add_2377 = ((m_history_5 + phasor_2399) + 0.5);
  237. double mod_2376 = safemod(add_2377, 1);
  238. double delta_2356 = m_delta_35(mod_2376);
  239. double sah_2335 = m_sah_36(mul_2354, delta_2356, 0);
  240. double sah_2355 = m_sah_37(mstosamps_2393, delta_2356, 0);
  241. double mul_2344 = (sah_2355 * mod_2376);
  242. double sub_2375 = (mod_2376 - 0.5);
  243. double mul_2374 = (sub_2375 * 3.1415926535898);
  244. double cos_2373 = cos(mul_2374);
  245. double mul_2363 = (cos_2373 * cos_2373);
  246. double add_2398 = ((m_history_4 + phasor_2399) + 0);
  247. double mod_2397 = safemod(add_2398, 1);
  248. double delta_2340 = m_delta_38(mod_2397);
  249. double sah_2339 = m_sah_39(mul_2360, delta_2340, 0);
  250. double sah_2361 = m_sah_40(mstosamps_2393, delta_2340, 0);
  251. double mul_2346 = (sah_2361 * mod_2397);
  252. double sub_2396 = (mod_2397 - 0.5);
  253. double mul_2395 = (sub_2396 * 3.1415926535898);
  254. double cos_2394 = cos(mul_2395);
  255. double mul_2365 = (cos_2394 * cos_2394);
  256. double add_2392 = ((m_history_3 + phasor_2399) + 0.25);
  257. double mod_2391 = safemod(add_2392, 1);
  258. double delta_2359 = m_delta_41(mod_2391);
  259. double sah_2337 = m_sah_42(mul_2357, delta_2359, 0);
  260. double sah_2358 = m_sah_43(mstosamps_2393, delta_2359, 0);
  261. double mul_2345 = (sah_2358 * mod_2391);
  262. double sub_2390 = (mod_2391 - 0.5);
  263. double mul_2389 = (sub_2390 * 3.1415926535898);
  264. double cos_2388 = cos(mul_2389);
  265. double mul_2364 = (cos_2388 * cos_2388);
  266. double add_2371 = ((m_history_2 + phasor_2399) + 0.75);
  267. double mod_2370 = safemod(add_2371, 1);
  268. double delta_2353 = m_delta_44(mod_2370);
  269. double sah_2333 = m_sah_45(mul_2351, delta_2353, 0);
  270. double sah_2352 = m_sah_46(mstosamps_2393, delta_2353, 0);
  271. double mul_2343 = (sah_2352 * mod_2370);
  272. double tap_2384 = m_delay_11.read_linear(mul_2346);
  273. double tap_2385 = m_delay_11.read_linear(mul_2345);
  274. double tap_2386 = m_delay_11.read_linear(mul_2344);
  275. double tap_2387 = m_delay_11.read_linear(mul_2343);
  276. double mul_2382 = (tap_2384 * mul_2365);
  277. double mul_2381 = (tap_2385 * mul_2364);
  278. double mul_2372 = (tap_2386 * mul_2363);
  279. double sub_2369 = (mod_2370 - 0.5);
  280. double mul_2368 = (sub_2369 * 3.1415926535898);
  281. double cos_2367 = cos(mul_2368);
  282. double mul_2362 = (cos_2367 * cos_2367);
  283. double mul_2366 = (tap_2387 * mul_2362);
  284. double mul_2320 = ((((((((mul_2298 + mul_2297) + mul_2288) + mul_2282) + mul_2366) + mul_2372) + mul_2381) + mul_2382) * add_2321);
  285. double sub_2317 = (mul_2320 - (mul_2319 + mul_2318));
  286. double mix_2450 = (in1 + (m_mix_16 * (sub_2317 - in1)));
  287. double out1 = mix_2450;
  288. double y2_next_2440 = m_y_1;
  289. double history_2253_next_2441 = sah_2252;
  290. double history_2251_next_2442 = sah_2250;
  291. double history_2258_next_2443 = sah_2256;
  292. double history_2255_next_2444 = sah_2254;
  293. double history_2336_next_2445 = sah_2335;
  294. double history_2341_next_2446 = sah_2339;
  295. double history_2338_next_2447 = sah_2337;
  296. double history_2334_next_2448 = sah_2333;
  297. double y1_next_2449 = sub_2317;
  298. m_delay_12.write(in1);
  299. m_delay_11.write(in1);
  300. m_y_10 = y2_next_2440;
  301. m_history_9 = history_2253_next_2441;
  302. m_history_8 = history_2251_next_2442;
  303. m_history_7 = history_2258_next_2443;
  304. m_history_6 = history_2255_next_2444;
  305. m_history_5 = history_2336_next_2445;
  306. m_history_4 = history_2341_next_2446;
  307. m_history_3 = history_2338_next_2447;
  308. m_history_2 = history_2334_next_2448;
  309. m_y_1 = y1_next_2449;
  310. m_delay_11.step();
  311. m_delay_12.step();
  312. // assign results to output buffer;
  313. (*(__out1++)) = out1;
  314. };
  315. return __exception;
  316. };
  317. inline void set_resonance(double _value) {
  318. m_resonance_13 = (_value < 0 ? 0 : (_value > 0.25 ? 0.25 : _value));
  319. };
  320. inline void set_cutoff(double _value) {
  321. m_cutoff_14 = (_value < 0 ? 0 : (_value > 3000 ? 3000 : _value));
  322. };
  323. inline void set_window1(double _value) {
  324. m_window_15 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
  325. };
  326. inline void set_mix(double _value) {
  327. m_mix_16 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  328. };
  329. inline void set_blur(double _value) {
  330. m_blur_17 = (_value < 0.01 ? 0.01 : (_value > 0.25 ? 0.25 : _value));
  331. };
  332. inline void set_ratio1(double _value) {
  333. m_ratio_18 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value));
  334. };
  335. inline void set_window2(double _value) {
  336. m_window_19 = (_value < 0.1 ? 0.1 : (_value > 1000 ? 1000 : _value));
  337. };
  338. inline void set_ratio2(double _value) {
  339. m_ratio_20 = (_value < 0.5 ? 0.5 : (_value > 2 ? 2 : _value));
  340. };
  341. } State;
  342. ///
  343. /// Configuration for the genlib API
  344. ///
  345. /// Number of signal inputs and outputs
  346. int gen_kernel_numins = 1;
  347. int gen_kernel_numouts = 1;
  348. int num_inputs() { return gen_kernel_numins; }
  349. int num_outputs() { return gen_kernel_numouts; }
  350. int num_params() { return 8; }
  351. /// Assistive lables for the signal inputs and outputs
  352. const char * gen_kernel_innames[] = { "in1" };
  353. const char * gen_kernel_outnames[] = { "out1" };
  354. /// Invoke the signal process of a State object
  355. int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) {
  356. State * self = (State *)cself;
  357. return self->perform(ins, outs, n);
  358. }
  359. /// Reset all parameters and stateful operators of a State object
  360. void reset(CommonState *cself) {
  361. State * self = (State *)cself;
  362. self->reset(cself->sr, cself->vs);
  363. }
  364. /// Set a parameter of a State object
  365. void setparameter(CommonState *cself, long index, double value, void *ref) {
  366. State * self = (State *)cself;
  367. switch (index) {
  368. case 0: self->set_resonance(value); break;
  369. case 1: self->set_cutoff(value); break;
  370. case 2: self->set_window1(value); break;
  371. case 3: self->set_mix(value); break;
  372. case 4: self->set_blur(value); break;
  373. case 5: self->set_ratio1(value); break;
  374. case 6: self->set_window2(value); break;
  375. case 7: self->set_ratio2(value); break;
  376. default: break;
  377. }
  378. }
  379. /// Get the value of a parameter of a State object
  380. void getparameter(CommonState *cself, long index, double *value) {
  381. State *self = (State *)cself;
  382. switch (index) {
  383. case 0: *value = self->m_resonance_13; break;
  384. case 1: *value = self->m_cutoff_14; break;
  385. case 2: *value = self->m_window_15; break;
  386. case 3: *value = self->m_mix_16; break;
  387. case 4: *value = self->m_blur_17; break;
  388. case 5: *value = self->m_ratio_18; break;
  389. case 6: *value = self->m_window_19; break;
  390. case 7: *value = self->m_ratio_20; break;
  391. default: break;
  392. }
  393. }
  394. /// Allocate and configure a new State object and it's internal CommonState:
  395. void * create(double sr, long vs) {
  396. State *self = new State;
  397. self->reset(sr, vs);
  398. ParamInfo *pi;
  399. self->__commonstate.inputnames = gen_kernel_innames;
  400. self->__commonstate.outputnames = gen_kernel_outnames;
  401. self->__commonstate.numins = gen_kernel_numins;
  402. self->__commonstate.numouts = gen_kernel_numouts;
  403. self->__commonstate.sr = sr;
  404. self->__commonstate.vs = vs;
  405. self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(8 * sizeof(ParamInfo));
  406. self->__commonstate.numparams = 8;
  407. // initialize parameter 0 ("m_resonance_13")
  408. pi = self->__commonstate.params + 0;
  409. pi->name = "resonance";
  410. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  411. pi->defaultvalue = self->m_resonance_13;
  412. pi->defaultref = 0;
  413. pi->hasinputminmax = false;
  414. pi->inputmin = 0;
  415. pi->inputmax = 1;
  416. pi->hasminmax = true;
  417. pi->outputmin = 0;
  418. pi->outputmax = 0.25;
  419. pi->exp = 0;
  420. pi->units = ""; // no units defined
  421. // initialize parameter 1 ("m_cutoff_14")
  422. pi = self->__commonstate.params + 1;
  423. pi->name = "cutoff";
  424. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  425. pi->defaultvalue = self->m_cutoff_14;
  426. pi->defaultref = 0;
  427. pi->hasinputminmax = false;
  428. pi->inputmin = 0;
  429. pi->inputmax = 1;
  430. pi->hasminmax = true;
  431. pi->outputmin = 0;
  432. pi->outputmax = 3000;
  433. pi->exp = 0;
  434. pi->units = ""; // no units defined
  435. // initialize parameter 2 ("m_window_15")
  436. pi = self->__commonstate.params + 2;
  437. pi->name = "window1";
  438. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  439. pi->defaultvalue = self->m_window_15;
  440. pi->defaultref = 0;
  441. pi->hasinputminmax = false;
  442. pi->inputmin = 0;
  443. pi->inputmax = 1;
  444. pi->hasminmax = true;
  445. pi->outputmin = 0.1;
  446. pi->outputmax = 1000;
  447. pi->exp = 0;
  448. pi->units = ""; // no units defined
  449. // initialize parameter 3 ("m_mix_16")
  450. pi = self->__commonstate.params + 3;
  451. pi->name = "mix";
  452. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  453. pi->defaultvalue = self->m_mix_16;
  454. pi->defaultref = 0;
  455. pi->hasinputminmax = false;
  456. pi->inputmin = 0;
  457. pi->inputmax = 1;
  458. pi->hasminmax = true;
  459. pi->outputmin = 0;
  460. pi->outputmax = 1;
  461. pi->exp = 0;
  462. pi->units = ""; // no units defined
  463. // initialize parameter 4 ("m_blur_17")
  464. pi = self->__commonstate.params + 4;
  465. pi->name = "blur";
  466. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  467. pi->defaultvalue = self->m_blur_17;
  468. pi->defaultref = 0;
  469. pi->hasinputminmax = false;
  470. pi->inputmin = 0;
  471. pi->inputmax = 1;
  472. pi->hasminmax = true;
  473. pi->outputmin = 0.01;
  474. pi->outputmax = 0.25;
  475. pi->exp = 0;
  476. pi->units = ""; // no units defined
  477. // initialize parameter 5 ("m_ratio_18")
  478. pi = self->__commonstate.params + 5;
  479. pi->name = "ratio1";
  480. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  481. pi->defaultvalue = self->m_ratio_18;
  482. pi->defaultref = 0;
  483. pi->hasinputminmax = false;
  484. pi->inputmin = 0;
  485. pi->inputmax = 1;
  486. pi->hasminmax = true;
  487. pi->outputmin = 0.5;
  488. pi->outputmax = 2;
  489. pi->exp = 0;
  490. pi->units = ""; // no units defined
  491. // initialize parameter 6 ("m_window_19")
  492. pi = self->__commonstate.params + 6;
  493. pi->name = "window2";
  494. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  495. pi->defaultvalue = self->m_window_19;
  496. pi->defaultref = 0;
  497. pi->hasinputminmax = false;
  498. pi->inputmin = 0;
  499. pi->inputmax = 1;
  500. pi->hasminmax = true;
  501. pi->outputmin = 0.1;
  502. pi->outputmax = 1000;
  503. pi->exp = 0;
  504. pi->units = ""; // no units defined
  505. // initialize parameter 7 ("m_ratio_20")
  506. pi = self->__commonstate.params + 7;
  507. pi->name = "ratio2";
  508. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  509. pi->defaultvalue = self->m_ratio_20;
  510. pi->defaultref = 0;
  511. pi->hasinputminmax = false;
  512. pi->inputmin = 0;
  513. pi->inputmax = 1;
  514. pi->hasminmax = true;
  515. pi->outputmin = 0.5;
  516. pi->outputmax = 2;
  517. pi->exp = 0;
  518. pi->units = ""; // no units defined
  519. return self;
  520. }
  521. /// Release all resources and memory used by a State object:
  522. void destroy(CommonState *cself) {
  523. State * self = (State *)cself;
  524. genlib_sysmem_freeptr(cself->params);
  525. delete self;
  526. }
  527. } // gen_exported::