Several small fixes.

master
Holger Wirtz 6 years ago
parent 711f4be2ff
commit a48f996232
  1. 13
      MicroMDAEPiano.ino
  2. 18
      config.h

@ -153,8 +153,6 @@ elapsedMillis eeprom_master_volume_update_timer;
elapsedMillis cpu_mem_millis;
#endif
// Number of samples in each delay line
#define CHORUS_DELAY_LENGTH (16*AUDIO_BLOCK_SAMPLES)
// Allocate the delay lines for left and right channels
short l_delayline[CHORUS_DELAY_LENGTH];
short r_delayline[CHORUS_DELAY_LENGTH];
@ -215,8 +213,13 @@ void setup()
Serial.println(F("PT8211 enabled."));
#endif
// set master volume
set_master_volume(master_volume);
// internal mixing of original signal(0), reverb(1) and chorus(2)
mixer_r.gain(0, 1.0);
mixer_l.gain(0, 1.0);
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC)
// Initialize processor and memory measurements
AudioProcessorUsageMaxReset();
@ -241,7 +244,7 @@ void setup()
// chorus modulation fixed
memset(r_delayline, 0, sizeof(short)*CHORUS_DELAY_LENGTH);
memset(l_delayline, 0, sizeof(short)*CHORUS_DELAY_LENGTH);
modulator.begin(WAVEFORM_TRIANGLE);
modulator.begin(CHORUS_WAVEFORM);
modulator.amplitude(0.1);
modulator.frequency(1.0);
modulator.phase(0);
@ -508,8 +511,8 @@ void set_master_volume(uint8_t value)
// float v = (float)(a * (a + 2))/(float)(1 << 20); // (pseudo-) logarithmic curve for volume control
// http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html
mixer_r.gain(0, tmp3 * sinf(tmp2 * PI / 2));
mixer_l.gain(0, tmp3 * cosf(tmp2 * PI / 2));
volume_r.gain(tmp3 * sinf(tmp2 * PI / 2));
volume_l.gain(tmp3 * cosf(tmp2 * PI / 2));
eeprom_master_volume_update_flag = true;
eeprom_master_volume_update_timer = 0;

@ -56,13 +56,15 @@
//*************************************************************************************************
#define VOLUME 0.8
#define VOLUME_CURVE 0.07
#define AUDIO_MEM 128
#define SAMPLE_RATE 44100
#define SAMPLE_RATE AUDIO_SAMPLE_RATE
#define REDUCE_LOUDNESS 0
#define USE_XFADE_DATA 1
#define INTERPOLATION_WINDOW_SIZE 7 // For chorus, only odd numbers!
// CHORUS parameters
#define INTERPOLATION_WINDOW_SIZE 7 // For chorus, only odd numbers,please!
#define INTERPOLATE CUBIC // LINEAR COSINE LAGRANGE QUADRATIC
#define CHORUS_WAVEFORM WAVEFORM_TRIANGLE // WAVEFORM_SINEWAVEFORM_SAWTOOTH WAVEFORM_SAWTOOTH_REVERSE WAVEFORM_SQUARE WAVEFORM_TRIANGLE
#define CHORUS_DELAY_LENGTH (16*AUDIO_BLOCK_SAMPLES)
//*************************************************************************************************
//* DEBUG OUTPUT SETTINGS
@ -137,7 +139,7 @@
//* DO NO CHANGE ANYTHING BEYOND IF YOU DON'T KNOW WHAT YOU ARE DOING !!!
//*************************************************************************************************
#define MICRO_MDAEPIANO_VERSION "0.9.1"
#define MICRO_MDAEPIANO_VERSION "0.9.3"
#define MAX_SOUNDS min(99,int((4096-EEPROM_CONFIGURATIONS)/sizeof(config_t)))
@ -148,19 +150,19 @@
// Encoder min/max values
#define ENC_DECAY_MIN 0
#define ENC_DECAY_MAX 99
#define ENC_DECAY_DEFAULT 49
#define ENC_DECAY_DEFAULT 50
//
#define ENC_RELEASE_MIN 0
#define ENC_RELEASE_MAX 99
#define ENC_RELEASE_DEFAULT 49
#define ENC_RELEASE_DEFAULT 50
//
#define ENC_HARDNESS_MIN 0
#define ENC_HARDNESS_MAX 99
#define ENC_HARDNESS_DEFAULT 49
#define ENC_HARDNESS_DEFAULT 50
//
#define ENC_TREBLE_MIN 0
#define ENC_TREBLE_MAX 99
#define ENC_TREBLE_DEFAULT 49
#define ENC_TREBLE_DEFAULT 50
//
#define ENC_STEREO_MIN 0
#define ENC_STEREO_MAX 99

Loading…
Cancel
Save