|
|
|
@ -130,7 +130,7 @@ config_t configuration = { |
|
|
|
|
ENC_REVERB_LEVEL_DEFAULT, // reverb_level
|
|
|
|
|
ENC_CHORUS_FREQUENCY_DEFAULT, // chorus_frequency
|
|
|
|
|
ENC_CHORUS_DELAY_DEFAULT, // chorus_delay
|
|
|
|
|
ENC_CHORUS_INTENSITY_DEFAULT, // chorus_intensity
|
|
|
|
|
ENC_CHORUS_INTENSITY_DEFAULT, // chorus_intensity
|
|
|
|
|
ENC_CHORUS_LEVEL_DEFAULT, // chorus_level
|
|
|
|
|
ENC_BASS_LR_LEVEL_DEFAULT, // bass_lr_level
|
|
|
|
|
ENC_BASS_MONO_LEVEL_DEFAULT, // bass_mono_level
|
|
|
|
@ -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; |
|
|
|
|