From 7c7ba7ac0b12b7ec84a5a03f50fc1ba1ff51990e Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 15 Mar 2020 18:10:36 +0100 Subject: [PATCH] Fix for peak detection. Reduced max notes to 12 for T_3.6 with FX. --- MicroDexed.ino | 8 ++++---- config.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 6f2dcc4..01b3c28 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -270,7 +270,7 @@ void setup() #ifdef DEBUG char version_string[LCD_cols + 1]; generate_version_string(version_string, sizeof(version_string)); - + Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); Serial.println(F("(c)2018-2020 H. Wirtz ")); Serial.println(F("https://codeberg.org/dcoredump/MicroDexed")); @@ -672,10 +672,10 @@ void loop() if (cpu_mem_millis >= SHOW_CPU_LOAD_MSEC) { if (master_peak_r.available()) - if (master_peak_r.read() > 0.99) + if (master_peak_r.read() == 1.0) peak_r++; if (master_peak_l.available()) - if (master_peak_l.read() > 0.99) + if (master_peak_l.read() == 1.0) peak_l++; if (microdexed_peak.available()) { @@ -1592,12 +1592,12 @@ void generate_version_string(char* buffer, uint8_t len) itoa (MAX_NOTES, tmp, 10); strncat(buffer, tmp, 2); #endif + buffer[len] = '\0'; } /****************************************************************************** DEBUG HELPER ******************************************************************************/ - #if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) void show_cpu_and_mem_usage(void) { diff --git a/config.h b/config.h index 2b26da2..37b5def 100644 --- a/config.h +++ b/config.h @@ -252,7 +252,7 @@ enum { DEXED, CHORUS, DELAY, REVERB}; // Teensy-3.6 settings #define MIDI_DEVICE_USB_HOST 1 #if defined(USE_FX) -#define MAX_NOTES 13 +#define MAX_NOTES 12 #else #define MAX_NOTES 16 #endif