|
|
@ -363,8 +363,8 @@ void setup() |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < NUM_DEXED; i++) |
|
|
|
for (uint8_t i = 0; i < NUM_DEXED; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
soften_filter_res[i].init(1.0, 0.0, 1.0); |
|
|
|
soften_filter_res[i].init(1.0); |
|
|
|
soften_filter_cut[i].init(1.0, 0.0, 1.0); |
|
|
|
soften_filter_cut[i].init(1.0); |
|
|
|
MicroDexed[i]->fx.Gain = 1.0; |
|
|
|
MicroDexed[i]->fx.Gain = 1.0; |
|
|
|
MicroDexed[i]->fx.Reso = 1.0; |
|
|
|
MicroDexed[i]->fx.Reso = 1.0; |
|
|
|
MicroDexed[i]->fx.Cutoff = 1.0; |
|
|
|
MicroDexed[i]->fx.Cutoff = 1.0; |
|
|
@ -372,7 +372,7 @@ void setup() |
|
|
|
|
|
|
|
|
|
|
|
// set initial volume and pan (read from EEPROM)
|
|
|
|
// set initial volume and pan (read from EEPROM)
|
|
|
|
set_volume(configuration.vol, configuration.pan, configuration.mono); |
|
|
|
set_volume(configuration.vol, configuration.pan, configuration.mono); |
|
|
|
soften_volume.init(configuration.vol, VOLUME_MIN, VOLUME_MAX); |
|
|
|
soften_volume.init(configuration.vol); |
|
|
|
|
|
|
|
|
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
// Initialize processor and memory measurements
|
|
|
|
// Initialize processor and memory measurements
|
|
|
@ -996,10 +996,6 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
float tmp2 = mapfloat(configuration.pan, PANORAMA_MIN, PANORAMA_MAX, 0.0, 1.0); |
|
|
|
float tmp2 = mapfloat(configuration.pan, PANORAMA_MIN, PANORAMA_MAX, 0.0, 1.0); |
|
|
|
float tmp3 = (float)(tmp * (tmp + 2)) / (float)(1 << 20); |
|
|
|
float tmp3 = (float)(tmp * (tmp + 2)) / (float)(1 << 20); |
|
|
|
|
|
|
|
|
|
|
|
// float v = (float)(a * (a + 2))/(float)(1 << 20); // (pseudo-) logarithmic curve for volume control
|
|
|
|
|
|
|
|
// http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.print(F("Setting volume: VOL=")); |
|
|
|
Serial.print(F("Setting volume: VOL=")); |
|
|
|
Serial.print(v, DEC); |
|
|
|
Serial.print(v, DEC); |
|
|
@ -1015,26 +1011,25 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
Serial.println(tmp3 * cosf(tmp2 * PI / 2), 3); |
|
|
|
Serial.println(tmp3 * cosf(tmp2 * PI / 2), 3); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// float v = (float)(a * (a + 2))/(float)(1 << 20); // (pseudo-) logarithmic curve for volume control
|
|
|
|
|
|
|
|
// http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html
|
|
|
|
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
|
|
|
|
switch (m) |
|
|
|
switch (m) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
stereomono1.stereo(true); |
|
|
|
stereomono1.stereo(true); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
volume_l.gain(0.0); |
|
|
|
volume_l.gain(0.0); |
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
volume_r.gain(0.0); |
|
|
|
volume_r.gain(0.0); |
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|