// ----
// ---- file   : osc_additive16phase_v1.cpp
// ---- author : bsp
// ---- legal  : Distributed under terms of the MIT license (https://opensource.org/licenses/MIT)
// ----
// ----          Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// ----          associated documentation files (the "Software"), to deal in the Software without restriction, including
// ----          without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// ----          copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
// ----          the following conditions:
// ----
// ----          The above copyright notice and this permission notice shall be included in all copies or substantial
// ----          portions of the Software.
// ----
// ----          THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
// ----          NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// ----          IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// ----          WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// ----          SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ----
// ---- info   : auto-generated by "Cycle"
// ----           $ g++ -Wall -Wno-unused-function -Wno-unused-variable -I../../tksampler -c osc_additive16phase_v1.cpp -o osc_additive16phase_v1.o
// ---- created: 07Jan2024 12:46:27
// ----
// ----
// ----

#include <plugin.h>

#include <stdlib.h>
#include <math.h>
#include <string.h>




#define PARAM_MAG                0
#define PARAM_CENTER             1
#define PARAM_DAMPEN             2
#define PARAM_AMP                3
#define PARAM_DETUNE             4
#define PARAM_PHASE              5
#define PARAM_DET_AMT            6
#define PARAM_VSYNC              7
#define NUM_PARAMS               8
static const char *loc_param_names[NUM_PARAMS] = {
   "mag",                     // 0: MAG
   "center",                  // 1: CENTER
   "dampen",                  // 2: DAMPEN
   "amp",                     // 3: AMP
   "detune",                  // 4: DETUNE
   "phase",                   // 5: PHASE
   "det_amt",                 // 6: DET_AMT
   "vsync",                   // 7: VSYNC

};
static float loc_param_resets[NUM_PARAMS] = {
   0.0f,                      // 0: MAG
   0.0f,                      // 1: CENTER
   0.0f,                      // 2: DAMPEN
   0.5f,                      // 3: AMP
   0.0f,                      // 4: DETUNE
   0.0f,                      // 5: PHASE
   1.0f,                      // 6: DET_AMT
   0.0f,                      // 7: VSYNC

};

#define MOD_MAG                  0
#define MOD_CENTER               1
#define MOD_DAMPEN               2
#define MOD_AMP                  3
#define MOD_DETUNE               4
#define MOD_PHASE                5
#define MOD_DET_AMT              6
#define MOD_VSYNC                7
#define NUM_MODS                 8
static const char *loc_mod_names[NUM_MODS] = {
   "mag",                  // 0: MAG
   "center",               // 1: CENTER
   "dampen",               // 2: DAMPEN
   "amp",                  // 3: AMP
   "detune",               // 4: DETUNE
   "phase",                // 5: PHASE
   "det_amt",              // 6: DET_AMT
   "vsync",                // 7: VSYNC

};

typedef struct osc_additive16phase_v1_info_s {
   st_plugin_info_t base;
} osc_additive16phase_v1_info_t;

typedef struct osc_additive16phase_v1_shared_s {
   st_plugin_shared_t base;
   float params[NUM_PARAMS];
   float array_p_mag[8/*var*/][16/*size*/];
   int forced_varidx_p_mag;
   float array_p_detune[8/*var*/][16/*size*/];
   int forced_varidx_p_detune;
   float array_p_phase[8/*var*/][16/*size*/];
   int forced_varidx_p_phase;
   float array_p_vsync[8/*var*/][16/*size*/];
   int forced_varidx_p_vsync;

} osc_additive16phase_v1_shared_t;

typedef struct osc_additive16phase_v1_voice_s {
   st_plugin_voice_t base;
   float             sample_rate;
   float             note_speed_fixed;
   float             note_speed_cur;
   float             note_speed_inc;
   float             note_cur;
   float             note_inc;
   float             mods[NUM_MODS];
   float mod_mag_cur;
   float mod_mag_inc;
   float mod_center_cur;
   float mod_center_inc;
   float mod_dampen_cur;
   float mod_dampen_inc;
   float mod_amp_cur;
   float mod_amp_inc;
   float mod_detune_cur;
   float mod_detune_inc;
   float mod_phase_cur;
   float mod_phase_inc;
   float mod_det_amt_cur;
   float mod_det_amt_inc;
   float mod_vsync_cur;
   float mod_vsync_inc;

   float tmp1_delta;
   float tmp2_seq;
   float tmp3_sin_phase;
   float tmp4_sin_speed;
   float tmp5_freq;
   float tmp6_lut_f;
   short tmp7_lut_idx_a;
   short tmp8_lut_idx_b;
   float tmp9_lut_frac;
   float tmp10_lut_a;
   float tmp11_lut_b;
   float tmp12_seq;
   float tmp13_seq;
   float tmp14_seq;
   float tmp15_sin_tmp;
   float tmp16_phase;
   float tmp17_lut_f;
   short tmp18_lut_idx_a;
   short tmp19_lut_idx_b;
   float tmp20_lut_frac;
   float tmp21_lut_a;
   float tmp22_lut_b;
   float tmp23_vsync;
   float tmp24_lut_f;
   short tmp25_lut_idx_a;
   short tmp26_lut_idx_b;
   float tmp27_lut_frac;
   float tmp28_lut_a;
   float tmp29_lut_b;
   float tmp30_seq;
   float tmp31_seq;
   float tmp32_seq;
   float tmp33_lut_f;
   short tmp34_lut_idx_a;
   short tmp35_lut_idx_b;
   float tmp36_lut_frac;
   float tmp37_lut_a;
   float tmp38_lut_b;
   float tmp39_seq;
   float tmp40_seq;
   float tmp41_sin_phase;
   float tmp42_sin_speed;
   float tmp43_freq;
   float tmp44_lut_f;
   short tmp45_lut_idx_a;
   short tmp46_lut_idx_b;
   float tmp47_lut_frac;
   float tmp48_lut_a;
   float tmp49_lut_b;
   float tmp50_seq;
   float tmp51_seq;
   float tmp52_seq;
   float tmp53_sin_tmp;
   float tmp54_phase;
   float tmp55_lut_f;
   short tmp56_lut_idx_a;
   short tmp57_lut_idx_b;
   float tmp58_lut_frac;
   float tmp59_lut_a;
   float tmp60_lut_b;
   float tmp61_vsync;
   float tmp62_lut_f;
   short tmp63_lut_idx_a;
   short tmp64_lut_idx_b;
   float tmp65_lut_frac;
   float tmp66_lut_a;
   float tmp67_lut_b;
   float tmp68_seq;
   float tmp69_seq;
   float tmp70_seq;
   float tmp71_lut_f;
   short tmp72_lut_idx_a;
   short tmp73_lut_idx_b;
   float tmp74_lut_frac;
   float tmp75_lut_a;
   float tmp76_lut_b;
   float tmp77_seq;
   float tmp78_seq;
   float tmp79_sin_phase;
   float tmp80_sin_speed;
   float tmp81_freq;
   float tmp82_lut_f;
   short tmp83_lut_idx_a;
   short tmp84_lut_idx_b;
   float tmp85_lut_frac;
   float tmp86_lut_a;
   float tmp87_lut_b;
   float tmp88_seq;
   float tmp89_seq;
   float tmp90_seq;
   float tmp91_sin_tmp;
   float tmp92_phase;
   float tmp93_lut_f;
   short tmp94_lut_idx_a;
   short tmp95_lut_idx_b;
   float tmp96_lut_frac;
   float tmp97_lut_a;
   float tmp98_lut_b;
   float tmp99_vsync;
   float tmp100_lut_f;
   short tmp101_lut_idx_a;
   short tmp102_lut_idx_b;
   float tmp103_lut_frac;
   float tmp104_lut_a;
   float tmp105_lut_b;
   float tmp106_seq;
   float tmp107_seq;
   float tmp108_seq;
   float tmp109_lut_f;
   short tmp110_lut_idx_a;
   short tmp111_lut_idx_b;
   float tmp112_lut_frac;
   float tmp113_lut_a;
   float tmp114_lut_b;
   float tmp115_seq;
   float tmp116_seq;
   float tmp117_sin_phase;
   float tmp118_sin_speed;
   float tmp119_freq;
   float tmp120_lut_f;
   short tmp121_lut_idx_a;
   short tmp122_lut_idx_b;
   float tmp123_lut_frac;
   float tmp124_lut_a;
   float tmp125_lut_b;
   float tmp126_seq;
   float tmp127_seq;
   float tmp128_seq;
   float tmp129_sin_tmp;
   float tmp130_phase;
   float tmp131_lut_f;
   short tmp132_lut_idx_a;
   short tmp133_lut_idx_b;
   float tmp134_lut_frac;
   float tmp135_lut_a;
   float tmp136_lut_b;
   float tmp137_vsync;
   float tmp138_lut_f;
   short tmp139_lut_idx_a;
   short tmp140_lut_idx_b;
   float tmp141_lut_frac;
   float tmp142_lut_a;
   float tmp143_lut_b;
   float tmp144_seq;
   float tmp145_seq;
   float tmp146_seq;
   float tmp147_lut_f;
   short tmp148_lut_idx_a;
   short tmp149_lut_idx_b;
   float tmp150_lut_frac;
   float tmp151_lut_a;
   float tmp152_lut_b;
   float tmp153_seq;
   float tmp154_seq;
   float tmp155_sin_phase;
   float tmp156_sin_speed;
   float tmp157_freq;
   float tmp158_lut_f;
   short tmp159_lut_idx_a;
   short tmp160_lut_idx_b;
   float tmp161_lut_frac;
   float tmp162_lut_a;
   float tmp163_lut_b;
   float tmp164_seq;
   float tmp165_seq;
   float tmp166_seq;
   float tmp167_sin_tmp;
   float tmp168_phase;
   float tmp169_lut_f;
   short tmp170_lut_idx_a;
   short tmp171_lut_idx_b;
   float tmp172_lut_frac;
   float tmp173_lut_a;
   float tmp174_lut_b;
   float tmp175_vsync;
   float tmp176_lut_f;
   short tmp177_lut_idx_a;
   short tmp178_lut_idx_b;
   float tmp179_lut_frac;
   float tmp180_lut_a;
   float tmp181_lut_b;
   float tmp182_seq;
   float tmp183_seq;
   float tmp184_seq;
   float tmp185_lut_f;
   short tmp186_lut_idx_a;
   short tmp187_lut_idx_b;
   float tmp188_lut_frac;
   float tmp189_lut_a;
   float tmp190_lut_b;
   float tmp191_seq;
   float tmp192_seq;
   float tmp193_sin_phase;
   float tmp194_sin_speed;
   float tmp195_freq;
   float tmp196_lut_f;
   short tmp197_lut_idx_a;
   short tmp198_lut_idx_b;
   float tmp199_lut_frac;
   float tmp200_lut_a;
   float tmp201_lut_b;
   float tmp202_seq;
   float tmp203_seq;
   float tmp204_seq;
   float tmp205_sin_tmp;
   float tmp206_phase;
   float tmp207_lut_f;
   short tmp208_lut_idx_a;
   short tmp209_lut_idx_b;
   float tmp210_lut_frac;
   float tmp211_lut_a;
   float tmp212_lut_b;
   float tmp213_vsync;
   float tmp214_lut_f;
   short tmp215_lut_idx_a;
   short tmp216_lut_idx_b;
   float tmp217_lut_frac;
   float tmp218_lut_a;
   float tmp219_lut_b;
   float tmp220_seq;
   float tmp221_seq;
   float tmp222_seq;
   float tmp223_lut_f;
   short tmp224_lut_idx_a;
   short tmp225_lut_idx_b;
   float tmp226_lut_frac;
   float tmp227_lut_a;
   float tmp228_lut_b;
   float tmp229_seq;
   float tmp230_seq;
   float tmp231_sin_phase;
   float tmp232_sin_speed;
   float tmp233_freq;
   float tmp234_lut_f;
   short tmp235_lut_idx_a;
   short tmp236_lut_idx_b;
   float tmp237_lut_frac;
   float tmp238_lut_a;
   float tmp239_lut_b;
   float tmp240_seq;
   float tmp241_seq;
   float tmp242_seq;
   float tmp243_sin_tmp;
   float tmp244_phase;
   float tmp245_lut_f;
   short tmp246_lut_idx_a;
   short tmp247_lut_idx_b;
   float tmp248_lut_frac;
   float tmp249_lut_a;
   float tmp250_lut_b;
   float tmp251_vsync;
   float tmp252_lut_f;
   short tmp253_lut_idx_a;
   short tmp254_lut_idx_b;
   float tmp255_lut_frac;
   float tmp256_lut_a;
   float tmp257_lut_b;
   float tmp258_seq;
   float tmp259_seq;
   float tmp260_seq;
   float tmp261_lut_f;
   short tmp262_lut_idx_a;
   short tmp263_lut_idx_b;
   float tmp264_lut_frac;
   float tmp265_lut_a;
   float tmp266_lut_b;
   float tmp267_seq;
   float tmp268_seq;
   float tmp269_sin_phase;
   float tmp270_sin_speed;
   float tmp271_freq;
   float tmp272_lut_f;
   short tmp273_lut_idx_a;
   short tmp274_lut_idx_b;
   float tmp275_lut_frac;
   float tmp276_lut_a;
   float tmp277_lut_b;
   float tmp278_seq;
   float tmp279_seq;
   float tmp280_seq;
   float tmp281_sin_tmp;
   float tmp282_phase;
   float tmp283_lut_f;
   short tmp284_lut_idx_a;
   short tmp285_lut_idx_b;
   float tmp286_lut_frac;
   float tmp287_lut_a;
   float tmp288_lut_b;
   float tmp289_vsync;
   float tmp290_lut_f;
   short tmp291_lut_idx_a;
   short tmp292_lut_idx_b;
   float tmp293_lut_frac;
   float tmp294_lut_a;
   float tmp295_lut_b;
   float tmp296_seq;
   float tmp297_seq;
   float tmp298_seq;
   float tmp299_lut_f;
   short tmp300_lut_idx_a;
   short tmp301_lut_idx_b;
   float tmp302_lut_frac;
   float tmp303_lut_a;
   float tmp304_lut_b;
   float tmp305_seq;
   float tmp306_seq;
   float tmp307_sin_phase;
   float tmp308_sin_speed;
   float tmp309_freq;
   float tmp310_lut_f;
   short tmp311_lut_idx_a;
   short tmp312_lut_idx_b;
   float tmp313_lut_frac;
   float tmp314_lut_a;
   float tmp315_lut_b;
   float tmp316_seq;
   float tmp317_seq;
   float tmp318_seq;
   float tmp319_sin_tmp;
   float tmp320_phase;
   float tmp321_lut_f;
   short tmp322_lut_idx_a;
   short tmp323_lut_idx_b;
   float tmp324_lut_frac;
   float tmp325_lut_a;
   float tmp326_lut_b;
   float tmp327_vsync;
   float tmp328_lut_f;
   short tmp329_lut_idx_a;
   short tmp330_lut_idx_b;
   float tmp331_lut_frac;
   float tmp332_lut_a;
   float tmp333_lut_b;
   float tmp334_seq;
   float tmp335_seq;
   float tmp336_seq;
   float tmp337_lut_f;
   short tmp338_lut_idx_a;
   short tmp339_lut_idx_b;
   float tmp340_lut_frac;
   float tmp341_lut_a;
   float tmp342_lut_b;
   float tmp343_seq;
   float tmp344_seq;
   float tmp345_sin_phase;
   float tmp346_sin_speed;
   float tmp347_freq;
   float tmp348_lut_f;
   short tmp349_lut_idx_a;
   short tmp350_lut_idx_b;
   float tmp351_lut_frac;
   float tmp352_lut_a;
   float tmp353_lut_b;
   float tmp354_seq;
   float tmp355_seq;
   float tmp356_seq;
   float tmp357_sin_tmp;
   float tmp358_phase;
   float tmp359_lut_f;
   short tmp360_lut_idx_a;
   short tmp361_lut_idx_b;
   float tmp362_lut_frac;
   float tmp363_lut_a;
   float tmp364_lut_b;
   float tmp365_vsync;
   float tmp366_lut_f;
   short tmp367_lut_idx_a;
   short tmp368_lut_idx_b;
   float tmp369_lut_frac;
   float tmp370_lut_a;
   float tmp371_lut_b;
   float tmp372_seq;
   float tmp373_seq;
   float tmp374_seq;
   float tmp375_lut_f;
   short tmp376_lut_idx_a;
   short tmp377_lut_idx_b;
   float tmp378_lut_frac;
   float tmp379_lut_a;
   float tmp380_lut_b;
   float tmp381_seq;
   float tmp382_seq;
   float tmp383_sin_phase;
   float tmp384_sin_speed;
   float tmp385_freq;
   float tmp386_lut_f;
   short tmp387_lut_idx_a;
   short tmp388_lut_idx_b;
   float tmp389_lut_frac;
   float tmp390_lut_a;
   float tmp391_lut_b;
   float tmp392_seq;
   float tmp393_seq;
   float tmp394_seq;
   float tmp395_sin_tmp;
   float tmp396_phase;
   float tmp397_lut_f;
   short tmp398_lut_idx_a;
   short tmp399_lut_idx_b;
   float tmp400_lut_frac;
   float tmp401_lut_a;
   float tmp402_lut_b;
   float tmp403_vsync;
   float tmp404_lut_f;
   short tmp405_lut_idx_a;
   short tmp406_lut_idx_b;
   float tmp407_lut_frac;
   float tmp408_lut_a;
   float tmp409_lut_b;
   float tmp410_seq;
   float tmp411_seq;
   float tmp412_seq;
   float tmp413_lut_f;
   short tmp414_lut_idx_a;
   short tmp415_lut_idx_b;
   float tmp416_lut_frac;
   float tmp417_lut_a;
   float tmp418_lut_b;
   float tmp419_seq;
   float tmp420_seq;
   float tmp421_sin_phase;
   float tmp422_sin_speed;
   float tmp423_freq;
   float tmp424_lut_f;
   short tmp425_lut_idx_a;
   short tmp426_lut_idx_b;
   float tmp427_lut_frac;
   float tmp428_lut_a;
   float tmp429_lut_b;
   float tmp430_seq;
   float tmp431_seq;
   float tmp432_seq;
   float tmp433_sin_tmp;
   float tmp434_phase;
   float tmp435_lut_f;
   short tmp436_lut_idx_a;
   short tmp437_lut_idx_b;
   float tmp438_lut_frac;
   float tmp439_lut_a;
   float tmp440_lut_b;
   float tmp441_vsync;
   float tmp442_lut_f;
   short tmp443_lut_idx_a;
   short tmp444_lut_idx_b;
   float tmp445_lut_frac;
   float tmp446_lut_a;
   float tmp447_lut_b;
   float tmp448_seq;
   float tmp449_seq;
   float tmp450_seq;
   float tmp451_lut_f;
   short tmp452_lut_idx_a;
   short tmp453_lut_idx_b;
   float tmp454_lut_frac;
   float tmp455_lut_a;
   float tmp456_lut_b;
   float tmp457_seq;
   float tmp458_seq;
   float tmp459_sin_phase;
   float tmp460_sin_speed;
   float tmp461_freq;
   float tmp462_lut_f;
   short tmp463_lut_idx_a;
   short tmp464_lut_idx_b;
   float tmp465_lut_frac;
   float tmp466_lut_a;
   float tmp467_lut_b;
   float tmp468_seq;
   float tmp469_seq;
   float tmp470_seq;
   float tmp471_sin_tmp;
   float tmp472_phase;
   float tmp473_lut_f;
   short tmp474_lut_idx_a;
   short tmp475_lut_idx_b;
   float tmp476_lut_frac;
   float tmp477_lut_a;
   float tmp478_lut_b;
   float tmp479_vsync;
   float tmp480_lut_f;
   short tmp481_lut_idx_a;
   short tmp482_lut_idx_b;
   float tmp483_lut_frac;
   float tmp484_lut_a;
   float tmp485_lut_b;
   float tmp486_seq;
   float tmp487_seq;
   float tmp488_seq;
   float tmp489_lut_f;
   short tmp490_lut_idx_a;
   short tmp491_lut_idx_b;
   float tmp492_lut_frac;
   float tmp493_lut_a;
   float tmp494_lut_b;
   float tmp495_seq;
   float tmp496_seq;
   float tmp497_sin_phase;
   float tmp498_sin_speed;
   float tmp499_freq;
   float tmp500_lut_f;
   short tmp501_lut_idx_a;
   short tmp502_lut_idx_b;
   float tmp503_lut_frac;
   float tmp504_lut_a;
   float tmp505_lut_b;
   float tmp506_seq;
   float tmp507_seq;
   float tmp508_seq;
   float tmp509_sin_tmp;
   float tmp510_phase;
   float tmp511_lut_f;
   short tmp512_lut_idx_a;
   short tmp513_lut_idx_b;
   float tmp514_lut_frac;
   float tmp515_lut_a;
   float tmp516_lut_b;
   float tmp517_vsync;
   float tmp518_lut_f;
   short tmp519_lut_idx_a;
   short tmp520_lut_idx_b;
   float tmp521_lut_frac;
   float tmp522_lut_a;
   float tmp523_lut_b;
   float tmp524_seq;
   float tmp525_seq;
   float tmp526_seq;
   float tmp527_lut_f;
   short tmp528_lut_idx_a;
   short tmp529_lut_idx_b;
   float tmp530_lut_frac;
   float tmp531_lut_a;
   float tmp532_lut_b;
   float tmp533_seq;
   float tmp534_seq;
   float tmp535_sin_phase;
   float tmp536_sin_speed;
   float tmp537_freq;
   float tmp538_lut_f;
   short tmp539_lut_idx_a;
   short tmp540_lut_idx_b;
   float tmp541_lut_frac;
   float tmp542_lut_a;
   float tmp543_lut_b;
   float tmp544_seq;
   float tmp545_seq;
   float tmp546_seq;
   float tmp547_sin_tmp;
   float tmp548_phase;
   float tmp549_lut_f;
   short tmp550_lut_idx_a;
   short tmp551_lut_idx_b;
   float tmp552_lut_frac;
   float tmp553_lut_a;
   float tmp554_lut_b;
   float tmp555_vsync;
   float tmp556_lut_f;
   short tmp557_lut_idx_a;
   short tmp558_lut_idx_b;
   float tmp559_lut_frac;
   float tmp560_lut_a;
   float tmp561_lut_b;
   float tmp562_seq;
   float tmp563_seq;
   float tmp564_seq;
   float tmp565_lut_f;
   short tmp566_lut_idx_a;
   short tmp567_lut_idx_b;
   float tmp568_lut_frac;
   float tmp569_lut_a;
   float tmp570_lut_b;
   float tmp571_seq;
   float tmp572_seq;
   float tmp573_sin_phase;
   float tmp574_sin_speed;
   float tmp575_freq;
   float tmp576_lut_f;
   short tmp577_lut_idx_a;
   short tmp578_lut_idx_b;
   float tmp579_lut_frac;
   float tmp580_lut_a;
   float tmp581_lut_b;
   float tmp582_seq;
   float tmp583_seq;
   float tmp584_seq;
   float tmp585_sin_tmp;
   float tmp586_phase;
   float tmp587_lut_f;
   short tmp588_lut_idx_a;
   short tmp589_lut_idx_b;
   float tmp590_lut_frac;
   float tmp591_lut_a;
   float tmp592_lut_b;
   float tmp593_vsync;
   float tmp594_lut_f;
   short tmp595_lut_idx_a;
   short tmp596_lut_idx_b;
   float tmp597_lut_frac;
   float tmp598_lut_a;
   float tmp599_lut_b;
   float tmp600_seq;
   float tmp601_seq;
   float tmp602_seq;
   float tmp603_lut_f;
   short tmp604_lut_idx_a;
   short tmp605_lut_idx_b;
   float tmp606_lut_frac;
   float tmp607_lut_a;
   float tmp608_lut_b;
   float tmp609_seq;
   float tmp610_seq;
   float var_x;
   float var_v_center;
   float var_v_dampen;
   float var_v_freq_add;
   float var_v_level;
   float var_v_freq;
   float var_v_det_amt;
   float var_v_index;
   float var_v_out;
   float var_v_amp;
   float var_v_vsync;
   float eff_array_p_mag[16/*size*/];
   float last_varidx_p_mag;
   float eff_array_p_detune[16/*size*/];
   float last_varidx_p_detune;
   float eff_array_p_phase[16/*size*/];
   float last_varidx_p_phase;
   float eff_array_p_vsync[16/*size*/];
   float last_varidx_p_vsync;

} osc_additive16phase_v1_voice_t;

#define loop(X)  for(unsigned int i = 0u; i < (X); i++)
#define clamp(a,b,c) (((a)<(b))?(b):(((a)>(c))?(c):(a)))

static inline float mathLerpf(float _a, float _b, float _t) { return _a + (_b - _a) * _t; }
static inline float mathClampf(float a, float b, float c) { return (((a)<(b))?(b):(((a)>(c))?(c):(a))); }
static inline float mathMinf(float a, float b) { return (a<b)?a:b; }
static inline float mathMaxf(float a, float b) { return (a>b)?a:b; }
static inline float mathAbsMaxf(float _x, float _y) { return ( ( (_x<0.0f)?-_x:_x)>((_y<0.0f)?-_y:_y)?_x:_y ); }
static inline float mathAbsMinf(float _x, float _y) { return ( ((_x<0.0f)?-_x:_x)<((_y<0.0f)?-_y:_y)?_x:_y ); }
static inline float frac(float _x) { return _x - ((int)_x); }

static inline float winLinear(const float *_s, float _index) {
   int idx = (int)_index;
   float r = _index - (float)idx;
   return mathLerpf(_s[idx], _s[idx+1], r);
}

static float ffrac_s(float _f) { int i; if(_f >= 0.0f) { i = (int)_f; return _f - (float)i; } else { i = (int)-_f; return 1.0f - (-_f - (float)i); } }
static short curve_0[16] = {
2032, 1788, 1550, 1321, 1106, 907, 726, 566, 427, 309, 212, 133, 73, 30, 2, -11, };
static short curve_1[16] = {
2048, 1909, 1770, 1632, 1494, 1355, 1217, 1080, 943, 806, 670, 535, 401, 266, 133, 0, };
static short curve_2[16] = {
2048, 1909, 1770, 1632, 1494, 1355, 1217, 1080, 943, 806, 670, 535, 401, 266, 133, 0, };
static short curve_3[16] = {
2048, 1909, 1770, 1632, 1494, 1355, 1217, 1080, 943, 806, 670, 535, 401, 266, 133, 0, };

#define USE_CYCLE_SINE_TBL  defined
static float cycle_sine_tbl_f[16384];

static float loc_bipolar_to_scale(const float _t, const float _div, const float _mul) {
   // t (-1..1) => /_div .. *_mul
   
   float s;

   if(_t < 0.0f)
   {
      s = (1.0f / _div);
      s = 1.0f + (s - 1.0f) * -_t;
      if(s < 0.0f)
         s = 0.0f;
   }
   else
   {
      s = _mul;
      s = 1.0f + (s - 1.0f) * _t;
   }
   
   return s;
}

static void loc_prepare(st_plugin_voice_t *_voice);

void loc_prepare(st_plugin_voice_t *_voice) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   ST_PLUGIN_VOICE_SHARED_CAST(osc_additive16phase_v1_shared_t);

   float out = 0.0f;
   // -------- lane "prepare" modIdx=0
   
   // -- mod="$m_center" dstVar=out
   out = voice->mod_center_cur;
   
   // -- mod="clp" dstVar=out
   if(out > 1.0f) out = 1.0f;
   else if(out < 0.0f) out = 0.0f;
   
   // -- mod="sto v_center" dstVar=out
   voice->var_v_center = out;
   
   // -- mod="$m_dampen" dstVar=out
   out = voice->mod_dampen_cur;
   
   // -- mod="sto v_dampen" dstVar=out
   voice->var_v_dampen = out;
   
   // -- mod="$p_amp" dstVar=out
   out = shared->params[PARAM_AMP];
   
   // -- mod="fma" dstVar=out
   out = (out * 2.0f) + -1.0f;
   
   // -- mod="bts" dstVar=out
   out = loc_bipolar_to_scale(out, 4.0f, 4.0f);
   
   // -- mod="sto v_amp" dstVar=out
   voice->var_v_amp = out;
   
   // -- mod="$m_det_amt" dstVar=out
   out = voice->mod_det_amt_cur;
   
   // -- mod="sto v_det_amt" dstVar=out
   voice->var_v_det_amt = out;
   
   // -- mod="$m_vsync" dstVar=out
   out = voice->mod_vsync_cur;
   
   // -- mod="sto v_vsync" dstVar=out
   voice->var_v_vsync = out;
} /* end prepare */

static unsigned int loc_copy_chars(char *_d, const unsigned int _dSize, const char *_s) {
   unsigned int r = 0u;
   if(NULL != _d)
   {
      // Write min(dSize,len(s)) characters to 'd'
      char *d = _d;
      if(NULL != _s)
      {
         const char *s = _s;
         for(;;)
         {
            if(r < _dSize)
            {
               char c = s[r++];
               *d++ = c;
               if(0 == c)
                  break;
            }
            else
            {
               if(r > 0u)
                  d[-1] = 0;  // force ASCIIZ
               break;
            }
         }
      }
      else
      {
         if(_dSize > 0u)
         {
            _d[0] = 0;
            r = 1u;
         }
      }
   }
   else
   {
      // Return total length of source string
      if(NULL != _s)
      {
         const char *s = _s;
         for(;;)
         {
            char c = s[r++];
            if(0 == c)
               break;
         }
      }
   }
   return r;
}

static unsigned int loc_copy_floats(float              *_d,
                                    const unsigned int  _dSize,
                                    const float        *_s,
                                    const unsigned int  _sNum
                                    ) {
   unsigned int r = 0u;
   if(NULL != _d)
   {
      // Write min(dSize,sNum) characters to 'd'
      if(NULL != _s)
      {
         unsigned int num = (_sNum > _dSize) ? _dSize : _sNum;
         memcpy((void*)_d, (const void*)_s, num * sizeof(float));
         r = num;
      }
   }
   else
   {
      // Query total number of presets
      r = _sNum;
   }
   return r;
}

static const char *ST_PLUGIN_API loc_get_param_name(st_plugin_info_t *_info,
                                                    unsigned int      _paramIdx
                                                    ) {
   (void)_info;
   return loc_param_names[_paramIdx];
}

static const char *ST_PLUGIN_API loc_get_param_group_name(st_plugin_info_t *_info,
                                                          unsigned int      _paramGroupIdx
                                                          ) {
   (void)_info;
   const char *r = NULL;
   return r;
}

static unsigned int ST_PLUGIN_API loc_get_param_group_idx(st_plugin_info_t *_info,
                                                          unsigned int      _paramIdx
                                                          ) {
   (void)_info;
   unsigned int r = ~0u;
   return r;
}

static float ST_PLUGIN_API loc_get_param_reset(st_plugin_info_t *_info,
                                               unsigned int      _paramIdx
                                               ) {
   (void)_info;
   return loc_param_resets[_paramIdx];
}

static float ST_PLUGIN_API loc_get_param_value(st_plugin_shared_t *_shared,
                                               unsigned int        _paramIdx
                                               ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   return shared->params[_paramIdx];
}

static void ST_PLUGIN_API loc_set_param_value(st_plugin_shared_t *_shared,
                                              unsigned int        _paramIdx,
                                              float               _value
                                              ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   shared->params[_paramIdx] = _value;
}

static unsigned int ST_PLUGIN_API loc_query_dynamic_param_preset_values(st_plugin_shared_t *_shared,
                                                                        const unsigned int  _paramIdx,
                                                                        float              *_retValues,
                                                                        const unsigned int  _retValuesSize
                                                                        ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   unsigned int r = 0u;
   return r;
}

static unsigned int ST_PLUGIN_API loc_query_dynamic_param_preset_name(st_plugin_shared_t *_shared,
                                                                      const unsigned int  _paramIdx,
                                                                      const unsigned int  _presetIdx,
                                                                      char               *_retBuf,
                                                                      const unsigned int  _retBufSize
                                                                      ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   unsigned int r = 0u;
   return r;
}

static unsigned int ST_PLUGIN_API loc_get_array_param_size(st_plugin_info_t   *_info,
                                                           const unsigned int  _paramIdx
                                                           ) {
   unsigned int r = 0u;
   switch(_paramIdx)
   {
      default:
         break;

      case 0: // param "p_mag"
         return 16u;

      case 4: // param "p_detune"
         return 16u;

      case 5: // param "p_phase"
         return 16u;

      case 7: // param "p_vsync"
         return 16u;
   }
   return r;
}

static unsigned int ST_PLUGIN_API loc_get_array_param_num_variations(st_plugin_info_t   *_info,
                                                                     const unsigned int  _paramIdx
                                                                     ) {
   unsigned int r = 0u;
   switch(_paramIdx)
   {
      default:
         break;

      case 0:  // param "p_mag"
         return 8u;

      case 4:  // param "p_detune"
         return 8u;

      case 5:  // param "p_phase"
         return 8u;

      case 7:  // param "p_vsync"
         return 8u;
   }
   return r;
}

static float * ST_PLUGIN_API loc_get_array_param_variation_ptr(st_plugin_shared_t *_shared,
                                                               const unsigned int  _paramIdx,
                                                               const unsigned int  _variationIdx
                                                               ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   float *r = NULL;
   switch(_paramIdx)
   {
      default:
         break;

      case 0:  // param "p_mag"
         return &shared->array_p_mag[_variationIdx][0];

      case 4:  // param "p_detune"
         return &shared->array_p_detune[_variationIdx][0];

      case 5:  // param "p_phase"
         return &shared->array_p_phase[_variationIdx][0];

      case 7:  // param "p_vsync"
         return &shared->array_p_vsync[_variationIdx][0];
   }
   return r;
}

static void ST_PLUGIN_API loc_set_array_param_edit_variation_idx(st_plugin_shared_t *_shared,
                                                                 const unsigned int  _paramIdx,
                                                                 const int           _variationIdx
                                                                 ) {
   ST_PLUGIN_SHARED_CAST(osc_additive16phase_v1_shared_t);
   switch(_paramIdx)
   {
      default:
         break;

      case 0:  // param "p_mag"
         shared->forced_varidx_p_mag = _variationIdx;
         break;

      case 4:  // param "p_detune"
         shared->forced_varidx_p_detune = _variationIdx;
         break;

      case 5:  // param "p_phase"
         shared->forced_varidx_p_phase = _variationIdx;
         break;

      case 7:  // param "p_vsync"
         shared->forced_varidx_p_vsync = _variationIdx;
         break;
   }
}

static int ST_PLUGIN_API loc_get_array_param_element_value_range(st_plugin_info_t   *_info,
                                                                 const unsigned int  _paramIdx,
                                                                 const unsigned int  _elementIdx,
                                                                 float              *_retStorageMin,
                                                                 float              *_retStorageMax,
                                                                 float              *_retDisplayMin,
                                                                 float              *_retDisplayMax,
                                                                 unsigned int       *_retDisplayPrecision
                                                                 ) {
   (void)_elementIdx;
   switch(_paramIdx)
   {
      default:
         break;

      case 0:  // param "p_mag"
         if(NULL != _retStorageMin) *_retStorageMin = 0.0f;
         if(NULL != _retStorageMax) *_retStorageMax = 1.0f;
         if(NULL != _retDisplayMin) *_retDisplayMin = 0.0f;
         if(NULL != _retDisplayMax) *_retDisplayMax = 1.0f;
         if(NULL != _retDisplayPrecision) *_retDisplayPrecision = 5;
         return 1;

      case 4:  // param "p_detune"
         if(NULL != _retStorageMin) *_retStorageMin = 0.0f;
         if(NULL != _retStorageMax) *_retStorageMax = 1.0f;
         if(NULL != _retDisplayMin) *_retDisplayMin = -16.0f;
         if(NULL != _retDisplayMax) *_retDisplayMax = 16.0f;
         if(NULL != _retDisplayPrecision) *_retDisplayPrecision = 5;
         return 1;

      case 5:  // param "p_phase"
         if(NULL != _retStorageMin) *_retStorageMin = 0.0f;
         if(NULL != _retStorageMax) *_retStorageMax = 1.0f;
         if(NULL != _retDisplayMin) *_retDisplayMin = 0.0f;
         if(NULL != _retDisplayMax) *_retDisplayMax = 1.0f;
         if(NULL != _retDisplayPrecision) *_retDisplayPrecision = 5;
         return 1;

      case 7:  // param "p_vsync"
         if(NULL != _retStorageMin) *_retStorageMin = 0.0f;
         if(NULL != _retStorageMax) *_retStorageMax = 1.0f;
         if(NULL != _retDisplayMin) *_retDisplayMin = 1.0f;
         if(NULL != _retDisplayMax) *_retDisplayMax = 16.0f;
         if(NULL != _retDisplayPrecision) *_retDisplayPrecision = 5;
         return 1;
   }
   return 0;
}

static const char *ST_PLUGIN_API loc_get_mod_name(st_plugin_info_t *_info,
                                                  unsigned int      _modIdx
                                                  ) {
   (void)_info;
   return loc_mod_names[_modIdx];
}

static void ST_PLUGIN_API loc_set_sample_rate(st_plugin_voice_t *_voice,
                                              float              _sampleRate
                                              ) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   voice->sample_rate = _sampleRate;
}

static void ST_PLUGIN_API loc_note_on(st_plugin_voice_t  *_voice,
                                      int                 _bGlide,
                                      unsigned char       _note,
                                      float               _vel
                                      ) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   ST_PLUGIN_VOICE_SHARED_CAST(osc_additive16phase_v1_shared_t);
   (void)_bGlide;
   (void)_note;
   (void)_vel;
   if(!_bGlide)
   {
      memset((void*)voice->mods, 0, sizeof(voice->mods));
#ifdef OVERSAMPLE_FACTOR
      voice->note_speed_fixed = (0.5f / (voice->sample_rate * OVERSAMPLE_FACTOR));
#else
      voice->note_speed_fixed = (0.5f / voice->sample_rate);
#endif // OVERSAMPLE_FACTOR


      voice->tmp3_sin_phase = 0.0f;
      voice->tmp41_sin_phase = 0.0f;
      voice->tmp79_sin_phase = 0.0f;
      voice->tmp117_sin_phase = 0.0f;
      voice->tmp155_sin_phase = 0.0f;
      voice->tmp193_sin_phase = 0.0f;
      voice->tmp231_sin_phase = 0.0f;
      voice->tmp269_sin_phase = 0.0f;
      voice->tmp307_sin_phase = 0.0f;
      voice->tmp345_sin_phase = 0.0f;
      voice->tmp383_sin_phase = 0.0f;
      voice->tmp421_sin_phase = 0.0f;
      voice->tmp459_sin_phase = 0.0f;
      voice->tmp497_sin_phase = 0.0f;
      voice->tmp535_sin_phase = 0.0f;
      voice->tmp573_sin_phase = 0.0f;

      voice->var_x = 0.0f;
      voice->var_v_center = 0.0f;
      voice->var_v_dampen = 0.0f;
      voice->var_v_freq_add = 0.0f;
      voice->var_v_level = 0.0f;
      voice->var_v_freq = 0.0f;
      voice->var_v_det_amt = 0.0f;
      voice->var_v_index = 0.0f;
      voice->var_v_out = 0.0f;
      voice->var_v_amp = 0.0f;
      voice->var_v_vsync = 0.0f;



      voice->last_varidx_p_mag = 0.0f;
      memcpy((void*)voice->eff_array_p_mag, (const void*)&shared->array_p_mag[0/*varIdx*/][0], sizeof(float) * 16);
      voice->last_varidx_p_detune = 0.0f;
      memcpy((void*)voice->eff_array_p_detune, (const void*)&shared->array_p_detune[0/*varIdx*/][0], sizeof(float) * 16);
      voice->last_varidx_p_phase = 0.0f;
      memcpy((void*)voice->eff_array_p_phase, (const void*)&shared->array_p_phase[0/*varIdx*/][0], sizeof(float) * 16);
      voice->last_varidx_p_vsync = 0.0f;
      memcpy((void*)voice->eff_array_p_vsync, (const void*)&shared->array_p_vsync[0/*varIdx*/][0], sizeof(float) * 16);
   }
}

static void ST_PLUGIN_API loc_set_mod_value(st_plugin_voice_t *_voice,
                                            unsigned int       _modIdx,
                                            float              _value,
                                            unsigned           _frameOffset
                                            ) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   (void)_frameOffset;
   voice->mods[_modIdx] = _value;
}

static void ST_PLUGIN_API loc_prepare_block(st_plugin_voice_t *_voice,
                                            unsigned int       _numFrames,
                                            float              _freqHz,
                                            float              _note,
                                            float              _vol,
                                            float              _pan
                                            ) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   ST_PLUGIN_VOICE_SHARED_CAST(osc_additive16phase_v1_shared_t);
   (void)_note;
   (void)_vol;
   (void)_pan;

#ifdef OVERSAMPLE_FACTOR
   float noteSpeed = _freqHz / (voice->sample_rate * OVERSAMPLE_FACTOR);
#else
   float noteSpeed = _freqHz / voice->sample_rate;
#endif // OVERSAMPLE_FACTOR

   float modmag          = shared->params[PARAM_MAG         ]                       + voice->mods[MOD_MAG          ];
   float modcenter       = shared->params[PARAM_CENTER      ]                       + voice->mods[MOD_CENTER       ];
   float moddampen       = shared->params[PARAM_DAMPEN      ]                       + voice->mods[MOD_DAMPEN       ];
   float modamp          = shared->params[PARAM_AMP         ]                       + voice->mods[MOD_AMP          ];
   float moddetune       = shared->params[PARAM_DETUNE      ]                       + voice->mods[MOD_DETUNE       ];
   float modphase        = shared->params[PARAM_PHASE       ]                       + voice->mods[MOD_PHASE        ];
   float moddet_amt      = shared->params[PARAM_DET_AMT     ]                       + voice->mods[MOD_DET_AMT      ];
   float modvsync        = shared->params[PARAM_VSYNC       ]                       + voice->mods[MOD_VSYNC        ];

   // Update array param "p_mag" voice array
   if(shared->forced_varidx_p_mag >= 0 || modmag != voice->last_varidx_p_mag)
   {
      float idxF = (shared->forced_varidx_p_mag >= 0) ? ((float)shared->forced_varidx_p_mag) : (modmag * 8);
      float amtB = idxF - ((int)idxF);
      unsigned int idxA = (unsigned int)idxF;
      if(idxA >= 8u/*num_variations*/)
         idxA = 0u;
      unsigned int idxB = idxA + 1u;
      if(idxB >= 8u/*num_variations*/)
         idxB = 0u;
      const float *sA = &shared->array_p_mag[idxA][0];
      const float *sB = &shared->array_p_mag[idxB][0];
      float *d = &voice->eff_array_p_mag[0];
      for(unsigned int i = 0u; i < 16u; i++)
         d[i] = sA[i] + (sB[i] - sA[i]) * amtB;
      voice->last_varidx_p_mag = (shared->forced_varidx_p_mag >= 0) ? -1.0f : modmag;
   }

   // Update array param "p_detune" voice array
   if(shared->forced_varidx_p_detune >= 0 || moddetune != voice->last_varidx_p_detune)
   {
      float idxF = (shared->forced_varidx_p_detune >= 0) ? ((float)shared->forced_varidx_p_detune) : (moddetune * 8);
      float amtB = idxF - ((int)idxF);
      unsigned int idxA = (unsigned int)idxF;
      if(idxA >= 8u/*num_variations*/)
         idxA = 0u;
      unsigned int idxB = idxA + 1u;
      if(idxB >= 8u/*num_variations*/)
         idxB = 0u;
      const float *sA = &shared->array_p_detune[idxA][0];
      const float *sB = &shared->array_p_detune[idxB][0];
      float *d = &voice->eff_array_p_detune[0];
      for(unsigned int i = 0u; i < 16u; i++)
         d[i] = sA[i] + (sB[i] - sA[i]) * amtB;
      voice->last_varidx_p_detune = (shared->forced_varidx_p_detune >= 0) ? -1.0f : moddetune;
   }

   // Update array param "p_phase" voice array
   if(shared->forced_varidx_p_phase >= 0 || modphase != voice->last_varidx_p_phase)
   {
      float idxF = (shared->forced_varidx_p_phase >= 0) ? ((float)shared->forced_varidx_p_phase) : (modphase * 8);
      float amtB = idxF - ((int)idxF);
      unsigned int idxA = (unsigned int)idxF;
      if(idxA >= 8u/*num_variations*/)
         idxA = 0u;
      unsigned int idxB = idxA + 1u;
      if(idxB >= 8u/*num_variations*/)
         idxB = 0u;
      const float *sA = &shared->array_p_phase[idxA][0];
      const float *sB = &shared->array_p_phase[idxB][0];
      float *d = &voice->eff_array_p_phase[0];
      for(unsigned int i = 0u; i < 16u; i++)
         d[i] = sA[i] + (sB[i] - sA[i]) * amtB;
      voice->last_varidx_p_phase = (shared->forced_varidx_p_phase >= 0) ? -1.0f : modphase;
   }

   // Update array param "p_vsync" voice array
   if(shared->forced_varidx_p_vsync >= 0 || modvsync != voice->last_varidx_p_vsync)
   {
      float idxF = (shared->forced_varidx_p_vsync >= 0) ? ((float)shared->forced_varidx_p_vsync) : (modvsync * 8);
      float amtB = idxF - ((int)idxF);
      unsigned int idxA = (unsigned int)idxF;
      if(idxA >= 8u/*num_variations*/)
         idxA = 0u;
      unsigned int idxB = idxA + 1u;
      if(idxB >= 8u/*num_variations*/)
         idxB = 0u;
      const float *sA = &shared->array_p_vsync[idxA][0];
      const float *sB = &shared->array_p_vsync[idxB][0];
      float *d = &voice->eff_array_p_vsync[0];
      for(unsigned int i = 0u; i < 16u; i++)
         d[i] = sA[i] + (sB[i] - sA[i]) * amtB;
      voice->last_varidx_p_vsync = (shared->forced_varidx_p_vsync >= 0) ? -1.0f : modvsync;
   }

   if(_numFrames > 0u)
   {
      // lerp
      float recBlockSize = (1.0f / _numFrames);
      voice->note_speed_inc = (noteSpeed - voice->note_speed_cur) * recBlockSize;
      voice->note_inc       = (_note - voice->note_cur) * recBlockSize;
      voice->mod_mag_inc          = (modmag             - voice->mod_mag_cur           ) * recBlockSize;
      voice->mod_center_inc       = (modcenter          - voice->mod_center_cur        ) * recBlockSize;
      voice->mod_dampen_inc       = (moddampen          - voice->mod_dampen_cur        ) * recBlockSize;
      voice->mod_amp_inc          = (modamp             - voice->mod_amp_cur           ) * recBlockSize;
      voice->mod_detune_inc       = (moddetune          - voice->mod_detune_cur        ) * recBlockSize;
      voice->mod_phase_inc        = (modphase           - voice->mod_phase_cur         ) * recBlockSize;
      voice->mod_det_amt_inc      = (moddet_amt         - voice->mod_det_amt_cur       ) * recBlockSize;
      voice->mod_vsync_inc        = (modvsync           - voice->mod_vsync_cur         ) * recBlockSize;

      loc_prepare(&voice->base);
   }
   else
   {
      // initial params/modulation (first block, not rendered)
      voice->note_speed_cur = noteSpeed;
      voice->note_speed_inc = 0.0f;
      voice->note_cur       = _note;
      voice->note_inc       = 0.0f;
      voice->mod_mag_cur          = modmag;
      voice->mod_mag_inc          = 0.0f;
      voice->mod_center_cur       = modcenter;
      voice->mod_center_inc       = 0.0f;
      voice->mod_dampen_cur       = moddampen;
      voice->mod_dampen_inc       = 0.0f;
      voice->mod_amp_cur          = modamp;
      voice->mod_amp_inc          = 0.0f;
      voice->mod_detune_cur       = moddetune;
      voice->mod_detune_inc       = 0.0f;
      voice->mod_phase_cur        = modphase;
      voice->mod_phase_inc        = 0.0f;
      voice->mod_det_amt_cur      = moddet_amt;
      voice->mod_det_amt_inc      = 0.0f;
      voice->mod_vsync_cur        = modvsync;
      voice->mod_vsync_inc        = 0.0f;

      loc_prepare(&voice->base);
   }

   // printf("xxx note_cur=%f\n", voice->note_cur);
}

static void ST_PLUGIN_API loc_process_replace(st_plugin_voice_t  *_voice,
                                              int                 _bMonoIn,
                                              const float        *_samplesIn,
                                              float              *_samplesOut,
                                              unsigned int        _numFrames
                                              ) {
   (void)_bMonoIn;
   (void)_samplesIn;

   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);
   ST_PLUGIN_VOICE_SHARED_CAST(osc_additive16phase_v1_shared_t);

   // Mono output (replicate left to right channel)
   unsigned int j = 0u;
   unsigned int jStep = _bMonoIn ? 1u : 2u;
   unsigned int k = 0u;
   for(unsigned int i = 0u; i < _numFrames; i++)
   {
      float out = _samplesIn[j];
      j += jStep;
#ifdef OVERSAMPLE_FACTOR
      float outOS = 0.0f;
#endif // OVERSAMPLE_FACTOR

#ifdef OVERSAMPLE_FACTOR
      for(unsigned int osi = 0u; osi < OVERSAMPLE_FACTOR; osi++)
#endif // OVERSAMPLE_FACTOR
      {
      float tmp_f;
      float tmp2_f;
      
      // ========
      // ======== lane "out" modIdx=0
      // ========
      
      // -- mod="set v_freq" dstVar=out
      voice->var_v_freq = 1;
      
      // -- mod="set v_level" dstVar=out
      voice->var_v_level = 1;
      
      // -- mod="set v_index" dstVar=out
      
      // ---- mod="set v_index" input "value" seq 1/1
      
      // -- mod="$v_center" dstVar=voice->tmp1_delta
      voice->tmp1_delta = voice->var_v_center;
      voice->var_v_index = voice->tmp1_delta;
      
      // -- mod="set v_out" dstVar=out
      voice->var_v_out = 0;
      
      // -- mod="rep" dstVar=out
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp5_freq
      voice->tmp5_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp5_freq
      voice->tmp6_lut_f = (voice->tmp5_freq * 16);
      voice->tmp7_lut_idx_a = (int)voice->tmp6_lut_f;
      voice->tmp9_lut_frac = voice->tmp6_lut_f - (float)voice->tmp7_lut_idx_a;
      voice->tmp10_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp7_lut_idx_a      ) & 15];
      voice->tmp11_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp7_lut_idx_a) + 1u) & 15];
      voice->tmp5_freq = voice->tmp10_lut_a + (voice->tmp11_lut_b - voice->tmp10_lut_a) * voice->tmp9_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp5_freq
      voice->tmp5_freq = (voice->tmp5_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp5_freq
      voice->tmp5_freq = loc_bipolar_to_scale(voice->tmp5_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp5_freq
      voice->tmp12_seq = 1.0f;
      voice->tmp5_freq -= voice->tmp12_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp5_freq
      voice->tmp13_seq = voice->var_v_det_amt;
      voice->tmp5_freq *= voice->tmp13_seq;
      
      // -- mod="1" dstVar=voice->tmp5_freq
      voice->tmp14_seq = 1.0f;
      voice->tmp5_freq += voice->tmp14_seq;
      voice->tmp4_sin_speed = voice->note_speed_cur * voice->tmp5_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp16_phase
      voice->tmp16_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp16_phase
      voice->tmp17_lut_f = (voice->tmp16_phase * 16);
      voice->tmp18_lut_idx_a = (int)voice->tmp17_lut_f;
      voice->tmp20_lut_frac = voice->tmp17_lut_f - (float)voice->tmp18_lut_idx_a;
      voice->tmp21_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp18_lut_idx_a      ) & 15];
      voice->tmp22_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp18_lut_idx_a) + 1u) & 15];
      voice->tmp16_phase = voice->tmp21_lut_a + (voice->tmp22_lut_b - voice->tmp21_lut_a) * voice->tmp20_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp23_vsync
      voice->tmp23_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp23_vsync
      voice->tmp24_lut_f = (voice->tmp23_vsync * 16);
      voice->tmp25_lut_idx_a = (int)voice->tmp24_lut_f;
      voice->tmp27_lut_frac = voice->tmp24_lut_f - (float)voice->tmp25_lut_idx_a;
      voice->tmp28_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp25_lut_idx_a      ) & 15];
      voice->tmp29_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp25_lut_idx_a) + 1u) & 15];
      voice->tmp23_vsync = voice->tmp28_lut_a + (voice->tmp29_lut_b - voice->tmp28_lut_a) * voice->tmp27_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp23_vsync
      voice->tmp23_vsync = (voice->tmp23_vsync * 15.0f) + 1.0f;
      voice->tmp15_sin_tmp = ((voice->tmp3_sin_phase + voice->tmp16_phase));
      voice->tmp15_sin_tmp = voice->tmp15_sin_tmp * voice->tmp23_vsync;
      voice->tmp15_sin_tmp = ffrac_s(voice->tmp15_sin_tmp);
      voice->tmp2_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp15_sin_tmp)&16383u];
      voice->tmp3_sin_phase = ffrac_s(voice->tmp3_sin_phase + voice->tmp4_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp2_seq
      voice->tmp30_seq = 0.0625f;
      voice->tmp2_seq *= voice->tmp30_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp2_seq
      voice->tmp31_seq = voice->var_v_level;
      voice->tmp2_seq *= voice->tmp31_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp2_seq
      voice->tmp32_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp32_seq
      voice->tmp33_lut_f = (voice->tmp32_seq * 16);
      voice->tmp34_lut_idx_a = (int)voice->tmp33_lut_f;
      voice->tmp36_lut_frac = voice->tmp33_lut_f - (float)voice->tmp34_lut_idx_a;
      voice->tmp37_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp34_lut_idx_a      ) & 15];
      voice->tmp38_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp34_lut_idx_a) + 1u) & 15];
      voice->tmp32_seq = voice->tmp37_lut_a + (voice->tmp38_lut_b - voice->tmp37_lut_a) * voice->tmp36_lut_frac;
      voice->tmp2_seq *= voice->tmp32_seq;
      out += voice->tmp2_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp39_seq = voice->var_v_dampen;
      out *= voice->tmp39_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp43_freq
      voice->tmp43_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp43_freq
      voice->tmp44_lut_f = (voice->tmp43_freq * 16);
      voice->tmp45_lut_idx_a = (int)voice->tmp44_lut_f;
      voice->tmp47_lut_frac = voice->tmp44_lut_f - (float)voice->tmp45_lut_idx_a;
      voice->tmp48_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp45_lut_idx_a      ) & 15];
      voice->tmp49_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp45_lut_idx_a) + 1u) & 15];
      voice->tmp43_freq = voice->tmp48_lut_a + (voice->tmp49_lut_b - voice->tmp48_lut_a) * voice->tmp47_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp43_freq
      voice->tmp43_freq = (voice->tmp43_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp43_freq
      voice->tmp43_freq = loc_bipolar_to_scale(voice->tmp43_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp43_freq
      voice->tmp50_seq = 1.0f;
      voice->tmp43_freq -= voice->tmp50_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp43_freq
      voice->tmp51_seq = voice->var_v_det_amt;
      voice->tmp43_freq *= voice->tmp51_seq;
      
      // -- mod="1" dstVar=voice->tmp43_freq
      voice->tmp52_seq = 1.0f;
      voice->tmp43_freq += voice->tmp52_seq;
      voice->tmp42_sin_speed = voice->note_speed_cur * voice->tmp43_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp54_phase
      voice->tmp54_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp54_phase
      voice->tmp55_lut_f = (voice->tmp54_phase * 16);
      voice->tmp56_lut_idx_a = (int)voice->tmp55_lut_f;
      voice->tmp58_lut_frac = voice->tmp55_lut_f - (float)voice->tmp56_lut_idx_a;
      voice->tmp59_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp56_lut_idx_a      ) & 15];
      voice->tmp60_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp56_lut_idx_a) + 1u) & 15];
      voice->tmp54_phase = voice->tmp59_lut_a + (voice->tmp60_lut_b - voice->tmp59_lut_a) * voice->tmp58_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp61_vsync
      voice->tmp61_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp61_vsync
      voice->tmp62_lut_f = (voice->tmp61_vsync * 16);
      voice->tmp63_lut_idx_a = (int)voice->tmp62_lut_f;
      voice->tmp65_lut_frac = voice->tmp62_lut_f - (float)voice->tmp63_lut_idx_a;
      voice->tmp66_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp63_lut_idx_a      ) & 15];
      voice->tmp67_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp63_lut_idx_a) + 1u) & 15];
      voice->tmp61_vsync = voice->tmp66_lut_a + (voice->tmp67_lut_b - voice->tmp66_lut_a) * voice->tmp65_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp61_vsync
      voice->tmp61_vsync = (voice->tmp61_vsync * 15.0f) + 1.0f;
      voice->tmp53_sin_tmp = ((voice->tmp41_sin_phase + voice->tmp54_phase));
      voice->tmp53_sin_tmp = voice->tmp53_sin_tmp * voice->tmp61_vsync;
      voice->tmp53_sin_tmp = ffrac_s(voice->tmp53_sin_tmp);
      voice->tmp40_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp53_sin_tmp)&16383u];
      voice->tmp41_sin_phase = ffrac_s(voice->tmp41_sin_phase + voice->tmp42_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp40_seq
      voice->tmp68_seq = 0.0625f;
      voice->tmp40_seq *= voice->tmp68_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp40_seq
      voice->tmp69_seq = voice->var_v_level;
      voice->tmp40_seq *= voice->tmp69_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp40_seq
      voice->tmp70_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp70_seq
      voice->tmp71_lut_f = (voice->tmp70_seq * 16);
      voice->tmp72_lut_idx_a = (int)voice->tmp71_lut_f;
      voice->tmp74_lut_frac = voice->tmp71_lut_f - (float)voice->tmp72_lut_idx_a;
      voice->tmp75_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp72_lut_idx_a      ) & 15];
      voice->tmp76_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp72_lut_idx_a) + 1u) & 15];
      voice->tmp70_seq = voice->tmp75_lut_a + (voice->tmp76_lut_b - voice->tmp75_lut_a) * voice->tmp74_lut_frac;
      voice->tmp40_seq *= voice->tmp70_seq;
      out += voice->tmp40_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp77_seq = voice->var_v_dampen;
      out *= voice->tmp77_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp81_freq
      voice->tmp81_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp81_freq
      voice->tmp82_lut_f = (voice->tmp81_freq * 16);
      voice->tmp83_lut_idx_a = (int)voice->tmp82_lut_f;
      voice->tmp85_lut_frac = voice->tmp82_lut_f - (float)voice->tmp83_lut_idx_a;
      voice->tmp86_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp83_lut_idx_a      ) & 15];
      voice->tmp87_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp83_lut_idx_a) + 1u) & 15];
      voice->tmp81_freq = voice->tmp86_lut_a + (voice->tmp87_lut_b - voice->tmp86_lut_a) * voice->tmp85_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp81_freq
      voice->tmp81_freq = (voice->tmp81_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp81_freq
      voice->tmp81_freq = loc_bipolar_to_scale(voice->tmp81_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp81_freq
      voice->tmp88_seq = 1.0f;
      voice->tmp81_freq -= voice->tmp88_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp81_freq
      voice->tmp89_seq = voice->var_v_det_amt;
      voice->tmp81_freq *= voice->tmp89_seq;
      
      // -- mod="1" dstVar=voice->tmp81_freq
      voice->tmp90_seq = 1.0f;
      voice->tmp81_freq += voice->tmp90_seq;
      voice->tmp80_sin_speed = voice->note_speed_cur * voice->tmp81_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp92_phase
      voice->tmp92_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp92_phase
      voice->tmp93_lut_f = (voice->tmp92_phase * 16);
      voice->tmp94_lut_idx_a = (int)voice->tmp93_lut_f;
      voice->tmp96_lut_frac = voice->tmp93_lut_f - (float)voice->tmp94_lut_idx_a;
      voice->tmp97_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp94_lut_idx_a      ) & 15];
      voice->tmp98_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp94_lut_idx_a) + 1u) & 15];
      voice->tmp92_phase = voice->tmp97_lut_a + (voice->tmp98_lut_b - voice->tmp97_lut_a) * voice->tmp96_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp99_vsync
      voice->tmp99_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp99_vsync
      voice->tmp100_lut_f = (voice->tmp99_vsync * 16);
      voice->tmp101_lut_idx_a = (int)voice->tmp100_lut_f;
      voice->tmp103_lut_frac = voice->tmp100_lut_f - (float)voice->tmp101_lut_idx_a;
      voice->tmp104_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp101_lut_idx_a      ) & 15];
      voice->tmp105_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp101_lut_idx_a) + 1u) & 15];
      voice->tmp99_vsync = voice->tmp104_lut_a + (voice->tmp105_lut_b - voice->tmp104_lut_a) * voice->tmp103_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp99_vsync
      voice->tmp99_vsync = (voice->tmp99_vsync * 15.0f) + 1.0f;
      voice->tmp91_sin_tmp = ((voice->tmp79_sin_phase + voice->tmp92_phase));
      voice->tmp91_sin_tmp = voice->tmp91_sin_tmp * voice->tmp99_vsync;
      voice->tmp91_sin_tmp = ffrac_s(voice->tmp91_sin_tmp);
      voice->tmp78_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp91_sin_tmp)&16383u];
      voice->tmp79_sin_phase = ffrac_s(voice->tmp79_sin_phase + voice->tmp80_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp78_seq
      voice->tmp106_seq = 0.0625f;
      voice->tmp78_seq *= voice->tmp106_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp78_seq
      voice->tmp107_seq = voice->var_v_level;
      voice->tmp78_seq *= voice->tmp107_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp78_seq
      voice->tmp108_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp108_seq
      voice->tmp109_lut_f = (voice->tmp108_seq * 16);
      voice->tmp110_lut_idx_a = (int)voice->tmp109_lut_f;
      voice->tmp112_lut_frac = voice->tmp109_lut_f - (float)voice->tmp110_lut_idx_a;
      voice->tmp113_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp110_lut_idx_a      ) & 15];
      voice->tmp114_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp110_lut_idx_a) + 1u) & 15];
      voice->tmp108_seq = voice->tmp113_lut_a + (voice->tmp114_lut_b - voice->tmp113_lut_a) * voice->tmp112_lut_frac;
      voice->tmp78_seq *= voice->tmp108_seq;
      out += voice->tmp78_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp115_seq = voice->var_v_dampen;
      out *= voice->tmp115_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp119_freq
      voice->tmp119_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp119_freq
      voice->tmp120_lut_f = (voice->tmp119_freq * 16);
      voice->tmp121_lut_idx_a = (int)voice->tmp120_lut_f;
      voice->tmp123_lut_frac = voice->tmp120_lut_f - (float)voice->tmp121_lut_idx_a;
      voice->tmp124_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp121_lut_idx_a      ) & 15];
      voice->tmp125_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp121_lut_idx_a) + 1u) & 15];
      voice->tmp119_freq = voice->tmp124_lut_a + (voice->tmp125_lut_b - voice->tmp124_lut_a) * voice->tmp123_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp119_freq
      voice->tmp119_freq = (voice->tmp119_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp119_freq
      voice->tmp119_freq = loc_bipolar_to_scale(voice->tmp119_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp119_freq
      voice->tmp126_seq = 1.0f;
      voice->tmp119_freq -= voice->tmp126_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp119_freq
      voice->tmp127_seq = voice->var_v_det_amt;
      voice->tmp119_freq *= voice->tmp127_seq;
      
      // -- mod="1" dstVar=voice->tmp119_freq
      voice->tmp128_seq = 1.0f;
      voice->tmp119_freq += voice->tmp128_seq;
      voice->tmp118_sin_speed = voice->note_speed_cur * voice->tmp119_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp130_phase
      voice->tmp130_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp130_phase
      voice->tmp131_lut_f = (voice->tmp130_phase * 16);
      voice->tmp132_lut_idx_a = (int)voice->tmp131_lut_f;
      voice->tmp134_lut_frac = voice->tmp131_lut_f - (float)voice->tmp132_lut_idx_a;
      voice->tmp135_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp132_lut_idx_a      ) & 15];
      voice->tmp136_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp132_lut_idx_a) + 1u) & 15];
      voice->tmp130_phase = voice->tmp135_lut_a + (voice->tmp136_lut_b - voice->tmp135_lut_a) * voice->tmp134_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp137_vsync
      voice->tmp137_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp137_vsync
      voice->tmp138_lut_f = (voice->tmp137_vsync * 16);
      voice->tmp139_lut_idx_a = (int)voice->tmp138_lut_f;
      voice->tmp141_lut_frac = voice->tmp138_lut_f - (float)voice->tmp139_lut_idx_a;
      voice->tmp142_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp139_lut_idx_a      ) & 15];
      voice->tmp143_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp139_lut_idx_a) + 1u) & 15];
      voice->tmp137_vsync = voice->tmp142_lut_a + (voice->tmp143_lut_b - voice->tmp142_lut_a) * voice->tmp141_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp137_vsync
      voice->tmp137_vsync = (voice->tmp137_vsync * 15.0f) + 1.0f;
      voice->tmp129_sin_tmp = ((voice->tmp117_sin_phase + voice->tmp130_phase));
      voice->tmp129_sin_tmp = voice->tmp129_sin_tmp * voice->tmp137_vsync;
      voice->tmp129_sin_tmp = ffrac_s(voice->tmp129_sin_tmp);
      voice->tmp116_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp129_sin_tmp)&16383u];
      voice->tmp117_sin_phase = ffrac_s(voice->tmp117_sin_phase + voice->tmp118_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp116_seq
      voice->tmp144_seq = 0.0625f;
      voice->tmp116_seq *= voice->tmp144_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp116_seq
      voice->tmp145_seq = voice->var_v_level;
      voice->tmp116_seq *= voice->tmp145_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp116_seq
      voice->tmp146_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp146_seq
      voice->tmp147_lut_f = (voice->tmp146_seq * 16);
      voice->tmp148_lut_idx_a = (int)voice->tmp147_lut_f;
      voice->tmp150_lut_frac = voice->tmp147_lut_f - (float)voice->tmp148_lut_idx_a;
      voice->tmp151_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp148_lut_idx_a      ) & 15];
      voice->tmp152_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp148_lut_idx_a) + 1u) & 15];
      voice->tmp146_seq = voice->tmp151_lut_a + (voice->tmp152_lut_b - voice->tmp151_lut_a) * voice->tmp150_lut_frac;
      voice->tmp116_seq *= voice->tmp146_seq;
      out += voice->tmp116_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp153_seq = voice->var_v_dampen;
      out *= voice->tmp153_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp157_freq
      voice->tmp157_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp157_freq
      voice->tmp158_lut_f = (voice->tmp157_freq * 16);
      voice->tmp159_lut_idx_a = (int)voice->tmp158_lut_f;
      voice->tmp161_lut_frac = voice->tmp158_lut_f - (float)voice->tmp159_lut_idx_a;
      voice->tmp162_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp159_lut_idx_a      ) & 15];
      voice->tmp163_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp159_lut_idx_a) + 1u) & 15];
      voice->tmp157_freq = voice->tmp162_lut_a + (voice->tmp163_lut_b - voice->tmp162_lut_a) * voice->tmp161_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp157_freq
      voice->tmp157_freq = (voice->tmp157_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp157_freq
      voice->tmp157_freq = loc_bipolar_to_scale(voice->tmp157_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp157_freq
      voice->tmp164_seq = 1.0f;
      voice->tmp157_freq -= voice->tmp164_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp157_freq
      voice->tmp165_seq = voice->var_v_det_amt;
      voice->tmp157_freq *= voice->tmp165_seq;
      
      // -- mod="1" dstVar=voice->tmp157_freq
      voice->tmp166_seq = 1.0f;
      voice->tmp157_freq += voice->tmp166_seq;
      voice->tmp156_sin_speed = voice->note_speed_cur * voice->tmp157_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp168_phase
      voice->tmp168_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp168_phase
      voice->tmp169_lut_f = (voice->tmp168_phase * 16);
      voice->tmp170_lut_idx_a = (int)voice->tmp169_lut_f;
      voice->tmp172_lut_frac = voice->tmp169_lut_f - (float)voice->tmp170_lut_idx_a;
      voice->tmp173_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp170_lut_idx_a      ) & 15];
      voice->tmp174_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp170_lut_idx_a) + 1u) & 15];
      voice->tmp168_phase = voice->tmp173_lut_a + (voice->tmp174_lut_b - voice->tmp173_lut_a) * voice->tmp172_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp175_vsync
      voice->tmp175_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp175_vsync
      voice->tmp176_lut_f = (voice->tmp175_vsync * 16);
      voice->tmp177_lut_idx_a = (int)voice->tmp176_lut_f;
      voice->tmp179_lut_frac = voice->tmp176_lut_f - (float)voice->tmp177_lut_idx_a;
      voice->tmp180_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp177_lut_idx_a      ) & 15];
      voice->tmp181_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp177_lut_idx_a) + 1u) & 15];
      voice->tmp175_vsync = voice->tmp180_lut_a + (voice->tmp181_lut_b - voice->tmp180_lut_a) * voice->tmp179_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp175_vsync
      voice->tmp175_vsync = (voice->tmp175_vsync * 15.0f) + 1.0f;
      voice->tmp167_sin_tmp = ((voice->tmp155_sin_phase + voice->tmp168_phase));
      voice->tmp167_sin_tmp = voice->tmp167_sin_tmp * voice->tmp175_vsync;
      voice->tmp167_sin_tmp = ffrac_s(voice->tmp167_sin_tmp);
      voice->tmp154_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp167_sin_tmp)&16383u];
      voice->tmp155_sin_phase = ffrac_s(voice->tmp155_sin_phase + voice->tmp156_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp154_seq
      voice->tmp182_seq = 0.0625f;
      voice->tmp154_seq *= voice->tmp182_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp154_seq
      voice->tmp183_seq = voice->var_v_level;
      voice->tmp154_seq *= voice->tmp183_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp154_seq
      voice->tmp184_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp184_seq
      voice->tmp185_lut_f = (voice->tmp184_seq * 16);
      voice->tmp186_lut_idx_a = (int)voice->tmp185_lut_f;
      voice->tmp188_lut_frac = voice->tmp185_lut_f - (float)voice->tmp186_lut_idx_a;
      voice->tmp189_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp186_lut_idx_a      ) & 15];
      voice->tmp190_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp186_lut_idx_a) + 1u) & 15];
      voice->tmp184_seq = voice->tmp189_lut_a + (voice->tmp190_lut_b - voice->tmp189_lut_a) * voice->tmp188_lut_frac;
      voice->tmp154_seq *= voice->tmp184_seq;
      out += voice->tmp154_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp191_seq = voice->var_v_dampen;
      out *= voice->tmp191_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp195_freq
      voice->tmp195_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp195_freq
      voice->tmp196_lut_f = (voice->tmp195_freq * 16);
      voice->tmp197_lut_idx_a = (int)voice->tmp196_lut_f;
      voice->tmp199_lut_frac = voice->tmp196_lut_f - (float)voice->tmp197_lut_idx_a;
      voice->tmp200_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp197_lut_idx_a      ) & 15];
      voice->tmp201_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp197_lut_idx_a) + 1u) & 15];
      voice->tmp195_freq = voice->tmp200_lut_a + (voice->tmp201_lut_b - voice->tmp200_lut_a) * voice->tmp199_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp195_freq
      voice->tmp195_freq = (voice->tmp195_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp195_freq
      voice->tmp195_freq = loc_bipolar_to_scale(voice->tmp195_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp195_freq
      voice->tmp202_seq = 1.0f;
      voice->tmp195_freq -= voice->tmp202_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp195_freq
      voice->tmp203_seq = voice->var_v_det_amt;
      voice->tmp195_freq *= voice->tmp203_seq;
      
      // -- mod="1" dstVar=voice->tmp195_freq
      voice->tmp204_seq = 1.0f;
      voice->tmp195_freq += voice->tmp204_seq;
      voice->tmp194_sin_speed = voice->note_speed_cur * voice->tmp195_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp206_phase
      voice->tmp206_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp206_phase
      voice->tmp207_lut_f = (voice->tmp206_phase * 16);
      voice->tmp208_lut_idx_a = (int)voice->tmp207_lut_f;
      voice->tmp210_lut_frac = voice->tmp207_lut_f - (float)voice->tmp208_lut_idx_a;
      voice->tmp211_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp208_lut_idx_a      ) & 15];
      voice->tmp212_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp208_lut_idx_a) + 1u) & 15];
      voice->tmp206_phase = voice->tmp211_lut_a + (voice->tmp212_lut_b - voice->tmp211_lut_a) * voice->tmp210_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp213_vsync
      voice->tmp213_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp213_vsync
      voice->tmp214_lut_f = (voice->tmp213_vsync * 16);
      voice->tmp215_lut_idx_a = (int)voice->tmp214_lut_f;
      voice->tmp217_lut_frac = voice->tmp214_lut_f - (float)voice->tmp215_lut_idx_a;
      voice->tmp218_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp215_lut_idx_a      ) & 15];
      voice->tmp219_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp215_lut_idx_a) + 1u) & 15];
      voice->tmp213_vsync = voice->tmp218_lut_a + (voice->tmp219_lut_b - voice->tmp218_lut_a) * voice->tmp217_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp213_vsync
      voice->tmp213_vsync = (voice->tmp213_vsync * 15.0f) + 1.0f;
      voice->tmp205_sin_tmp = ((voice->tmp193_sin_phase + voice->tmp206_phase));
      voice->tmp205_sin_tmp = voice->tmp205_sin_tmp * voice->tmp213_vsync;
      voice->tmp205_sin_tmp = ffrac_s(voice->tmp205_sin_tmp);
      voice->tmp192_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp205_sin_tmp)&16383u];
      voice->tmp193_sin_phase = ffrac_s(voice->tmp193_sin_phase + voice->tmp194_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp192_seq
      voice->tmp220_seq = 0.0625f;
      voice->tmp192_seq *= voice->tmp220_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp192_seq
      voice->tmp221_seq = voice->var_v_level;
      voice->tmp192_seq *= voice->tmp221_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp192_seq
      voice->tmp222_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp222_seq
      voice->tmp223_lut_f = (voice->tmp222_seq * 16);
      voice->tmp224_lut_idx_a = (int)voice->tmp223_lut_f;
      voice->tmp226_lut_frac = voice->tmp223_lut_f - (float)voice->tmp224_lut_idx_a;
      voice->tmp227_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp224_lut_idx_a      ) & 15];
      voice->tmp228_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp224_lut_idx_a) + 1u) & 15];
      voice->tmp222_seq = voice->tmp227_lut_a + (voice->tmp228_lut_b - voice->tmp227_lut_a) * voice->tmp226_lut_frac;
      voice->tmp192_seq *= voice->tmp222_seq;
      out += voice->tmp192_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp229_seq = voice->var_v_dampen;
      out *= voice->tmp229_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp233_freq
      voice->tmp233_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp233_freq
      voice->tmp234_lut_f = (voice->tmp233_freq * 16);
      voice->tmp235_lut_idx_a = (int)voice->tmp234_lut_f;
      voice->tmp237_lut_frac = voice->tmp234_lut_f - (float)voice->tmp235_lut_idx_a;
      voice->tmp238_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp235_lut_idx_a      ) & 15];
      voice->tmp239_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp235_lut_idx_a) + 1u) & 15];
      voice->tmp233_freq = voice->tmp238_lut_a + (voice->tmp239_lut_b - voice->tmp238_lut_a) * voice->tmp237_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp233_freq
      voice->tmp233_freq = (voice->tmp233_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp233_freq
      voice->tmp233_freq = loc_bipolar_to_scale(voice->tmp233_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp233_freq
      voice->tmp240_seq = 1.0f;
      voice->tmp233_freq -= voice->tmp240_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp233_freq
      voice->tmp241_seq = voice->var_v_det_amt;
      voice->tmp233_freq *= voice->tmp241_seq;
      
      // -- mod="1" dstVar=voice->tmp233_freq
      voice->tmp242_seq = 1.0f;
      voice->tmp233_freq += voice->tmp242_seq;
      voice->tmp232_sin_speed = voice->note_speed_cur * voice->tmp233_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp244_phase
      voice->tmp244_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp244_phase
      voice->tmp245_lut_f = (voice->tmp244_phase * 16);
      voice->tmp246_lut_idx_a = (int)voice->tmp245_lut_f;
      voice->tmp248_lut_frac = voice->tmp245_lut_f - (float)voice->tmp246_lut_idx_a;
      voice->tmp249_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp246_lut_idx_a      ) & 15];
      voice->tmp250_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp246_lut_idx_a) + 1u) & 15];
      voice->tmp244_phase = voice->tmp249_lut_a + (voice->tmp250_lut_b - voice->tmp249_lut_a) * voice->tmp248_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp251_vsync
      voice->tmp251_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp251_vsync
      voice->tmp252_lut_f = (voice->tmp251_vsync * 16);
      voice->tmp253_lut_idx_a = (int)voice->tmp252_lut_f;
      voice->tmp255_lut_frac = voice->tmp252_lut_f - (float)voice->tmp253_lut_idx_a;
      voice->tmp256_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp253_lut_idx_a      ) & 15];
      voice->tmp257_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp253_lut_idx_a) + 1u) & 15];
      voice->tmp251_vsync = voice->tmp256_lut_a + (voice->tmp257_lut_b - voice->tmp256_lut_a) * voice->tmp255_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp251_vsync
      voice->tmp251_vsync = (voice->tmp251_vsync * 15.0f) + 1.0f;
      voice->tmp243_sin_tmp = ((voice->tmp231_sin_phase + voice->tmp244_phase));
      voice->tmp243_sin_tmp = voice->tmp243_sin_tmp * voice->tmp251_vsync;
      voice->tmp243_sin_tmp = ffrac_s(voice->tmp243_sin_tmp);
      voice->tmp230_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp243_sin_tmp)&16383u];
      voice->tmp231_sin_phase = ffrac_s(voice->tmp231_sin_phase + voice->tmp232_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp230_seq
      voice->tmp258_seq = 0.0625f;
      voice->tmp230_seq *= voice->tmp258_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp230_seq
      voice->tmp259_seq = voice->var_v_level;
      voice->tmp230_seq *= voice->tmp259_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp230_seq
      voice->tmp260_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp260_seq
      voice->tmp261_lut_f = (voice->tmp260_seq * 16);
      voice->tmp262_lut_idx_a = (int)voice->tmp261_lut_f;
      voice->tmp264_lut_frac = voice->tmp261_lut_f - (float)voice->tmp262_lut_idx_a;
      voice->tmp265_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp262_lut_idx_a      ) & 15];
      voice->tmp266_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp262_lut_idx_a) + 1u) & 15];
      voice->tmp260_seq = voice->tmp265_lut_a + (voice->tmp266_lut_b - voice->tmp265_lut_a) * voice->tmp264_lut_frac;
      voice->tmp230_seq *= voice->tmp260_seq;
      out += voice->tmp230_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp267_seq = voice->var_v_dampen;
      out *= voice->tmp267_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp271_freq
      voice->tmp271_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp271_freq
      voice->tmp272_lut_f = (voice->tmp271_freq * 16);
      voice->tmp273_lut_idx_a = (int)voice->tmp272_lut_f;
      voice->tmp275_lut_frac = voice->tmp272_lut_f - (float)voice->tmp273_lut_idx_a;
      voice->tmp276_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp273_lut_idx_a      ) & 15];
      voice->tmp277_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp273_lut_idx_a) + 1u) & 15];
      voice->tmp271_freq = voice->tmp276_lut_a + (voice->tmp277_lut_b - voice->tmp276_lut_a) * voice->tmp275_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp271_freq
      voice->tmp271_freq = (voice->tmp271_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp271_freq
      voice->tmp271_freq = loc_bipolar_to_scale(voice->tmp271_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp271_freq
      voice->tmp278_seq = 1.0f;
      voice->tmp271_freq -= voice->tmp278_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp271_freq
      voice->tmp279_seq = voice->var_v_det_amt;
      voice->tmp271_freq *= voice->tmp279_seq;
      
      // -- mod="1" dstVar=voice->tmp271_freq
      voice->tmp280_seq = 1.0f;
      voice->tmp271_freq += voice->tmp280_seq;
      voice->tmp270_sin_speed = voice->note_speed_cur * voice->tmp271_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp282_phase
      voice->tmp282_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp282_phase
      voice->tmp283_lut_f = (voice->tmp282_phase * 16);
      voice->tmp284_lut_idx_a = (int)voice->tmp283_lut_f;
      voice->tmp286_lut_frac = voice->tmp283_lut_f - (float)voice->tmp284_lut_idx_a;
      voice->tmp287_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp284_lut_idx_a      ) & 15];
      voice->tmp288_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp284_lut_idx_a) + 1u) & 15];
      voice->tmp282_phase = voice->tmp287_lut_a + (voice->tmp288_lut_b - voice->tmp287_lut_a) * voice->tmp286_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp289_vsync
      voice->tmp289_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp289_vsync
      voice->tmp290_lut_f = (voice->tmp289_vsync * 16);
      voice->tmp291_lut_idx_a = (int)voice->tmp290_lut_f;
      voice->tmp293_lut_frac = voice->tmp290_lut_f - (float)voice->tmp291_lut_idx_a;
      voice->tmp294_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp291_lut_idx_a      ) & 15];
      voice->tmp295_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp291_lut_idx_a) + 1u) & 15];
      voice->tmp289_vsync = voice->tmp294_lut_a + (voice->tmp295_lut_b - voice->tmp294_lut_a) * voice->tmp293_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp289_vsync
      voice->tmp289_vsync = (voice->tmp289_vsync * 15.0f) + 1.0f;
      voice->tmp281_sin_tmp = ((voice->tmp269_sin_phase + voice->tmp282_phase));
      voice->tmp281_sin_tmp = voice->tmp281_sin_tmp * voice->tmp289_vsync;
      voice->tmp281_sin_tmp = ffrac_s(voice->tmp281_sin_tmp);
      voice->tmp268_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp281_sin_tmp)&16383u];
      voice->tmp269_sin_phase = ffrac_s(voice->tmp269_sin_phase + voice->tmp270_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp268_seq
      voice->tmp296_seq = 0.0625f;
      voice->tmp268_seq *= voice->tmp296_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp268_seq
      voice->tmp297_seq = voice->var_v_level;
      voice->tmp268_seq *= voice->tmp297_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp268_seq
      voice->tmp298_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp298_seq
      voice->tmp299_lut_f = (voice->tmp298_seq * 16);
      voice->tmp300_lut_idx_a = (int)voice->tmp299_lut_f;
      voice->tmp302_lut_frac = voice->tmp299_lut_f - (float)voice->tmp300_lut_idx_a;
      voice->tmp303_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp300_lut_idx_a      ) & 15];
      voice->tmp304_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp300_lut_idx_a) + 1u) & 15];
      voice->tmp298_seq = voice->tmp303_lut_a + (voice->tmp304_lut_b - voice->tmp303_lut_a) * voice->tmp302_lut_frac;
      voice->tmp268_seq *= voice->tmp298_seq;
      out += voice->tmp268_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp305_seq = voice->var_v_dampen;
      out *= voice->tmp305_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp309_freq
      voice->tmp309_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp309_freq
      voice->tmp310_lut_f = (voice->tmp309_freq * 16);
      voice->tmp311_lut_idx_a = (int)voice->tmp310_lut_f;
      voice->tmp313_lut_frac = voice->tmp310_lut_f - (float)voice->tmp311_lut_idx_a;
      voice->tmp314_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp311_lut_idx_a      ) & 15];
      voice->tmp315_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp311_lut_idx_a) + 1u) & 15];
      voice->tmp309_freq = voice->tmp314_lut_a + (voice->tmp315_lut_b - voice->tmp314_lut_a) * voice->tmp313_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp309_freq
      voice->tmp309_freq = (voice->tmp309_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp309_freq
      voice->tmp309_freq = loc_bipolar_to_scale(voice->tmp309_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp309_freq
      voice->tmp316_seq = 1.0f;
      voice->tmp309_freq -= voice->tmp316_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp309_freq
      voice->tmp317_seq = voice->var_v_det_amt;
      voice->tmp309_freq *= voice->tmp317_seq;
      
      // -- mod="1" dstVar=voice->tmp309_freq
      voice->tmp318_seq = 1.0f;
      voice->tmp309_freq += voice->tmp318_seq;
      voice->tmp308_sin_speed = voice->note_speed_cur * voice->tmp309_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp320_phase
      voice->tmp320_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp320_phase
      voice->tmp321_lut_f = (voice->tmp320_phase * 16);
      voice->tmp322_lut_idx_a = (int)voice->tmp321_lut_f;
      voice->tmp324_lut_frac = voice->tmp321_lut_f - (float)voice->tmp322_lut_idx_a;
      voice->tmp325_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp322_lut_idx_a      ) & 15];
      voice->tmp326_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp322_lut_idx_a) + 1u) & 15];
      voice->tmp320_phase = voice->tmp325_lut_a + (voice->tmp326_lut_b - voice->tmp325_lut_a) * voice->tmp324_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp327_vsync
      voice->tmp327_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp327_vsync
      voice->tmp328_lut_f = (voice->tmp327_vsync * 16);
      voice->tmp329_lut_idx_a = (int)voice->tmp328_lut_f;
      voice->tmp331_lut_frac = voice->tmp328_lut_f - (float)voice->tmp329_lut_idx_a;
      voice->tmp332_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp329_lut_idx_a      ) & 15];
      voice->tmp333_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp329_lut_idx_a) + 1u) & 15];
      voice->tmp327_vsync = voice->tmp332_lut_a + (voice->tmp333_lut_b - voice->tmp332_lut_a) * voice->tmp331_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp327_vsync
      voice->tmp327_vsync = (voice->tmp327_vsync * 15.0f) + 1.0f;
      voice->tmp319_sin_tmp = ((voice->tmp307_sin_phase + voice->tmp320_phase));
      voice->tmp319_sin_tmp = voice->tmp319_sin_tmp * voice->tmp327_vsync;
      voice->tmp319_sin_tmp = ffrac_s(voice->tmp319_sin_tmp);
      voice->tmp306_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp319_sin_tmp)&16383u];
      voice->tmp307_sin_phase = ffrac_s(voice->tmp307_sin_phase + voice->tmp308_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp306_seq
      voice->tmp334_seq = 0.0625f;
      voice->tmp306_seq *= voice->tmp334_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp306_seq
      voice->tmp335_seq = voice->var_v_level;
      voice->tmp306_seq *= voice->tmp335_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp306_seq
      voice->tmp336_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp336_seq
      voice->tmp337_lut_f = (voice->tmp336_seq * 16);
      voice->tmp338_lut_idx_a = (int)voice->tmp337_lut_f;
      voice->tmp340_lut_frac = voice->tmp337_lut_f - (float)voice->tmp338_lut_idx_a;
      voice->tmp341_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp338_lut_idx_a      ) & 15];
      voice->tmp342_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp338_lut_idx_a) + 1u) & 15];
      voice->tmp336_seq = voice->tmp341_lut_a + (voice->tmp342_lut_b - voice->tmp341_lut_a) * voice->tmp340_lut_frac;
      voice->tmp306_seq *= voice->tmp336_seq;
      out += voice->tmp306_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp343_seq = voice->var_v_dampen;
      out *= voice->tmp343_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp347_freq
      voice->tmp347_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp347_freq
      voice->tmp348_lut_f = (voice->tmp347_freq * 16);
      voice->tmp349_lut_idx_a = (int)voice->tmp348_lut_f;
      voice->tmp351_lut_frac = voice->tmp348_lut_f - (float)voice->tmp349_lut_idx_a;
      voice->tmp352_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp349_lut_idx_a      ) & 15];
      voice->tmp353_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp349_lut_idx_a) + 1u) & 15];
      voice->tmp347_freq = voice->tmp352_lut_a + (voice->tmp353_lut_b - voice->tmp352_lut_a) * voice->tmp351_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp347_freq
      voice->tmp347_freq = (voice->tmp347_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp347_freq
      voice->tmp347_freq = loc_bipolar_to_scale(voice->tmp347_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp347_freq
      voice->tmp354_seq = 1.0f;
      voice->tmp347_freq -= voice->tmp354_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp347_freq
      voice->tmp355_seq = voice->var_v_det_amt;
      voice->tmp347_freq *= voice->tmp355_seq;
      
      // -- mod="1" dstVar=voice->tmp347_freq
      voice->tmp356_seq = 1.0f;
      voice->tmp347_freq += voice->tmp356_seq;
      voice->tmp346_sin_speed = voice->note_speed_cur * voice->tmp347_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp358_phase
      voice->tmp358_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp358_phase
      voice->tmp359_lut_f = (voice->tmp358_phase * 16);
      voice->tmp360_lut_idx_a = (int)voice->tmp359_lut_f;
      voice->tmp362_lut_frac = voice->tmp359_lut_f - (float)voice->tmp360_lut_idx_a;
      voice->tmp363_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp360_lut_idx_a      ) & 15];
      voice->tmp364_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp360_lut_idx_a) + 1u) & 15];
      voice->tmp358_phase = voice->tmp363_lut_a + (voice->tmp364_lut_b - voice->tmp363_lut_a) * voice->tmp362_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp365_vsync
      voice->tmp365_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp365_vsync
      voice->tmp366_lut_f = (voice->tmp365_vsync * 16);
      voice->tmp367_lut_idx_a = (int)voice->tmp366_lut_f;
      voice->tmp369_lut_frac = voice->tmp366_lut_f - (float)voice->tmp367_lut_idx_a;
      voice->tmp370_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp367_lut_idx_a      ) & 15];
      voice->tmp371_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp367_lut_idx_a) + 1u) & 15];
      voice->tmp365_vsync = voice->tmp370_lut_a + (voice->tmp371_lut_b - voice->tmp370_lut_a) * voice->tmp369_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp365_vsync
      voice->tmp365_vsync = (voice->tmp365_vsync * 15.0f) + 1.0f;
      voice->tmp357_sin_tmp = ((voice->tmp345_sin_phase + voice->tmp358_phase));
      voice->tmp357_sin_tmp = voice->tmp357_sin_tmp * voice->tmp365_vsync;
      voice->tmp357_sin_tmp = ffrac_s(voice->tmp357_sin_tmp);
      voice->tmp344_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp357_sin_tmp)&16383u];
      voice->tmp345_sin_phase = ffrac_s(voice->tmp345_sin_phase + voice->tmp346_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp344_seq
      voice->tmp372_seq = 0.0625f;
      voice->tmp344_seq *= voice->tmp372_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp344_seq
      voice->tmp373_seq = voice->var_v_level;
      voice->tmp344_seq *= voice->tmp373_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp344_seq
      voice->tmp374_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp374_seq
      voice->tmp375_lut_f = (voice->tmp374_seq * 16);
      voice->tmp376_lut_idx_a = (int)voice->tmp375_lut_f;
      voice->tmp378_lut_frac = voice->tmp375_lut_f - (float)voice->tmp376_lut_idx_a;
      voice->tmp379_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp376_lut_idx_a      ) & 15];
      voice->tmp380_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp376_lut_idx_a) + 1u) & 15];
      voice->tmp374_seq = voice->tmp379_lut_a + (voice->tmp380_lut_b - voice->tmp379_lut_a) * voice->tmp378_lut_frac;
      voice->tmp344_seq *= voice->tmp374_seq;
      out += voice->tmp344_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp381_seq = voice->var_v_dampen;
      out *= voice->tmp381_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp385_freq
      voice->tmp385_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp385_freq
      voice->tmp386_lut_f = (voice->tmp385_freq * 16);
      voice->tmp387_lut_idx_a = (int)voice->tmp386_lut_f;
      voice->tmp389_lut_frac = voice->tmp386_lut_f - (float)voice->tmp387_lut_idx_a;
      voice->tmp390_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp387_lut_idx_a      ) & 15];
      voice->tmp391_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp387_lut_idx_a) + 1u) & 15];
      voice->tmp385_freq = voice->tmp390_lut_a + (voice->tmp391_lut_b - voice->tmp390_lut_a) * voice->tmp389_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp385_freq
      voice->tmp385_freq = (voice->tmp385_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp385_freq
      voice->tmp385_freq = loc_bipolar_to_scale(voice->tmp385_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp385_freq
      voice->tmp392_seq = 1.0f;
      voice->tmp385_freq -= voice->tmp392_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp385_freq
      voice->tmp393_seq = voice->var_v_det_amt;
      voice->tmp385_freq *= voice->tmp393_seq;
      
      // -- mod="1" dstVar=voice->tmp385_freq
      voice->tmp394_seq = 1.0f;
      voice->tmp385_freq += voice->tmp394_seq;
      voice->tmp384_sin_speed = voice->note_speed_cur * voice->tmp385_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp396_phase
      voice->tmp396_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp396_phase
      voice->tmp397_lut_f = (voice->tmp396_phase * 16);
      voice->tmp398_lut_idx_a = (int)voice->tmp397_lut_f;
      voice->tmp400_lut_frac = voice->tmp397_lut_f - (float)voice->tmp398_lut_idx_a;
      voice->tmp401_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp398_lut_idx_a      ) & 15];
      voice->tmp402_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp398_lut_idx_a) + 1u) & 15];
      voice->tmp396_phase = voice->tmp401_lut_a + (voice->tmp402_lut_b - voice->tmp401_lut_a) * voice->tmp400_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp403_vsync
      voice->tmp403_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp403_vsync
      voice->tmp404_lut_f = (voice->tmp403_vsync * 16);
      voice->tmp405_lut_idx_a = (int)voice->tmp404_lut_f;
      voice->tmp407_lut_frac = voice->tmp404_lut_f - (float)voice->tmp405_lut_idx_a;
      voice->tmp408_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp405_lut_idx_a      ) & 15];
      voice->tmp409_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp405_lut_idx_a) + 1u) & 15];
      voice->tmp403_vsync = voice->tmp408_lut_a + (voice->tmp409_lut_b - voice->tmp408_lut_a) * voice->tmp407_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp403_vsync
      voice->tmp403_vsync = (voice->tmp403_vsync * 15.0f) + 1.0f;
      voice->tmp395_sin_tmp = ((voice->tmp383_sin_phase + voice->tmp396_phase));
      voice->tmp395_sin_tmp = voice->tmp395_sin_tmp * voice->tmp403_vsync;
      voice->tmp395_sin_tmp = ffrac_s(voice->tmp395_sin_tmp);
      voice->tmp382_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp395_sin_tmp)&16383u];
      voice->tmp383_sin_phase = ffrac_s(voice->tmp383_sin_phase + voice->tmp384_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp382_seq
      voice->tmp410_seq = 0.0625f;
      voice->tmp382_seq *= voice->tmp410_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp382_seq
      voice->tmp411_seq = voice->var_v_level;
      voice->tmp382_seq *= voice->tmp411_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp382_seq
      voice->tmp412_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp412_seq
      voice->tmp413_lut_f = (voice->tmp412_seq * 16);
      voice->tmp414_lut_idx_a = (int)voice->tmp413_lut_f;
      voice->tmp416_lut_frac = voice->tmp413_lut_f - (float)voice->tmp414_lut_idx_a;
      voice->tmp417_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp414_lut_idx_a      ) & 15];
      voice->tmp418_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp414_lut_idx_a) + 1u) & 15];
      voice->tmp412_seq = voice->tmp417_lut_a + (voice->tmp418_lut_b - voice->tmp417_lut_a) * voice->tmp416_lut_frac;
      voice->tmp382_seq *= voice->tmp412_seq;
      out += voice->tmp382_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp419_seq = voice->var_v_dampen;
      out *= voice->tmp419_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp423_freq
      voice->tmp423_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp423_freq
      voice->tmp424_lut_f = (voice->tmp423_freq * 16);
      voice->tmp425_lut_idx_a = (int)voice->tmp424_lut_f;
      voice->tmp427_lut_frac = voice->tmp424_lut_f - (float)voice->tmp425_lut_idx_a;
      voice->tmp428_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp425_lut_idx_a      ) & 15];
      voice->tmp429_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp425_lut_idx_a) + 1u) & 15];
      voice->tmp423_freq = voice->tmp428_lut_a + (voice->tmp429_lut_b - voice->tmp428_lut_a) * voice->tmp427_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp423_freq
      voice->tmp423_freq = (voice->tmp423_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp423_freq
      voice->tmp423_freq = loc_bipolar_to_scale(voice->tmp423_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp423_freq
      voice->tmp430_seq = 1.0f;
      voice->tmp423_freq -= voice->tmp430_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp423_freq
      voice->tmp431_seq = voice->var_v_det_amt;
      voice->tmp423_freq *= voice->tmp431_seq;
      
      // -- mod="1" dstVar=voice->tmp423_freq
      voice->tmp432_seq = 1.0f;
      voice->tmp423_freq += voice->tmp432_seq;
      voice->tmp422_sin_speed = voice->note_speed_cur * voice->tmp423_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp434_phase
      voice->tmp434_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp434_phase
      voice->tmp435_lut_f = (voice->tmp434_phase * 16);
      voice->tmp436_lut_idx_a = (int)voice->tmp435_lut_f;
      voice->tmp438_lut_frac = voice->tmp435_lut_f - (float)voice->tmp436_lut_idx_a;
      voice->tmp439_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp436_lut_idx_a      ) & 15];
      voice->tmp440_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp436_lut_idx_a) + 1u) & 15];
      voice->tmp434_phase = voice->tmp439_lut_a + (voice->tmp440_lut_b - voice->tmp439_lut_a) * voice->tmp438_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp441_vsync
      voice->tmp441_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp441_vsync
      voice->tmp442_lut_f = (voice->tmp441_vsync * 16);
      voice->tmp443_lut_idx_a = (int)voice->tmp442_lut_f;
      voice->tmp445_lut_frac = voice->tmp442_lut_f - (float)voice->tmp443_lut_idx_a;
      voice->tmp446_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp443_lut_idx_a      ) & 15];
      voice->tmp447_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp443_lut_idx_a) + 1u) & 15];
      voice->tmp441_vsync = voice->tmp446_lut_a + (voice->tmp447_lut_b - voice->tmp446_lut_a) * voice->tmp445_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp441_vsync
      voice->tmp441_vsync = (voice->tmp441_vsync * 15.0f) + 1.0f;
      voice->tmp433_sin_tmp = ((voice->tmp421_sin_phase + voice->tmp434_phase));
      voice->tmp433_sin_tmp = voice->tmp433_sin_tmp * voice->tmp441_vsync;
      voice->tmp433_sin_tmp = ffrac_s(voice->tmp433_sin_tmp);
      voice->tmp420_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp433_sin_tmp)&16383u];
      voice->tmp421_sin_phase = ffrac_s(voice->tmp421_sin_phase + voice->tmp422_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp420_seq
      voice->tmp448_seq = 0.0625f;
      voice->tmp420_seq *= voice->tmp448_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp420_seq
      voice->tmp449_seq = voice->var_v_level;
      voice->tmp420_seq *= voice->tmp449_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp420_seq
      voice->tmp450_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp450_seq
      voice->tmp451_lut_f = (voice->tmp450_seq * 16);
      voice->tmp452_lut_idx_a = (int)voice->tmp451_lut_f;
      voice->tmp454_lut_frac = voice->tmp451_lut_f - (float)voice->tmp452_lut_idx_a;
      voice->tmp455_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp452_lut_idx_a      ) & 15];
      voice->tmp456_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp452_lut_idx_a) + 1u) & 15];
      voice->tmp450_seq = voice->tmp455_lut_a + (voice->tmp456_lut_b - voice->tmp455_lut_a) * voice->tmp454_lut_frac;
      voice->tmp420_seq *= voice->tmp450_seq;
      out += voice->tmp420_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp457_seq = voice->var_v_dampen;
      out *= voice->tmp457_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp461_freq
      voice->tmp461_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp461_freq
      voice->tmp462_lut_f = (voice->tmp461_freq * 16);
      voice->tmp463_lut_idx_a = (int)voice->tmp462_lut_f;
      voice->tmp465_lut_frac = voice->tmp462_lut_f - (float)voice->tmp463_lut_idx_a;
      voice->tmp466_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp463_lut_idx_a      ) & 15];
      voice->tmp467_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp463_lut_idx_a) + 1u) & 15];
      voice->tmp461_freq = voice->tmp466_lut_a + (voice->tmp467_lut_b - voice->tmp466_lut_a) * voice->tmp465_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp461_freq
      voice->tmp461_freq = (voice->tmp461_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp461_freq
      voice->tmp461_freq = loc_bipolar_to_scale(voice->tmp461_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp461_freq
      voice->tmp468_seq = 1.0f;
      voice->tmp461_freq -= voice->tmp468_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp461_freq
      voice->tmp469_seq = voice->var_v_det_amt;
      voice->tmp461_freq *= voice->tmp469_seq;
      
      // -- mod="1" dstVar=voice->tmp461_freq
      voice->tmp470_seq = 1.0f;
      voice->tmp461_freq += voice->tmp470_seq;
      voice->tmp460_sin_speed = voice->note_speed_cur * voice->tmp461_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp472_phase
      voice->tmp472_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp472_phase
      voice->tmp473_lut_f = (voice->tmp472_phase * 16);
      voice->tmp474_lut_idx_a = (int)voice->tmp473_lut_f;
      voice->tmp476_lut_frac = voice->tmp473_lut_f - (float)voice->tmp474_lut_idx_a;
      voice->tmp477_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp474_lut_idx_a      ) & 15];
      voice->tmp478_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp474_lut_idx_a) + 1u) & 15];
      voice->tmp472_phase = voice->tmp477_lut_a + (voice->tmp478_lut_b - voice->tmp477_lut_a) * voice->tmp476_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp479_vsync
      voice->tmp479_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp479_vsync
      voice->tmp480_lut_f = (voice->tmp479_vsync * 16);
      voice->tmp481_lut_idx_a = (int)voice->tmp480_lut_f;
      voice->tmp483_lut_frac = voice->tmp480_lut_f - (float)voice->tmp481_lut_idx_a;
      voice->tmp484_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp481_lut_idx_a      ) & 15];
      voice->tmp485_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp481_lut_idx_a) + 1u) & 15];
      voice->tmp479_vsync = voice->tmp484_lut_a + (voice->tmp485_lut_b - voice->tmp484_lut_a) * voice->tmp483_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp479_vsync
      voice->tmp479_vsync = (voice->tmp479_vsync * 15.0f) + 1.0f;
      voice->tmp471_sin_tmp = ((voice->tmp459_sin_phase + voice->tmp472_phase));
      voice->tmp471_sin_tmp = voice->tmp471_sin_tmp * voice->tmp479_vsync;
      voice->tmp471_sin_tmp = ffrac_s(voice->tmp471_sin_tmp);
      voice->tmp458_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp471_sin_tmp)&16383u];
      voice->tmp459_sin_phase = ffrac_s(voice->tmp459_sin_phase + voice->tmp460_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp458_seq
      voice->tmp486_seq = 0.0625f;
      voice->tmp458_seq *= voice->tmp486_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp458_seq
      voice->tmp487_seq = voice->var_v_level;
      voice->tmp458_seq *= voice->tmp487_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp458_seq
      voice->tmp488_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp488_seq
      voice->tmp489_lut_f = (voice->tmp488_seq * 16);
      voice->tmp490_lut_idx_a = (int)voice->tmp489_lut_f;
      voice->tmp492_lut_frac = voice->tmp489_lut_f - (float)voice->tmp490_lut_idx_a;
      voice->tmp493_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp490_lut_idx_a      ) & 15];
      voice->tmp494_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp490_lut_idx_a) + 1u) & 15];
      voice->tmp488_seq = voice->tmp493_lut_a + (voice->tmp494_lut_b - voice->tmp493_lut_a) * voice->tmp492_lut_frac;
      voice->tmp458_seq *= voice->tmp488_seq;
      out += voice->tmp458_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp495_seq = voice->var_v_dampen;
      out *= voice->tmp495_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp499_freq
      voice->tmp499_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp499_freq
      voice->tmp500_lut_f = (voice->tmp499_freq * 16);
      voice->tmp501_lut_idx_a = (int)voice->tmp500_lut_f;
      voice->tmp503_lut_frac = voice->tmp500_lut_f - (float)voice->tmp501_lut_idx_a;
      voice->tmp504_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp501_lut_idx_a      ) & 15];
      voice->tmp505_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp501_lut_idx_a) + 1u) & 15];
      voice->tmp499_freq = voice->tmp504_lut_a + (voice->tmp505_lut_b - voice->tmp504_lut_a) * voice->tmp503_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp499_freq
      voice->tmp499_freq = (voice->tmp499_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp499_freq
      voice->tmp499_freq = loc_bipolar_to_scale(voice->tmp499_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp499_freq
      voice->tmp506_seq = 1.0f;
      voice->tmp499_freq -= voice->tmp506_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp499_freq
      voice->tmp507_seq = voice->var_v_det_amt;
      voice->tmp499_freq *= voice->tmp507_seq;
      
      // -- mod="1" dstVar=voice->tmp499_freq
      voice->tmp508_seq = 1.0f;
      voice->tmp499_freq += voice->tmp508_seq;
      voice->tmp498_sin_speed = voice->note_speed_cur * voice->tmp499_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp510_phase
      voice->tmp510_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp510_phase
      voice->tmp511_lut_f = (voice->tmp510_phase * 16);
      voice->tmp512_lut_idx_a = (int)voice->tmp511_lut_f;
      voice->tmp514_lut_frac = voice->tmp511_lut_f - (float)voice->tmp512_lut_idx_a;
      voice->tmp515_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp512_lut_idx_a      ) & 15];
      voice->tmp516_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp512_lut_idx_a) + 1u) & 15];
      voice->tmp510_phase = voice->tmp515_lut_a + (voice->tmp516_lut_b - voice->tmp515_lut_a) * voice->tmp514_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp517_vsync
      voice->tmp517_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp517_vsync
      voice->tmp518_lut_f = (voice->tmp517_vsync * 16);
      voice->tmp519_lut_idx_a = (int)voice->tmp518_lut_f;
      voice->tmp521_lut_frac = voice->tmp518_lut_f - (float)voice->tmp519_lut_idx_a;
      voice->tmp522_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp519_lut_idx_a      ) & 15];
      voice->tmp523_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp519_lut_idx_a) + 1u) & 15];
      voice->tmp517_vsync = voice->tmp522_lut_a + (voice->tmp523_lut_b - voice->tmp522_lut_a) * voice->tmp521_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp517_vsync
      voice->tmp517_vsync = (voice->tmp517_vsync * 15.0f) + 1.0f;
      voice->tmp509_sin_tmp = ((voice->tmp497_sin_phase + voice->tmp510_phase));
      voice->tmp509_sin_tmp = voice->tmp509_sin_tmp * voice->tmp517_vsync;
      voice->tmp509_sin_tmp = ffrac_s(voice->tmp509_sin_tmp);
      voice->tmp496_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp509_sin_tmp)&16383u];
      voice->tmp497_sin_phase = ffrac_s(voice->tmp497_sin_phase + voice->tmp498_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp496_seq
      voice->tmp524_seq = 0.0625f;
      voice->tmp496_seq *= voice->tmp524_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp496_seq
      voice->tmp525_seq = voice->var_v_level;
      voice->tmp496_seq *= voice->tmp525_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp496_seq
      voice->tmp526_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp526_seq
      voice->tmp527_lut_f = (voice->tmp526_seq * 16);
      voice->tmp528_lut_idx_a = (int)voice->tmp527_lut_f;
      voice->tmp530_lut_frac = voice->tmp527_lut_f - (float)voice->tmp528_lut_idx_a;
      voice->tmp531_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp528_lut_idx_a      ) & 15];
      voice->tmp532_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp528_lut_idx_a) + 1u) & 15];
      voice->tmp526_seq = voice->tmp531_lut_a + (voice->tmp532_lut_b - voice->tmp531_lut_a) * voice->tmp530_lut_frac;
      voice->tmp496_seq *= voice->tmp526_seq;
      out += voice->tmp496_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp533_seq = voice->var_v_dampen;
      out *= voice->tmp533_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp537_freq
      voice->tmp537_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp537_freq
      voice->tmp538_lut_f = (voice->tmp537_freq * 16);
      voice->tmp539_lut_idx_a = (int)voice->tmp538_lut_f;
      voice->tmp541_lut_frac = voice->tmp538_lut_f - (float)voice->tmp539_lut_idx_a;
      voice->tmp542_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp539_lut_idx_a      ) & 15];
      voice->tmp543_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp539_lut_idx_a) + 1u) & 15];
      voice->tmp537_freq = voice->tmp542_lut_a + (voice->tmp543_lut_b - voice->tmp542_lut_a) * voice->tmp541_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp537_freq
      voice->tmp537_freq = (voice->tmp537_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp537_freq
      voice->tmp537_freq = loc_bipolar_to_scale(voice->tmp537_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp537_freq
      voice->tmp544_seq = 1.0f;
      voice->tmp537_freq -= voice->tmp544_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp537_freq
      voice->tmp545_seq = voice->var_v_det_amt;
      voice->tmp537_freq *= voice->tmp545_seq;
      
      // -- mod="1" dstVar=voice->tmp537_freq
      voice->tmp546_seq = 1.0f;
      voice->tmp537_freq += voice->tmp546_seq;
      voice->tmp536_sin_speed = voice->note_speed_cur * voice->tmp537_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp548_phase
      voice->tmp548_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp548_phase
      voice->tmp549_lut_f = (voice->tmp548_phase * 16);
      voice->tmp550_lut_idx_a = (int)voice->tmp549_lut_f;
      voice->tmp552_lut_frac = voice->tmp549_lut_f - (float)voice->tmp550_lut_idx_a;
      voice->tmp553_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp550_lut_idx_a      ) & 15];
      voice->tmp554_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp550_lut_idx_a) + 1u) & 15];
      voice->tmp548_phase = voice->tmp553_lut_a + (voice->tmp554_lut_b - voice->tmp553_lut_a) * voice->tmp552_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp555_vsync
      voice->tmp555_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp555_vsync
      voice->tmp556_lut_f = (voice->tmp555_vsync * 16);
      voice->tmp557_lut_idx_a = (int)voice->tmp556_lut_f;
      voice->tmp559_lut_frac = voice->tmp556_lut_f - (float)voice->tmp557_lut_idx_a;
      voice->tmp560_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp557_lut_idx_a      ) & 15];
      voice->tmp561_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp557_lut_idx_a) + 1u) & 15];
      voice->tmp555_vsync = voice->tmp560_lut_a + (voice->tmp561_lut_b - voice->tmp560_lut_a) * voice->tmp559_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp555_vsync
      voice->tmp555_vsync = (voice->tmp555_vsync * 15.0f) + 1.0f;
      voice->tmp547_sin_tmp = ((voice->tmp535_sin_phase + voice->tmp548_phase));
      voice->tmp547_sin_tmp = voice->tmp547_sin_tmp * voice->tmp555_vsync;
      voice->tmp547_sin_tmp = ffrac_s(voice->tmp547_sin_tmp);
      voice->tmp534_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp547_sin_tmp)&16383u];
      voice->tmp535_sin_phase = ffrac_s(voice->tmp535_sin_phase + voice->tmp536_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp534_seq
      voice->tmp562_seq = 0.0625f;
      voice->tmp534_seq *= voice->tmp562_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp534_seq
      voice->tmp563_seq = voice->var_v_level;
      voice->tmp534_seq *= voice->tmp563_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp534_seq
      voice->tmp564_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp564_seq
      voice->tmp565_lut_f = (voice->tmp564_seq * 16);
      voice->tmp566_lut_idx_a = (int)voice->tmp565_lut_f;
      voice->tmp568_lut_frac = voice->tmp565_lut_f - (float)voice->tmp566_lut_idx_a;
      voice->tmp569_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp566_lut_idx_a      ) & 15];
      voice->tmp570_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp566_lut_idx_a) + 1u) & 15];
      voice->tmp564_seq = voice->tmp569_lut_a + (voice->tmp570_lut_b - voice->tmp569_lut_a) * voice->tmp568_lut_frac;
      voice->tmp534_seq *= voice->tmp564_seq;
      out += voice->tmp534_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp571_seq = voice->var_v_dampen;
      out *= voice->tmp571_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="sin" dstVar=out
      
      // ---- mod="sin" input "freq" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp575_freq
      voice->tmp575_freq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp575_freq
      voice->tmp576_lut_f = (voice->tmp575_freq * 16);
      voice->tmp577_lut_idx_a = (int)voice->tmp576_lut_f;
      voice->tmp579_lut_frac = voice->tmp576_lut_f - (float)voice->tmp577_lut_idx_a;
      voice->tmp580_lut_a = voice->eff_array_p_detune[( (unsigned int)voice->tmp577_lut_idx_a      ) & 15];
      voice->tmp581_lut_b = voice->eff_array_p_detune[(((unsigned int)voice->tmp577_lut_idx_a) + 1u) & 15];
      voice->tmp575_freq = voice->tmp580_lut_a + (voice->tmp581_lut_b - voice->tmp580_lut_a) * voice->tmp579_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp575_freq
      voice->tmp575_freq = (voice->tmp575_freq * 2.0f) + -1.0f;
      
      // -- mod="bts" dstVar=voice->tmp575_freq
      voice->tmp575_freq = loc_bipolar_to_scale(voice->tmp575_freq, 16.0f, 16.0f);
      
      // -- mod="1" dstVar=voice->tmp575_freq
      voice->tmp582_seq = 1.0f;
      voice->tmp575_freq -= voice->tmp582_seq;
      
      // -- mod="$v_det_amt" dstVar=voice->tmp575_freq
      voice->tmp583_seq = voice->var_v_det_amt;
      voice->tmp575_freq *= voice->tmp583_seq;
      
      // -- mod="1" dstVar=voice->tmp575_freq
      voice->tmp584_seq = 1.0f;
      voice->tmp575_freq += voice->tmp584_seq;
      voice->tmp574_sin_speed = voice->note_speed_cur * voice->tmp575_freq;
      
      // ---- mod="sin" input "phase" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp586_phase
      voice->tmp586_phase = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp586_phase
      voice->tmp587_lut_f = (voice->tmp586_phase * 16);
      voice->tmp588_lut_idx_a = (int)voice->tmp587_lut_f;
      voice->tmp590_lut_frac = voice->tmp587_lut_f - (float)voice->tmp588_lut_idx_a;
      voice->tmp591_lut_a = voice->eff_array_p_phase[( (unsigned int)voice->tmp588_lut_idx_a      ) & 15];
      voice->tmp592_lut_b = voice->eff_array_p_phase[(((unsigned int)voice->tmp588_lut_idx_a) + 1u) & 15];
      voice->tmp586_phase = voice->tmp591_lut_a + (voice->tmp592_lut_b - voice->tmp591_lut_a) * voice->tmp590_lut_frac;
      
      // ---- mod="sin" input "vsync" seq 1/1
      
      // -- mod="$v_index" dstVar=voice->tmp593_vsync
      voice->tmp593_vsync = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp593_vsync
      voice->tmp594_lut_f = (voice->tmp593_vsync * 16);
      voice->tmp595_lut_idx_a = (int)voice->tmp594_lut_f;
      voice->tmp597_lut_frac = voice->tmp594_lut_f - (float)voice->tmp595_lut_idx_a;
      voice->tmp598_lut_a = voice->eff_array_p_vsync[( (unsigned int)voice->tmp595_lut_idx_a      ) & 15];
      voice->tmp599_lut_b = voice->eff_array_p_vsync[(((unsigned int)voice->tmp595_lut_idx_a) + 1u) & 15];
      voice->tmp593_vsync = voice->tmp598_lut_a + (voice->tmp599_lut_b - voice->tmp598_lut_a) * voice->tmp597_lut_frac;
      
      // -- mod="fma" dstVar=voice->tmp593_vsync
      voice->tmp593_vsync = (voice->tmp593_vsync * 15.0f) + 1.0f;
      voice->tmp585_sin_tmp = ((voice->tmp573_sin_phase + voice->tmp586_phase));
      voice->tmp585_sin_tmp = voice->tmp585_sin_tmp * voice->tmp593_vsync;
      voice->tmp585_sin_tmp = ffrac_s(voice->tmp585_sin_tmp);
      voice->tmp572_seq = cycle_sine_tbl_f[(unsigned short)(16384 * voice->tmp585_sin_tmp)&16383u];
      voice->tmp573_sin_phase = ffrac_s(voice->tmp573_sin_phase + voice->tmp574_sin_speed);
      
      // -- mod="0.0625" dstVar=voice->tmp572_seq
      voice->tmp600_seq = 0.0625f;
      voice->tmp572_seq *= voice->tmp600_seq;
      
      // -- mod="$v_level" dstVar=voice->tmp572_seq
      voice->tmp601_seq = voice->var_v_level;
      voice->tmp572_seq *= voice->tmp601_seq;
      
      // -- mod="$v_index" dstVar=voice->tmp572_seq
      voice->tmp602_seq = voice->var_v_index;
      
      // -- mod="lut" dstVar=voice->tmp602_seq
      voice->tmp603_lut_f = (voice->tmp602_seq * 16);
      voice->tmp604_lut_idx_a = (int)voice->tmp603_lut_f;
      voice->tmp606_lut_frac = voice->tmp603_lut_f - (float)voice->tmp604_lut_idx_a;
      voice->tmp607_lut_a = voice->eff_array_p_mag[( (unsigned int)voice->tmp604_lut_idx_a      ) & 15];
      voice->tmp608_lut_b = voice->eff_array_p_mag[(((unsigned int)voice->tmp604_lut_idx_a) + 1u) & 15];
      voice->tmp602_seq = voice->tmp607_lut_a + (voice->tmp608_lut_b - voice->tmp607_lut_a) * voice->tmp606_lut_frac;
      voice->tmp572_seq *= voice->tmp602_seq;
      out += voice->tmp572_seq;
      
      // -- mod="sto v_out" dstVar=out
      voice->var_v_out = out;
      
      // -- mod="inc v_freq" dstVar=out
      voice->var_v_freq += 1;
      
      // -- mod="$v_level" dstVar=out
      out = voice->var_v_level;
      
      // -- mod="$v_dampen" dstVar=out
      voice->tmp609_seq = voice->var_v_dampen;
      out *= voice->tmp609_seq;
      
      // -- mod="sto v_level" dstVar=out
      voice->var_v_level = out;
      
      // -- mod="inc v_index" dstVar=out
      voice->var_v_index += 0.0625;
      
      // ========
      // ======== lane "out" modIdx=1
      // ========
      
      // -- mod="$v_out" dstVar=out
      out = voice->var_v_out;
      
      // -- mod="$v_amp" dstVar=out
      voice->tmp610_seq = voice->var_v_amp;
      out *= voice->tmp610_seq;
      
      // -- mod="clp" dstVar=out
      if(out > 0.999f) out = 0.999f;
      else if(out < -0.999f) out = -0.999f;

      /* end calc */

#ifdef OVERSAMPLE_FACTOR
         outOS += out;
#endif // OVERSAMPLE_FACTOR
      }
#ifdef OVERSAMPLE_FACTOR
      // Apply lowpass filter before downsampling
      //   (note) normalized Fc = F/Fs = 0.442947 / sqrt(oversample_factor² - 1)
      out = outOS * (1.0f / OVERSAMPLE_FACTOR);
#endif // OVERSAMPLE_FACTOR
      _samplesOut[k]      = out;
      _samplesOut[k + 1u] = out;

      // Next frame
      k += 2u;
      voice->note_speed_cur += voice->note_speed_inc;
      voice->mod_mag_cur           += voice->mod_mag_inc;
      voice->mod_center_cur        += voice->mod_center_inc;
      voice->mod_dampen_cur        += voice->mod_dampen_inc;
      voice->mod_amp_cur           += voice->mod_amp_inc;
      voice->mod_detune_cur        += voice->mod_detune_inc;
      voice->mod_phase_cur         += voice->mod_phase_inc;
      voice->mod_det_amt_cur       += voice->mod_det_amt_inc;
      voice->mod_vsync_cur         += voice->mod_vsync_inc;
   } /* loop numFrames */
}

static st_plugin_shared_t *ST_PLUGIN_API loc_shared_new(st_plugin_info_t *_info) {
   osc_additive16phase_v1_shared_t *ret = (osc_additive16phase_v1_shared_t *)malloc(sizeof(osc_additive16phase_v1_shared_t));
   if(NULL != ret)
   {
      memset((void*)ret, 0, sizeof(*ret));
      ret->base.info  = _info;
      memcpy((void*)ret->params, (void*)loc_param_resets, NUM_PARAMS * sizeof(float));

      // Initialize array param "p_mag" (sz=16 #var=8) variation 0 from exported bezier curve data
      {
         const unsigned int copySz = (16u/*curveDecl.size*/ < 16u/*curve LUT sz*/) ? 16u : 16u;
         const short *s = curve_0;
         float *d = &ret->array_p_mag[0/*varIdx*/][0];
         for(unsigned int i = 0u; i < copySz; i++)
            d[i] = s[i] * (1.0f / 2048.0f);
         ret->forced_varidx_p_mag = -1;
      }

      // Initialize array param "p_detune" (sz=16 #var=8) variation 0 from exported bezier curve data
      {
         const unsigned int copySz = (16u/*curveDecl.size*/ < 16u/*curve LUT sz*/) ? 16u : 16u;
         const short *s = curve_1;
         float *d = &ret->array_p_detune[0/*varIdx*/][0];
         for(unsigned int i = 0u; i < copySz; i++)
            d[i] = s[i] * (1.0f / 2048.0f);
         ret->forced_varidx_p_detune = -1;
      }

      // Initialize array param "p_phase" (sz=16 #var=8) variation 0 from exported bezier curve data
      {
         const unsigned int copySz = (16u/*curveDecl.size*/ < 16u/*curve LUT sz*/) ? 16u : 16u;
         const short *s = curve_2;
         float *d = &ret->array_p_phase[0/*varIdx*/][0];
         for(unsigned int i = 0u; i < copySz; i++)
            d[i] = s[i] * (1.0f / 2048.0f);
         ret->forced_varidx_p_phase = -1;
      }

      // Initialize array param "p_vsync" (sz=16 #var=8) variation 0 from exported bezier curve data
      {
         const unsigned int copySz = (16u/*curveDecl.size*/ < 16u/*curve LUT sz*/) ? 16u : 16u;
         const short *s = curve_3;
         float *d = &ret->array_p_vsync[0/*varIdx*/][0];
         for(unsigned int i = 0u; i < copySz; i++)
            d[i] = s[i] * (1.0f / 2048.0f);
         ret->forced_varidx_p_vsync = -1;
      }
   }
   return &ret->base;
}

static void ST_PLUGIN_API loc_shared_delete(st_plugin_shared_t *_shared) {
   free((void*)_shared);
}

static st_plugin_voice_t *ST_PLUGIN_API loc_voice_new(st_plugin_info_t *_info, unsigned int _voiceIdx) {
   osc_additive16phase_v1_voice_t *voice = (osc_additive16phase_v1_voice_t *)malloc(sizeof(osc_additive16phase_v1_voice_t));
   if(NULL != voice)
   {
      memset((void*)voice, 0, sizeof(*voice));
      voice->base.info = _info;
   }
   return &voice->base;
}

static void ST_PLUGIN_API loc_voice_delete(st_plugin_voice_t *_voice) {
   ST_PLUGIN_VOICE_CAST(osc_additive16phase_v1_voice_t);

   free((void*)_voice);
}

static void ST_PLUGIN_API loc_plugin_exit(st_plugin_info_t *_info) {
   free((void*)_info);
}

#ifdef USE_CYCLE_SINE_TBL
static void loc_calc_sine_tbl(void) {
#define QCOS_BITS 16
#define QCOS_ONE  (1 << QCOS_BITS)
#define QCOS_MASK (QCOS_ONE - 1)
   // (note) same as in TSR "C" implementation
   float *qcos = cycle_sine_tbl_f + 4096; // quarter cos tbl

   // calc quarter cos tbl
   int k = 0;
   for(int a = 0; a < (QCOS_ONE/4); a += (QCOS_ONE/16384)/*4*/)  // 4096 elements
   {
      int x = a - ((int)(QCOS_ONE * 0.25 + 0.5)) + ((a + ((int)(QCOS_ONE * 0.25 + 0.5)))&~QCOS_MASK);
      x = ((x * ((x<0?-x:x) - ((int)(QCOS_ONE * 0.5 + 0.5)))) >> QCOS_BITS) << 4;
      x += (((((int)(QCOS_ONE * 0.225 + 0.5)) * x) >> QCOS_BITS) * ((x<0?-x:x) - QCOS_ONE)) >> QCOS_BITS;
      qcos[k++] = x / float(QCOS_ONE);
   }

   // 0°..90° (rev qtbl)
   int j = 4096;
   k = 0;
   loop(4096)
      cycle_sine_tbl_f[k++] = qcos[--j];

   // 90..180° = cos tbl
   k += 4096;

   // 180°..360° (y-flip first half of tbl)
   j = 0;
   loop(8192)
      cycle_sine_tbl_f[k++] = -cycle_sine_tbl_f[j++];

#ifdef USE_CYCLE_SINE_TBL_I
   loop(16384)
      cycle_sine_tbl_i[i] = (short)(cycle_sine_tbl_f[i] * 2048.0f/*FX_ONE*/);
#endif // USE_CYCLE_SINE_TBL_I
}
#endif // USE_CYCLE_SINE_TBL

extern "C" {
st_plugin_info_t *osc_additive16phase_v1_init(void) {
   osc_additive16phase_v1_info_t *ret = (osc_additive16phase_v1_info_t *)malloc(sizeof(osc_additive16phase_v1_info_t));

   if(NULL != ret)
   {
      memset(ret, 0, sizeof(*ret));

      ret->base.api_version = ST_PLUGIN_API_VERSION;
      ret->base.id          = "osc_additive16phase_v1";  // unique id. don't change this in future builds.
      ret->base.author      = "bsp";
      ret->base.name        = "osc_additive16phase_v1";
      ret->base.short_name  = "osc_additive16phase_v1";
      ret->base.flags       = ST_PLUGIN_FLAG_OSC;
      ret->base.category    = ST_PLUGIN_CAT_UNKNOWN;
      ret->base.num_params  = NUM_PARAMS;
      ret->base.num_mods    = NUM_MODS;

      ret->base.shared_new                          = &loc_shared_new;
      ret->base.shared_delete                       = &loc_shared_delete;
      ret->base.voice_new                           = &loc_voice_new;
      ret->base.voice_delete                        = &loc_voice_delete;
      ret->base.get_param_name                      = &loc_get_param_name;
      ret->base.get_param_group_name                = &loc_get_param_group_name;
      ret->base.get_param_group_idx                 = &loc_get_param_group_idx;
      ret->base.get_param_reset                     = &loc_get_param_reset;
      ret->base.query_dynamic_param_preset_values   = &loc_query_dynamic_param_preset_values;
      ret->base.query_dynamic_param_preset_name     = &loc_query_dynamic_param_preset_name;
      ret->base.get_array_param_size                = &loc_get_array_param_size;
      ret->base.get_array_param_num_variations      = &loc_get_array_param_num_variations;
      ret->base.get_array_param_variation_ptr       = &loc_get_array_param_variation_ptr;
      ret->base.set_array_param_edit_variation_idx  = &loc_set_array_param_edit_variation_idx;
      ret->base.get_array_param_element_value_range = &loc_get_array_param_element_value_range;
      ret->base.get_param_value                     = &loc_get_param_value;
      ret->base.set_param_value                     = &loc_set_param_value;
      ret->base.get_mod_name                        = &loc_get_mod_name;
      ret->base.set_sample_rate                     = &loc_set_sample_rate;
      ret->base.note_on                             = &loc_note_on;
      ret->base.set_mod_value                       = &loc_set_mod_value;
      ret->base.prepare_block                       = &loc_prepare_block;
      ret->base.process_replace                     = &loc_process_replace;
      ret->base.plugin_exit                         = &loc_plugin_exit;

#ifdef USE_CYCLE_SINE_TBL
      loc_calc_sine_tbl();
#endif // USE_CYCLE_SINE_TBL
   }

   return &ret->base;
}

#ifndef STFX_SKIP_MAIN_INIT
ST_PLUGIN_APICALL st_plugin_info_t *ST_PLUGIN_API st_plugin_init(unsigned int _pluginIdx) {
   switch(_pluginIdx)
   {
      case 0u:
         return osc_additive16phase_v1_init();
   }
   return NULL;
}
#endif // STFX_SKIP_MAIN_INIT

} // extern "C"
