|
|
|
@ -363,8 +363,8 @@ void setup() |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < NUM_DEXED; i++) |
|
|
|
|
{ |
|
|
|
|
soften_filter_res[i].init(1.0, 0.0, 1.0); |
|
|
|
|
soften_filter_cut[i].init(1.0, 0.0, 1.0); |
|
|
|
|
soften_filter_res[i].init(1.0); |
|
|
|
|
soften_filter_cut[i].init(1.0); |
|
|
|
|
MicroDexed[i]->fx.Gain = 1.0; |
|
|
|
|
MicroDexed[i]->fx.Reso = 1.0; |
|
|
|
|
MicroDexed[i]->fx.Cutoff = 1.0; |
|
|
|
@ -372,7 +372,7 @@ void setup() |
|
|
|
|
|
|
|
|
|
// set initial volume and pan (read from EEPROM)
|
|
|
|
|
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) |
|
|
|
|
// Initialize processor and memory measurements
|
|
|
|
@ -997,11 +997,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 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
|
|
|
|
|
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2)); |
|
|
|
|
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2)); |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Setting volume: VOL=")); |
|
|
|
|
Serial.print(v, DEC); |
|
|
|
@ -1017,26 +1012,25 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
|
Serial.println(tmp3 * cosf(tmp2 * PI / 2), 3); |
|
|
|
|
#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) |
|
|
|
|
{ |
|
|
|
|
case 0: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
stereomono1.stereo(true); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
volume_r.gain(1.0); |
|
|
|
|
volume_l.gain(0.0); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
volume_r.gain(0.0); |
|
|
|
|
volume_l.gain(1.0); |
|
|
|
|
stereomono1.stereo(false); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|