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.

538 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_11;
  25. Delay m_delay_9;
  26. Delay m_delay_8;
  27. Delay m_delay_7;
  28. Delay m_delay_10;
  29. Delay m_delay_12;
  30. Delay m_delay_16;
  31. Delay m_delay_13;
  32. Delay m_delay_14;
  33. Delay m_delay_6;
  34. Delay m_delay_15;
  35. Delay m_delay_17;
  36. t_sample m_bandwidth_22;
  37. t_sample m_tail_23;
  38. t_sample m_spread_21;
  39. t_sample m_revtime_19;
  40. t_sample m_roomsize_20;
  41. t_sample m_damping_18;
  42. t_sample m_early_25;
  43. t_sample m_history_5;
  44. t_sample m_dry_24;
  45. t_sample samplerate;
  46. t_sample m_history_2;
  47. t_sample m_history_1;
  48. t_sample m_history_4;
  49. t_sample m_history_3;
  50. int vectorsize;
  51. int __exception;
  52. // re-initialize all member variables;
  53. inline void reset(t_sample __sr, int __vs) {
  54. __exception = 0;
  55. vectorsize = __vs;
  56. samplerate = __sr;
  57. m_history_1 = 0;
  58. m_history_2 = 0;
  59. m_history_3 = 0;
  60. m_history_4 = 0;
  61. m_history_5 = 0;
  62. m_delay_6.reset("m_delay_6", 5000);
  63. m_delay_7.reset("m_delay_7", 7000);
  64. m_delay_8.reset("m_delay_8", 15000);
  65. m_delay_9.reset("m_delay_9", 6000);
  66. m_delay_10.reset("m_delay_10", 16000);
  67. m_delay_11.reset("m_delay_11", 48000);
  68. m_delay_12.reset("m_delay_12", 10000);
  69. m_delay_13.reset("m_delay_13", 12000);
  70. m_delay_14.reset("m_delay_14", 48000);
  71. m_delay_15.reset("m_delay_15", 48000);
  72. m_delay_16.reset("m_delay_16", 48000);
  73. m_delay_17.reset("m_delay_17", 48000);
  74. m_damping_18 = 0.7;
  75. m_revtime_19 = 11;
  76. m_roomsize_20 = 75;
  77. m_spread_21 = 23;
  78. m_bandwidth_22 = 0.5;
  79. m_tail_23 = 0.25;
  80. m_dry_24 = 1;
  81. m_early_25 = 0.25;
  82. genlib_reset_complete(this);
  83. };
  84. // the signal processing routine;
  85. inline int perform(t_sample ** __ins, t_sample ** __outs, int __n) {
  86. vectorsize = __n;
  87. const t_sample * __in1 = __ins[0];
  88. const t_sample * __in2 = __ins[1];
  89. t_sample * __out1 = __outs[0];
  90. t_sample * __out2 = __outs[1];
  91. if (__exception) {
  92. return __exception;
  93. } else if (( (__in1 == 0) || (__in2 == 0) || (__out1 == 0) || (__out2 == 0) )) {
  94. __exception = GENLIB_ERR_NULL_BUFFER;
  95. return __exception;
  96. };
  97. t_sample rsub_999 = (1 - m_bandwidth_22);
  98. t_sample expr_1051 = safepow(0.001, safediv(1, (m_revtime_19 * 44100)));
  99. t_sample expr_1052 = safediv((m_roomsize_20 * 44100), 340);
  100. t_sample mul_988 = (expr_1052 * 0.63245);
  101. t_sample expr_1043 = (-safepow(expr_1051, mul_988));
  102. t_sample mul_990 = (expr_1052 * 0.81649);
  103. t_sample expr_1045 = (-safepow(expr_1051, mul_990));
  104. t_sample mul_989 = (expr_1052 * 0.7071);
  105. t_sample expr_1044 = (-safepow(expr_1051, mul_989));
  106. t_sample mul_991 = (expr_1052 * 1);
  107. t_sample expr_1050 = (-safepow(expr_1051, mul_991));
  108. t_sample mul_985 = (expr_1052 * 0.000527);
  109. int int_984 = int(mul_985);
  110. t_sample mul_925 = (m_spread_21 * -0.380445);
  111. t_sample add_924 = (mul_925 + 931);
  112. t_sample rsub_921 = (1341 - add_924);
  113. t_sample mul_934 = (int_984 * rsub_921);
  114. t_sample mul_953 = (m_spread_21 * 0.376623);
  115. t_sample add_952 = (mul_953 + 931);
  116. t_sample rsub_949 = (1341 - add_952);
  117. t_sample mul_960 = (int_984 * rsub_949);
  118. t_sample add_914 = (expr_1052 + 5);
  119. t_sample expr_1046 = safepow(expr_1051, add_914);
  120. t_sample mul_920 = (expr_1052 * 0.41);
  121. t_sample add_917 = (mul_920 + 5);
  122. t_sample expr_1049 = safepow(expr_1051, add_917);
  123. t_sample mul_919 = (expr_1052 * 0.3);
  124. t_sample add_916 = (mul_919 + 5);
  125. t_sample expr_1048 = safepow(expr_1051, add_916);
  126. t_sample mul_918 = (expr_1052 * 0.155);
  127. t_sample add_915 = (mul_918 + 5);
  128. t_sample expr_1047 = safepow(expr_1051, add_915);
  129. t_sample mul_927 = (m_spread_21 * -0.568366);
  130. t_sample add_923 = (mul_927 + 369);
  131. t_sample rsub_922 = (add_924 - add_923);
  132. t_sample mul_941 = (int_984 * rsub_922);
  133. t_sample mul_983 = (expr_1052 * 0.110732);
  134. t_sample mul_969 = (m_spread_21 * 0.125541);
  135. t_sample add_951 = (mul_969 + 369);
  136. t_sample rsub_950 = (add_952 - add_951);
  137. t_sample mul_967 = (int_984 * rsub_950);
  138. t_sample add_926 = (mul_927 + 159);
  139. t_sample mul_948 = (int_984 * add_926);
  140. t_sample add_968 = (mul_969 + 159);
  141. t_sample mul_976 = (int_984 * add_968);
  142. // the main sample loop;
  143. while ((__n--)) {
  144. const t_sample in1 = (*(__in1++));
  145. const t_sample in2 = (*(__in2++));
  146. t_sample mul_846 = (in2 * m_dry_24);
  147. t_sample mul_858 = (in1 * m_dry_24);
  148. t_sample mul_848 = ((in1 + in2) * 0.707);
  149. t_sample mix_1070 = (mul_848 + (rsub_999 * (m_history_5 - mul_848)));
  150. t_sample mix_998 = mix_1070;
  151. t_sample tap_888 = m_delay_17.read_linear(mul_988);
  152. t_sample mul_884 = (tap_888 * expr_1043);
  153. t_sample mix_1071 = (mul_884 + (m_damping_18 * (m_history_4 - mul_884)));
  154. t_sample mix_886 = mix_1071;
  155. t_sample tap_900 = m_delay_16.read_linear(mul_990);
  156. t_sample mul_896 = (tap_900 * expr_1045);
  157. t_sample mix_1072 = (mul_896 + (m_damping_18 * (m_history_3 - mul_896)));
  158. t_sample mix_898 = mix_1072;
  159. t_sample tap_894 = m_delay_15.read_linear(mul_989);
  160. t_sample mul_890 = (tap_894 * expr_1044);
  161. t_sample mix_1073 = (mul_890 + (m_damping_18 * (m_history_2 - mul_890)));
  162. t_sample mix_892 = mix_1073;
  163. t_sample tap_996 = m_delay_14.read_linear(mul_991);
  164. t_sample mul_987 = (tap_996 * expr_1050);
  165. t_sample mix_1074 = (mul_987 + (m_damping_18 * (m_history_1 - mul_987)));
  166. t_sample mix_994 = mix_1074;
  167. t_sample tap_933 = m_delay_13.read_linear(mul_934);
  168. t_sample mul_931 = (tap_933 * 0.625);
  169. t_sample tap_959 = m_delay_12.read_linear(mul_960);
  170. t_sample mul_957 = (tap_959 * 0.625);
  171. t_sample add_878 = (mix_994 + mix_898);
  172. t_sample add_876 = (mix_892 + mix_886);
  173. t_sample add_871 = (add_878 + add_876);
  174. t_sample mul_854 = (add_871 * 0.5);
  175. t_sample sub_875 = (add_878 - add_876);
  176. t_sample mul_857 = (sub_875 * 0.5);
  177. t_sample sub_877 = (mix_994 - mix_898);
  178. t_sample sub_874 = (mix_892 - mix_886);
  179. t_sample sub_873 = (sub_877 - sub_874);
  180. t_sample mul_856 = (sub_873 * 0.5);
  181. t_sample add_872 = (sub_877 + sub_874);
  182. t_sample rsub_870 = (0 - add_872);
  183. t_sample mul_855 = (rsub_870 * 0.5);
  184. t_sample tap_902 = m_delay_11.read_linear(add_917);
  185. t_sample tap_903 = m_delay_11.read_linear(add_916);
  186. t_sample tap_904 = m_delay_11.read_linear(add_915);
  187. t_sample tap_905 = m_delay_11.read_linear(add_914);
  188. t_sample mul_906 = (tap_905 * expr_1046);
  189. t_sample add_879 = (mul_854 + mul_906);
  190. t_sample mul_910 = (tap_903 * expr_1048);
  191. t_sample add_881 = (mul_856 + mul_910);
  192. t_sample mul_912 = (tap_902 * expr_1049);
  193. t_sample add_882 = (mul_857 + mul_912);
  194. t_sample mul_908 = (tap_904 * expr_1047);
  195. t_sample add_880 = (mul_855 + mul_908);
  196. t_sample tap_940 = m_delay_10.read_linear(mul_941);
  197. t_sample mul_938 = (tap_940 * 0.625);
  198. t_sample tap_982 = m_delay_9.read_linear(mul_983);
  199. t_sample tap_966 = m_delay_8.read_linear(mul_967);
  200. t_sample mul_964 = (tap_966 * 0.625);
  201. t_sample tap_947 = m_delay_7.read_linear(mul_948);
  202. t_sample mul_945 = (tap_947 * 0.75);
  203. t_sample mul_980 = (tap_982 * 0.75);
  204. t_sample sub_979 = (mix_998 - mul_980);
  205. t_sample mul_978 = (sub_979 * 0.75);
  206. t_sample add_977 = (mul_978 + tap_982);
  207. t_sample tap_975 = m_delay_6.read_linear(mul_976);
  208. t_sample mul_973 = (tap_975 * 0.75);
  209. t_sample mul_869 = (mul_857 * m_tail_23);
  210. t_sample mul_867 = (mul_855 * m_tail_23);
  211. t_sample add_853 = (mul_869 + mul_867);
  212. t_sample mul_868 = (mul_856 * m_tail_23);
  213. t_sample mul_866 = (mul_854 * m_tail_23);
  214. t_sample add_852 = (mul_868 + mul_866);
  215. t_sample sub_861 = (add_853 - add_852);
  216. t_sample mul_865 = (mul_912 * m_early_25);
  217. t_sample mul_863 = (mul_908 * m_early_25);
  218. t_sample add_851 = (mul_865 + mul_863);
  219. t_sample mul_864 = (mul_910 * m_early_25);
  220. t_sample mul_862 = (mul_906 * m_early_25);
  221. t_sample add_850 = (mul_864 + mul_862);
  222. t_sample sub_860 = (add_851 - add_850);
  223. t_sample add_847 = (sub_861 + sub_860);
  224. t_sample add_849 = (add_847 + in2);
  225. t_sample sub_944 = (add_849 - mul_945);
  226. t_sample mul_943 = (sub_944 * 0.75);
  227. t_sample add_942 = (mul_943 + tap_947);
  228. t_sample sub_937 = (add_942 - mul_938);
  229. t_sample mul_936 = (sub_937 * 0.625);
  230. t_sample add_935 = (mul_936 + tap_940);
  231. t_sample sub_930 = (add_935 - mul_931);
  232. t_sample mul_929 = (sub_930 * 0.625);
  233. t_sample add_928 = (mul_929 + tap_933);
  234. t_sample out2 = (mul_846 + add_928);
  235. t_sample add_859 = (add_847 + in1);
  236. t_sample sub_972 = (add_859 - mul_973);
  237. t_sample mul_971 = (sub_972 * 0.75);
  238. t_sample add_970 = (mul_971 + tap_975);
  239. t_sample sub_963 = (add_970 - mul_964);
  240. t_sample mul_962 = (sub_963 * 0.625);
  241. t_sample add_961 = (mul_962 + tap_966);
  242. t_sample sub_956 = (add_961 - mul_957);
  243. t_sample mul_955 = (sub_956 * 0.625);
  244. t_sample add_954 = (mul_955 + tap_959);
  245. t_sample out1 = (mul_858 + add_954);
  246. t_sample history_997_next_1065 = mix_998;
  247. t_sample history_885_next_1066 = mix_886;
  248. t_sample history_897_next_1067 = mix_898;
  249. t_sample history_891_next_1068 = mix_892;
  250. t_sample history_993_next_1069 = mix_994;
  251. m_delay_17.write(add_879);
  252. m_delay_16.write(add_881);
  253. m_delay_15.write(add_880);
  254. m_delay_14.write(add_882);
  255. m_delay_13.write(sub_930);
  256. m_delay_12.write(sub_956);
  257. m_delay_11.write(add_977);
  258. m_delay_10.write(sub_937);
  259. m_delay_9.write(sub_979);
  260. m_delay_8.write(sub_963);
  261. m_delay_7.write(sub_944);
  262. m_delay_6.write(sub_972);
  263. m_history_5 = history_997_next_1065;
  264. m_history_4 = history_885_next_1066;
  265. m_history_3 = history_897_next_1067;
  266. m_history_2 = history_891_next_1068;
  267. m_history_1 = history_993_next_1069;
  268. m_delay_6.step();
  269. m_delay_7.step();
  270. m_delay_8.step();
  271. m_delay_9.step();
  272. m_delay_10.step();
  273. m_delay_11.step();
  274. m_delay_12.step();
  275. m_delay_13.step();
  276. m_delay_14.step();
  277. m_delay_15.step();
  278. m_delay_16.step();
  279. m_delay_17.step();
  280. // assign results to output buffer;
  281. (*(__out1++)) = out1;
  282. (*(__out2++)) = out2;
  283. };
  284. return __exception;
  285. };
  286. inline void set_damping(t_sample _value) {
  287. m_damping_18 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  288. };
  289. inline void set_revtime(t_sample _value) {
  290. m_revtime_19 = (_value < 0.1 ? 0.1 : (_value > 360 ? 360 : _value));
  291. };
  292. inline void set_roomsize(t_sample _value) {
  293. m_roomsize_20 = (_value < 0.1 ? 0.1 : (_value > 300 ? 300 : _value));
  294. };
  295. inline void set_spread(t_sample _value) {
  296. m_spread_21 = (_value < 0 ? 0 : (_value > 100 ? 100 : _value));
  297. };
  298. inline void set_bandwidth(t_sample _value) {
  299. m_bandwidth_22 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  300. };
  301. inline void set_tail(t_sample _value) {
  302. m_tail_23 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  303. };
  304. inline void set_dry(t_sample _value) {
  305. m_dry_24 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  306. };
  307. inline void set_early(t_sample _value) {
  308. m_early_25 = (_value < 0 ? 0 : (_value > 1 ? 1 : _value));
  309. };
  310. } State;
  311. ///
  312. /// Configuration for the genlib API
  313. ///
  314. /// Number of signal inputs and outputs
  315. const int gen_kernel_numins = 2;
  316. const int gen_kernel_numouts = 2;
  317. int num_inputs() { return gen_kernel_numins; }
  318. int num_outputs() { return gen_kernel_numouts; }
  319. int num_params() { return 8; }
  320. /// Assistive lables for the signal inputs and outputs
  321. const char * gen_kernel_innames[] = { "in1", "in2" };
  322. const char * gen_kernel_outnames[] = { "out1", "out2" };
  323. /// Invoke the signal process of a State object
  324. int perform(CommonState *cself, t_sample **ins, long numins, t_sample **outs, long numouts, long n) {
  325. State * self = (State *)cself;
  326. return self->perform(ins, outs, n);
  327. }
  328. /// Reset all parameters and stateful operators of a State object
  329. void reset(CommonState *cself) {
  330. State * self = (State *)cself;
  331. self->reset(cself->sr, cself->vs);
  332. }
  333. /// Set a parameter of a State object
  334. void setparameter(CommonState *cself, long index, t_param value, void *ref) {
  335. State * self = (State *)cself;
  336. switch (index) {
  337. case 0: self->set_damping(value); break;
  338. case 1: self->set_revtime(value); break;
  339. case 2: self->set_roomsize(value); break;
  340. case 3: self->set_spread(value); break;
  341. case 4: self->set_bandwidth(value); break;
  342. case 5: self->set_tail(value); break;
  343. case 6: self->set_dry(value); break;
  344. case 7: self->set_early(value); break;
  345. default: break;
  346. }
  347. }
  348. /// Get the value of a parameter of a State object
  349. void getparameter(CommonState *cself, long index, t_param *value) {
  350. State *self = (State *)cself;
  351. switch (index) {
  352. case 0: *value = self->m_damping_18; break;
  353. case 1: *value = self->m_revtime_19; break;
  354. case 2: *value = self->m_roomsize_20; break;
  355. case 3: *value = self->m_spread_21; break;
  356. case 4: *value = self->m_bandwidth_22; break;
  357. case 5: *value = self->m_tail_23; break;
  358. case 6: *value = self->m_dry_24; break;
  359. case 7: *value = self->m_early_25; break;
  360. default: break;
  361. }
  362. }
  363. /// Allocate and configure a new State object and it's internal CommonState:
  364. void * create(t_param sr, long vs) {
  365. State *self = new State;
  366. self->reset(sr, vs);
  367. ParamInfo *pi;
  368. self->__commonstate.inputnames = gen_kernel_innames;
  369. self->__commonstate.outputnames = gen_kernel_outnames;
  370. self->__commonstate.numins = gen_kernel_numins;
  371. self->__commonstate.numouts = gen_kernel_numouts;
  372. self->__commonstate.sr = sr;
  373. self->__commonstate.vs = vs;
  374. self->__commonstate.params = (ParamInfo *)genlib_sysmem_newptr(8 * sizeof(ParamInfo));
  375. self->__commonstate.numparams = 8;
  376. // initialize parameter 0 ("m_damping_18")
  377. pi = self->__commonstate.params + 0;
  378. pi->name = "damping";
  379. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  380. pi->defaultvalue = self->m_damping_18;
  381. pi->defaultref = 0;
  382. pi->hasinputminmax = false;
  383. pi->inputmin = 0;
  384. pi->inputmax = 1;
  385. pi->hasminmax = true;
  386. pi->outputmin = 0;
  387. pi->outputmax = 1;
  388. pi->exp = 0;
  389. pi->units = ""; // no units defined
  390. // initialize parameter 1 ("m_revtime_19")
  391. pi = self->__commonstate.params + 1;
  392. pi->name = "revtime";
  393. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  394. pi->defaultvalue = self->m_revtime_19;
  395. pi->defaultref = 0;
  396. pi->hasinputminmax = false;
  397. pi->inputmin = 0;
  398. pi->inputmax = 1;
  399. pi->hasminmax = true;
  400. pi->outputmin = 0.1;
  401. pi->outputmax = 360;
  402. pi->exp = 0;
  403. pi->units = ""; // no units defined
  404. // initialize parameter 2 ("m_roomsize_20")
  405. pi = self->__commonstate.params + 2;
  406. pi->name = "roomsize";
  407. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  408. pi->defaultvalue = self->m_roomsize_20;
  409. pi->defaultref = 0;
  410. pi->hasinputminmax = false;
  411. pi->inputmin = 0;
  412. pi->inputmax = 1;
  413. pi->hasminmax = true;
  414. pi->outputmin = 0.1;
  415. pi->outputmax = 300;
  416. pi->exp = 0;
  417. pi->units = ""; // no units defined
  418. // initialize parameter 3 ("m_spread_21")
  419. pi = self->__commonstate.params + 3;
  420. pi->name = "spread";
  421. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  422. pi->defaultvalue = self->m_spread_21;
  423. pi->defaultref = 0;
  424. pi->hasinputminmax = false;
  425. pi->inputmin = 0;
  426. pi->inputmax = 1;
  427. pi->hasminmax = true;
  428. pi->outputmin = 0;
  429. pi->outputmax = 100;
  430. pi->exp = 0;
  431. pi->units = ""; // no units defined
  432. // initialize parameter 4 ("m_bandwidth_22")
  433. pi = self->__commonstate.params + 4;
  434. pi->name = "bandwidth";
  435. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  436. pi->defaultvalue = self->m_bandwidth_22;
  437. pi->defaultref = 0;
  438. pi->hasinputminmax = false;
  439. pi->inputmin = 0;
  440. pi->inputmax = 1;
  441. pi->hasminmax = true;
  442. pi->outputmin = 0;
  443. pi->outputmax = 1;
  444. pi->exp = 0;
  445. pi->units = ""; // no units defined
  446. // initialize parameter 5 ("m_tail_23")
  447. pi = self->__commonstate.params + 5;
  448. pi->name = "tail";
  449. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  450. pi->defaultvalue = self->m_tail_23;
  451. pi->defaultref = 0;
  452. pi->hasinputminmax = false;
  453. pi->inputmin = 0;
  454. pi->inputmax = 1;
  455. pi->hasminmax = true;
  456. pi->outputmin = 0;
  457. pi->outputmax = 1;
  458. pi->exp = 0;
  459. pi->units = ""; // no units defined
  460. // initialize parameter 6 ("m_dry_24")
  461. pi = self->__commonstate.params + 6;
  462. pi->name = "dry";
  463. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  464. pi->defaultvalue = self->m_dry_24;
  465. pi->defaultref = 0;
  466. pi->hasinputminmax = false;
  467. pi->inputmin = 0;
  468. pi->inputmax = 1;
  469. pi->hasminmax = true;
  470. pi->outputmin = 0;
  471. pi->outputmax = 1;
  472. pi->exp = 0;
  473. pi->units = ""; // no units defined
  474. // initialize parameter 7 ("m_early_25")
  475. pi = self->__commonstate.params + 7;
  476. pi->name = "early";
  477. pi->paramtype = GENLIB_PARAMTYPE_FLOAT;
  478. pi->defaultvalue = self->m_early_25;
  479. pi->defaultref = 0;
  480. pi->hasinputminmax = false;
  481. pi->inputmin = 0;
  482. pi->inputmax = 1;
  483. pi->hasminmax = true;
  484. pi->outputmin = 0;
  485. pi->outputmax = 1;
  486. pi->exp = 0;
  487. pi->units = ""; // no units defined
  488. return self;
  489. }
  490. /// Release all resources and memory used by a State object:
  491. void destroy(CommonState *cself) {
  492. State * self = (State *)cself;
  493. genlib_sysmem_freeptr(cself->params);
  494. delete self;
  495. }
  496. } // gen_exported::