diff --git a/MicroDexed.ino b/MicroDexed.ino index 6a9414e..669ebba 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -95,8 +95,8 @@ uint8_t voice = 0; float vol = VOLUME; float vol_right = 1.0; float vol_left = 1.0; -char bank_name[10]; -char voice_name[10]; +char bank_name[11]; +char voice_name[11]; #ifdef MASTER_KEY_MIDI bool master_key_enabled = false; #endif @@ -227,6 +227,7 @@ void setup() #endif #ifdef I2C_DISPLAY + lcd.clear(); lcd.show(0, 0, 2, bank); lcd.show(0, 2, 1, " "); lcd.show(0, 3, 10, bank_name); @@ -917,4 +918,3 @@ void note_off(void) show_patch(); } #endif - diff --git a/config.h b/config.h index f99104c..0588ef1 100644 --- a/config.h +++ b/config.h @@ -99,4 +99,3 @@ #define EEPROM_MASTER_VOLUME_ADDR 2 #define EEPROM_VOLUME_RIGHT_ADDR 3 #define EEPROM_VOLUME_LEFT_ADDR 4 - diff --git a/dexed.h b/dexed.h index 218b179..b2b7f65 100644 --- a/dexed.h +++ b/dexed.h @@ -44,7 +44,7 @@ extern float vol; extern float vol_right; extern float vol_left; extern void set_volume(float master_volume, float volume_right, float volume_left); -extern char voice_name[10]; +extern char voice_name[11]; struct ProcessorVoice { uint8_t midi_note; diff --git a/dexed_sysex.cpp b/dexed_sysex.cpp index d3be7f3..acd5a44 100644 --- a/dexed_sysex.cpp +++ b/dexed_sysex.cpp @@ -63,7 +63,7 @@ bool get_bank_name(uint8_t b) else { if (!entry.isDirectory()) - strncpy(bank_name, entry.name(), strlen(bank_name) - 1); + strcpy(bank_name, entry.name()); } } } @@ -80,10 +80,10 @@ bool load_sysex(uint8_t b, uint8_t v) if (sd_card_available) { - char bankdir[3]; + char bankdir[4]; + memset(bankdir, 0, sizeof(bankdir)); bankdir[0] = '/'; - bankdir[2] = '\0'; itoa(b, &bankdir[1], 10); root = SD.open(bankdir); @@ -122,7 +122,7 @@ bool load_sysex(uint8_t b, uint8_t v) Serial.println(F("]")); #endif - strncpy(bank_name, entry.name(), strlen(bank_name) - 1); + strcpy(bank_name, entry.name()); return (dexed->loadSysexVoice(data)); } diff --git a/dexed_sysex.h b/dexed_sysex.h index 598bdf6..ff6a30c 100644 --- a/dexed_sysex.h +++ b/dexed_sysex.h @@ -33,8 +33,8 @@ extern Dexed* dexed; extern uint16_t render_time_max; extern uint8_t bank; extern uint8_t voice; -extern char bank_name[10]; -extern char voice_name[10]; +extern char bank_name[11]; +extern char voice_name[11]; extern LiquidCrystalPlus_I2C lcd; bool get_bank_name(uint8_t b);