From 64998dfdcdee751cb8d4a7ab2709823412fcbe3a Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 16 Jan 2019 17:28:35 +0100 Subject: [PATCH] Reduced volume inside MDAEPiano due to digital distortion... --- MicroMDAEPiano.ino | 2 ++ UI.cpp | 2 ++ UI.h | 2 ++ config.h | 2 +- mdaEPiano.cpp | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/MicroMDAEPiano.ino b/MicroMDAEPiano.ino index 6d2c8b3..5dc7013 100644 --- a/MicroMDAEPiano.ino +++ b/MicroMDAEPiano.ino @@ -127,6 +127,7 @@ void setup() Serial.begin(SERIAL_SPEED); delay(220); +/* // LCD display setup lcd.init(); lcd.blink_off(); @@ -145,6 +146,7 @@ void setup() enc_val[1] = enc[1].read(); but[0].update(); but[1].update(); +*/ // Debug output Serial.println(F("MicroMDAEPiano based on https://sourceforge.net/projects/mda-vst")); diff --git a/UI.cpp b/UI.cpp index 3ae2852..4748da6 100644 --- a/UI.cpp +++ b/UI.cpp @@ -24,6 +24,7 @@ #include "config.h" #include "UI.h" +/* UI::UI() { LiquidCrystalPlus_I2C lcd(LCD_I2C_ADDRESS, LCD_CHARS, LCD_LINES); @@ -31,3 +32,4 @@ UI::UI() enc_val[] = {INITIAL_ENC_L_VALUE, INITIAL_ENC_R_VALUE}; but[] = {Bounce(BUT_L_PIN, BUT_DEBOUNCE_MS), Bounce(BUT_R_PIN, BUT_DEBOUNCE_MS)}; } +*/ diff --git a/UI.h b/UI.h index 94eca72..cd3069b 100644 --- a/UI.h +++ b/UI.h @@ -24,6 +24,7 @@ #ifndef UI_H_INCLUDED #define UI_H_INCLUDED +/* #include "config.h" #include "LiquidCrystalPlus_I2C.h" #include @@ -41,4 +42,5 @@ class UI int32_t enc_val[2]; Bounce but[2]; } +*/ #endif diff --git a/config.h b/config.h index 798eb21..3519c03 100644 --- a/config.h +++ b/config.h @@ -55,7 +55,7 @@ #define VOLUME 0.8 #define AUDIO_MEM 128 #define SAMPLE_RATE 44100 -#define REDUCE_LOUDNESS 1 +#define REDUCE_LOUDNESS 0 #define USE_XFADE_DATA 1 //************************************************************************************************* diff --git a/mdaEPiano.cpp b/mdaEPiano.cpp index 4dae120..6dd1538 100644 --- a/mdaEPiano.cpp +++ b/mdaEPiano.cpp @@ -228,6 +228,9 @@ void mdaEPiano::process(int16_t* outputs_r, int16_t* outputs_l) l += l * lmod * lfo1; r += r * rmod * lfo1; //worth making all these local variables? + r*=0.5; + l*=0.5; + if (r > 1.0) r = 1.0; else if (r < -1.0)