|
|
@ -216,7 +216,7 @@ uint8_t active_voices[NUM_DEXED]; |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
#ifdef SHOW_CPU_LOAD_MSEC |
|
|
|
elapsedMillis cpu_mem_millis; |
|
|
|
elapsedMillis cpu_mem_millis; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
//uint32_t overload = 0;
|
|
|
|
uint32_t cpumax = 0; |
|
|
|
uint32_t peak_dexed = 0; |
|
|
|
uint32_t peak_dexed = 0; |
|
|
|
float peak_dexed_value = 0.0; |
|
|
|
float peak_dexed_value = 0.0; |
|
|
|
uint32_t peak_r = 0; |
|
|
|
uint32_t peak_r = 0; |
|
|
@ -773,8 +773,9 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
set_master_mixer_gain(DELAY, configuration.delay_level / 100.0); |
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
//master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
|
|
|
|
|
|
|
|
//master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
|
|
|
|
eeprom_write(); |
|
|
|
eeprom_write(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 120: |
|
|
|
case 120: |
|
|
@ -1365,6 +1366,11 @@ void check_configuration(void) |
|
|
|
configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); |
|
|
|
configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); |
|
|
|
configuration.dexed[instance_id].op_enabled = constrain(configuration.dexed[instance_id].op_enabled, OP_ENABLED_MIN, OP_ENABLED_MAX); |
|
|
|
configuration.dexed[instance_id].op_enabled = constrain(configuration.dexed[instance_id].op_enabled, OP_ENABLED_MIN, OP_ENABLED_MAX); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
set_master_mixer_gain(CHORUS, configuration.chorus_level / 100.0); |
|
|
|
|
|
|
|
set_master_mixer_gain(DELAY, configuration.delay_level / 100.0); |
|
|
|
|
|
|
|
#if defined(USE_REVERB) |
|
|
|
|
|
|
|
set_master_mixer_gain(REVERB, configuration.reverb_level / 100.0); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void init_configuration(void) |
|
|
|
void init_configuration(void) |
|
|
@ -1462,40 +1468,39 @@ uint32_t crc32(byte * calc_start, uint16_t calc_bytes) // base code from https:/ |
|
|
|
return (crc); |
|
|
|
return (crc); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
void set_master_mixer_gain(uint8_t type, float level) |
|
|
|
void set_master_mixer_gain(uint8_t type, float level) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
master_mixer_level[type] = constrain(level, 0.0, 1.0); |
|
|
|
master_mixer_level[type] = constrain(level, 0.0, 1.0); |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_REVERB) |
|
|
|
#if defined(USE_REVERB) |
|
|
|
const uint8_t num_fx = 4; |
|
|
|
const uint8_t num_fx = 4; |
|
|
|
#else |
|
|
|
#else |
|
|
|
const uint8_t num_fx = 3; |
|
|
|
const uint8_t num_fx = 3; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
float new_level[num_fx]; |
|
|
|
float new_level[num_fx]; |
|
|
|
|
|
|
|
|
|
|
|
new_level[CHORUS] = master_mixer_level[CHORUS] / float(num_fx); |
|
|
|
new_level[CHORUS] = master_mixer_level[CHORUS] / float(num_fx); |
|
|
|
new_level[DELAY] = master_mixer_level[DELAY] / float(num_fx); |
|
|
|
new_level[DELAY] = master_mixer_level[DELAY] / float(num_fx); |
|
|
|
#if defined(USE_REVERB) |
|
|
|
#if defined(USE_REVERB) |
|
|
|
new_level[REVERB] = master_mixer_level[REVERB] / float(num_fx); |
|
|
|
new_level[REVERB] = master_mixer_level[REVERB] / float(num_fx); |
|
|
|
new_level[DEXED] = 1.0 - new_level[CHORUS] - new_level[DELAY] - new_level[REVERB]; |
|
|
|
new_level[DEXED] = 1.0 - new_level[CHORUS] - new_level[DELAY] - new_level[REVERB]; |
|
|
|
#else |
|
|
|
#else |
|
|
|
new_level[DEXED] = 1.0 - new_level[CHORUS] - new_level[DELAY]; |
|
|
|
new_level[DEXED] = 1.0 - new_level[CHORUS] - new_level[DELAY]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
master_mixer_r.gain(DEXED, new_level[DEXED]); |
|
|
|
master_mixer_r.gain(DEXED, new_level[DEXED]); |
|
|
|
master_mixer_l.gain(DEXED, new_level[DEXED]); |
|
|
|
master_mixer_l.gain(DEXED, new_level[DEXED]); |
|
|
|
master_mixer_r.gain(CHORUS, new_level[CHORUS]); |
|
|
|
master_mixer_r.gain(CHORUS, new_level[CHORUS]); |
|
|
|
master_mixer_l.gain(CHORUS, new_level[CHORUS]); |
|
|
|
master_mixer_l.gain(CHORUS, new_level[CHORUS]); |
|
|
|
master_mixer_r.gain(DELAY, new_level[DELAY]); |
|
|
|
master_mixer_r.gain(DELAY, new_level[DELAY]); |
|
|
|
master_mixer_l.gain(DELAY, new_level[DELAY]); |
|
|
|
master_mixer_l.gain(DELAY, new_level[DELAY]); |
|
|
|
#if defined(USE_REVERB) |
|
|
|
#if defined(USE_REVERB) |
|
|
|
master_mixer_r.gain(REVERB, new_level[REVERB]); |
|
|
|
master_mixer_r.gain(REVERB, new_level[REVERB]); |
|
|
|
master_mixer_l.gain(REVERB, new_level[REVERB]); |
|
|
|
master_mixer_l.gain(REVERB, new_level[REVERB]); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.print(F("Volumes for master_mixer(type=")); |
|
|
|
Serial.print(F("Volumes for master_mixer(type=")); |
|
|
|
Serial.print(type, DEC); |
|
|
|
Serial.print(type, DEC); |
|
|
|
Serial.print(F(",level=")); |
|
|
|
Serial.print(F(",level=")); |
|
|
@ -1506,15 +1511,14 @@ uint32_t crc32(byte * calc_start, uint16_t calc_bytes) // base code from https:/ |
|
|
|
Serial.print(new_level[CHORUS], 2); |
|
|
|
Serial.print(new_level[CHORUS], 2); |
|
|
|
Serial.print(F(" DELAY=")); |
|
|
|
Serial.print(F(" DELAY=")); |
|
|
|
Serial.print(new_level[DELAY], 2); |
|
|
|
Serial.print(new_level[DELAY], 2); |
|
|
|
#if defined(USE_REVERB) |
|
|
|
#if defined(USE_REVERB) |
|
|
|
Serial.print(F(" REVERB=")); |
|
|
|
Serial.print(F(" REVERB=")); |
|
|
|
Serial.print(new_level[REVERB], 2); |
|
|
|
Serial.print(new_level[REVERB], 2); |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
Serial.println(); |
|
|
|
Serial.println(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
/******************************************************************************
|
|
|
|
DEBUG HELPER |
|
|
|
DEBUG HELPER |
|
|
@ -1534,11 +1538,20 @@ void show_cpu_and_mem_usage(void) |
|
|
|
sum_overload += MicroDexed[instance_id]->overload; |
|
|
|
sum_overload += MicroDexed[instance_id]->overload; |
|
|
|
MicroDexed[instance_id]->render_time_max = 0; |
|
|
|
MicroDexed[instance_id]->render_time_max = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (AudioProcessorUsageMax() > 99.9) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
cpumax++; |
|
|
|
|
|
|
|
Serial.print(F("*")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
Serial.print(F("")); |
|
|
|
Serial.print(F("CPU:")); |
|
|
|
Serial.print(F("CPU:")); |
|
|
|
Serial.print(AudioProcessorUsage(), 2); |
|
|
|
Serial.print(AudioProcessorUsage(), 2); |
|
|
|
Serial.print(F("%|CPUMAX:")); |
|
|
|
Serial.print(F("%|CPUMAX:")); |
|
|
|
Serial.print(AudioProcessorUsageMax(), 2); |
|
|
|
Serial.print(AudioProcessorUsageMax(), 2); |
|
|
|
Serial.print(F("%|MEM:")); |
|
|
|
Serial.print(F("%|CPUMAXCNT:")); |
|
|
|
|
|
|
|
Serial.print(cpumax,DEC); |
|
|
|
|
|
|
|
Serial.print(F("|MEM:")); |
|
|
|
Serial.print(AudioMemoryUsage(), DEC); |
|
|
|
Serial.print(AudioMemoryUsage(), DEC); |
|
|
|
Serial.print(F("|MEMMAX:")); |
|
|
|
Serial.print(F("|MEMMAX:")); |
|
|
|
Serial.print(AudioMemoryUsageMax(), DEC); |
|
|
|
Serial.print(AudioMemoryUsageMax(), DEC); |
|
|
|