From 281e435bfa70a593c9f7ed3f3f61524be721c2eb Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Thu, 26 Mar 2020 16:16:15 +0100 Subject: [PATCH] Another fix for stereo/mono implementation. --- MicroDexed.ino | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 490a7a9..b0368c2 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -224,7 +224,6 @@ const uint8_t cs_pins[] = { SDCARD_TEENSY_CS_PIN, SDCARD_AUDIO_CS_PIN }; const uint8_t mosi_pins[] = { SDCARD_TEENSY_MOSI_PIN, SDCARD_AUDIO_MOSI_PIN }; const uint8_t sck_pins[] = { SDCARD_TEENSY_SCK_PIN, SDCARD_AUDIO_SCK_PIN }; char version_string[LCD_cols + 1]; -int8_t config_pan[NUM_DEXED]; #if defined(USE_FX) // Allocate the delay lines for chorus @@ -512,7 +511,6 @@ void setup() // PANORAMA mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); - config_pan[instance_id] = -1; } #if defined(USE_FX) @@ -1271,42 +1269,27 @@ void set_volume(uint8_t v, uint8_t m) case 0: // stereo stereo2mono.stereo(true); for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { - if (config_pan[instance_id] >= 0) - configuration.dexed[instance_id].pan = config_pan[instance_id]; mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); - } modchorus_inverter.gain(-1.0); // stereo mode break; case 1: // mono both stereo2mono.stereo(false); for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { - config_pan[instance_id] = configuration.dexed[instance_id].pan; - configuration.dexed[instance_id].pan = PANORAMA_DEFAULT; - } + mono2stereo[instance_id]->panorama(mapfloat(PANORAMA_DEFAULT, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); modchorus_inverter.gain(1.0); break; case 2: // mono right volume_l.gain(0.0); stereo2mono.stereo(false); for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { - config_pan[instance_id] = configuration.dexed[instance_id].pan; - configuration.dexed[instance_id].pan = 0.0; - mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); - } + mono2stereo[instance_id]->panorama(mapfloat(PANORAMA_MAX, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); modchorus_inverter.gain(1.0); break; case 3: // mono left volume_r.gain(0.0); stereo2mono.stereo(false); for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - { - config_pan[instance_id] = configuration.dexed[instance_id].pan; - configuration.dexed[instance_id].pan = 1.0; - mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); - } + mono2stereo[instance_id]->panorama(mapfloat(PANORAMA_MIN, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); modchorus_inverter.gain(1.0); break; } @@ -1550,8 +1533,6 @@ void eeprom_update(void) autostore = 0; else { - if (config_pan[instance_id] >= 0) - configuration.dexed[instance_id].pan = config_pan[instance_id]; eeprom_update_flag = false; configuration.checksum = crc32((byte*)&configuration + 4, sizeof(configuration) - 4); EEPROM.put(EEPROM_START_ADDRESS, configuration);