Several fixes.

dev
Holger Wirtz 6 years ago
parent 0d7652dd82
commit 223a7eb3d2
  1. 3
      MicroMDAEPiano.ino
  2. 6
      UI.hpp
  3. 27
      config.h
  4. 4
      mdaEPiano.cpp

@ -181,8 +181,6 @@ void setup()
sgtl5000_1.unmuteHeadphone();
sgtl5000_1.unmuteLineout();
//sgtl5000_1.autoVolumeDisable(); // turn off AGC
sgtl5000_1.unmuteHeadphone();
sgtl5000_1.volume(0.5, 0.5); // Headphone volume
sgtl5000_1.lineOutLevel(SGTL5000_LINEOUT_LEVEL);
sgtl5000_1.audioPostProcessorEnable();
sgtl5000_1.eqSelect(TONE_CONTROLS);
@ -212,7 +210,6 @@ void setup()
Serial.println(F("PT8211 enabled."));
#endif
//set_volume(vol, vol_left, vol_right);
set_master_volume(master_volume);
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC)

@ -1796,9 +1796,9 @@ void set_loudness(uint8_t value)
Serial.print(F("Set LOUDNESS "));
Serial.println(value);
#endif
float tmp = mapfloat(float(value), ENC_LOUDNESS_MIN, ENC_LOUDNESS_MAX, 0.0, 1.0);
volume_r.gain(tmp);
volume_l.gain(tmp);
configuration._loudness = mapfloat(float(value), ENC_LOUDNESS_MIN, ENC_LOUDNESS_MAX, 0.0, 1.0);
//volume_r.gain(tmp);
//volume_l.gain(tmp);
}
void set_complete_configuration(void)

@ -139,9 +139,9 @@
#define ENC_TRANSPOSE_MAX 24
#define ENC_TRANSPOSE_DEFAULT 0
//
#define ENC_TUNE_MIN 0
#define ENC_TUNE_MAX 99
#define ENC_TUNE_DEFAULT 49
#define ENC_TUNE_MIN -50
#define ENC_TUNE_MAX 50
#define ENC_TUNE_DEFAULT 0
//
#define ENC_DETUNE_MIN 0
#define ENC_DETUNE_MAX 99
@ -164,28 +164,28 @@
#define ENC_OVERDRIVE_DEFAULT 50
//
#define ENC_COMP_GAIN_MIN 0
#define ENC_COMP_GAIN_MAX 99
#define ENC_COMP_GAIN_DEFAULT 99
#define ENC_COMP_GAIN_MAX 2
#define ENC_COMP_GAIN_DEFAULT 0
//
#define ENC_COMP_RESPONSE_MIN 0
#define ENC_COMP_RESPONSE_MAX 99
#define ENC_COMP_RESPONSE_DEFAULT 99
#define ENC_COMP_RESPONSE_MAX 3
#define ENC_COMP_RESPONSE_DEFAULT 1
//
#define ENC_COMP_LIMIT_MIN 0
#define ENC_COMP_LIMIT_MAX 99
#define ENC_COMP_LIMIT_DEFAULT 99
#define ENC_COMP_LIMIT_MAX 1
#define ENC_COMP_LIMIT_DEFAULT 1
//
#define ENC_COMP_THRESHOLD_MIN 0
#define ENC_COMP_THRESHOLD_MAX 99
#define ENC_COMP_THRESHOLD_DEFAULT 90
#define ENC_COMP_THRESHOLD_MAX 96
#define ENC_COMP_THRESHOLD_DEFAULT 18
//
#define ENC_COMP_ATTACK_MIN 0
#define ENC_COMP_ATTACK_MAX 99
#define ENC_COMP_ATTACK_DEFAULT 1
#define ENC_COMP_ATTACK_DEFAULT 20
//
#define ENC_COMP_DECAY_MIN 0
#define ENC_COMP_DECAY_MAX 99
#define ENC_COMP_DECAY_DEFAULT 5
#define ENC_COMP_DECAY_DEFAULT 40
//
#define ENC_REVERB_ROOMSIZE_MIN 0
#define ENC_REVERB_ROOMSIZE_MAX 99
@ -317,6 +317,7 @@ struct config_t {
uint8_t eq_bass;
uint8_t eq_treble;
uint8_t loudness;
float _loudness;
uint8_t midi_channel;
uint8_t midi_soft_thru;
uint8_t max_poly;

@ -240,8 +240,8 @@ void mdaEPiano::process(int16_t* outputs_r, int16_t* outputs_l)
l = 1.0;
else if (l < -1.0)
l = -1.0;
outputs_l[frame] = static_cast<int16_t>(l * configuration.loudness * 0x7fff) >> REDUCE_LOUDNESS;
outputs_r[frame] = static_cast<int16_t>(r * configuration.loudness * 0x7fff) >> REDUCE_LOUDNESS;
outputs_l[frame] = static_cast<int16_t>(l * configuration._loudness * 0x7fff) >> REDUCE_LOUDNESS;
outputs_r[frame] = static_cast<int16_t>(r * configuration._loudness * 0x7fff) >> REDUCE_LOUDNESS;
}
if (fabs(tl) < 1.0e-10) tl = 0.0f; //anti-denormal

Loading…
Cancel
Save