|
|
@ -176,7 +176,7 @@ AudioConnection * dynamicConnections[NUM_DEXED * 5]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
void create_audio_engine_chain(uint8_t instance_id) |
|
|
|
void create_audio_engine_chain(uint8_t instance_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
MicroDexed[instance_id] = new AudioSynthDexed(MAX_VOICES, SAMPLE_RATE); |
|
|
|
MicroDexed[instance_id] = new AudioSynthDexed(MAX_NOTES / NUM_DEXED, SAMPLE_RATE); |
|
|
|
mono2stereo[instance_id] = new AudioEffectMonoStereo(); |
|
|
|
mono2stereo[instance_id] = new AudioEffectMonoStereo(); |
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
chorus_modulator[instance_id] = new AudioSynthWaveform(); |
|
|
|
chorus_modulator[instance_id] = new AudioSynthWaveform(); |
|
|
@ -301,25 +301,6 @@ void setup() |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
generate_version_string(version_string, sizeof(version_string)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); |
|
|
|
|
|
|
|
Serial.println(F("(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>")); |
|
|
|
|
|
|
|
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed")); |
|
|
|
|
|
|
|
Serial.print(F("Version: ")); |
|
|
|
|
|
|
|
Serial.println(version_string); |
|
|
|
|
|
|
|
Serial.print(F("CPU-Speed: ")); |
|
|
|
|
|
|
|
Serial.print(F_CPU / 1000000.0, 1); |
|
|
|
|
|
|
|
Serial.print(F(" MHz / ")); |
|
|
|
|
|
|
|
Serial.print(NUM_DEXED, DEC); |
|
|
|
|
|
|
|
Serial.print(F(" Instances with ")); |
|
|
|
|
|
|
|
Serial.print(MAX_NOTES); |
|
|
|
|
|
|
|
Serial.println(F(" notes for each instance")); |
|
|
|
|
|
|
|
Serial.println(F("<setup start>")); |
|
|
|
|
|
|
|
Serial.flush(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup_midi_devices(); |
|
|
|
setup_midi_devices(); |
|
|
|
|
|
|
|
|
|
|
|
// Start audio system
|
|
|
|
// Start audio system
|
|
|
@ -416,15 +397,27 @@ void setup() |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined(ANTIALIAS_FRQ) |
|
|
|
#ifdef DEBUG |
|
|
|
antialias_r.setLowpass(0, ANTIALIAS_FRQ, 0.54); |
|
|
|
generate_version_string(version_string, sizeof(version_string)); |
|
|
|
antialias_r.setLowpass(1, ANTIALIAS_FRQ, 1.3); |
|
|
|
|
|
|
|
antialias_r.setLowpass(2, ANTIALIAS_FRQ, 0.54); |
|
|
|
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); |
|
|
|
antialias_r.setLowpass(3, ANTIALIAS_FRQ, 1.3); |
|
|
|
Serial.println(F("(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>")); |
|
|
|
antialias_l.setLowpass(0, ANTIALIAS_FRQ, 0.54); |
|
|
|
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed")); |
|
|
|
antialias_l.setLowpass(1, ANTIALIAS_FRQ, 1.3); |
|
|
|
Serial.print(F("Version: ")); |
|
|
|
antialias_l.setLowpass(2, ANTIALIAS_FRQ, 0.54); |
|
|
|
Serial.println(version_string); |
|
|
|
antialias_l.setLowpass(3, ANTIALIAS_FRQ, 1.3); |
|
|
|
Serial.print(F("CPU-Speed: ")); |
|
|
|
|
|
|
|
Serial.print(F_CPU / 1000000.0, 1); |
|
|
|
|
|
|
|
Serial.println(F(" MHz")); |
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.print(F("Instance ")); |
|
|
|
|
|
|
|
Serial.print(instance_id); |
|
|
|
|
|
|
|
Serial.print(F(": ")); |
|
|
|
|
|
|
|
Serial.print(MicroDexed[instance_id]->getMaxNotes()); |
|
|
|
|
|
|
|
Serial.println(F(" voices")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Serial.println(F("<setup start>")); |
|
|
|
|
|
|
|
Serial.flush(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
initial_values_from_eeprom(false); |
|
|
|
initial_values_from_eeprom(false); |
|
|
@ -1593,9 +1586,9 @@ void initial_values_from_eeprom(bool init) |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("OK, loaded!")); |
|
|
|
Serial.println(F("OK, loaded!")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_configuration(); |
|
|
|
check_configuration(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1604,7 +1597,7 @@ void initial_values_from_eeprom(bool init) |
|
|
|
set_fx_params(); |
|
|
|
set_fx_params(); |
|
|
|
set_sys_params(); |
|
|
|
set_sys_params(); |
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
show_configuration(); |
|
|
|
show_configuration(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -1645,9 +1638,8 @@ void check_configuration(void) |
|
|
|
configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose, TRANSPOSE_MIN, TRANSPOSE_MAX); |
|
|
|
configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose, TRANSPOSE_MIN, TRANSPOSE_MAX); |
|
|
|
configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune, TUNE_MIN, TUNE_MAX); |
|
|
|
configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune, TUNE_MIN, TUNE_MAX); |
|
|
|
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony, POLYPHONY_MIN, POLYPHONY_MAX / NUM_DEXED); |
|
|
|
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony, POLYPHONY_MIN, POLYPHONY_MAX); |
|
|
|
configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); |
|
|
|
configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); |
|
|
|
configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine, ENGINE_MIN, ENGINE_MAX); |
|
|
|
|
|
|
|
configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly, MONOPOLY_MIN, MONOPOLY_MAX); |
|
|
|
configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly, MONOPOLY_MIN, MONOPOLY_MAX); |
|
|
|
configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); |
|
|
|
configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); |
|
|
|
configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range, PB_RANGE_MIN, PB_RANGE_MAX); |
|
|
|
configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range, PB_RANGE_MIN, PB_RANGE_MAX); |
|
|
@ -1724,7 +1716,6 @@ void init_configuration(void) |
|
|
|
configuration.dexed[instance_id].tune = TUNE_DEFAULT; |
|
|
|
configuration.dexed[instance_id].tune = TUNE_DEFAULT; |
|
|
|
configuration.dexed[instance_id].polyphony = POLYPHONY_DEFAULT; |
|
|
|
configuration.dexed[instance_id].polyphony = POLYPHONY_DEFAULT; |
|
|
|
configuration.dexed[instance_id].velocity_level = VELOCITY_LEVEL_DEFAULT; |
|
|
|
configuration.dexed[instance_id].velocity_level = VELOCITY_LEVEL_DEFAULT; |
|
|
|
configuration.dexed[instance_id].engine = ENGINE_DEFAULT; |
|
|
|
|
|
|
|
configuration.dexed[instance_id].monopoly = MONOPOLY_DEFAULT; |
|
|
|
configuration.dexed[instance_id].monopoly = MONOPOLY_DEFAULT; |
|
|
|
configuration.dexed[instance_id].note_refresh = NOTE_REFRESH_DEFAULT; |
|
|
|
configuration.dexed[instance_id].note_refresh = NOTE_REFRESH_DEFAULT; |
|
|
|
configuration.dexed[instance_id].pb_range = PB_RANGE_DEFAULT; |
|
|
|
configuration.dexed[instance_id].pb_range = PB_RANGE_DEFAULT; |
|
|
@ -1763,13 +1754,7 @@ void init_configuration(void) |
|
|
|
|
|
|
|
|
|
|
|
configuration.dexed[instance_id].polyphony = POLYPHONY_DEFAULT; |
|
|
|
configuration.dexed[instance_id].polyphony = POLYPHONY_DEFAULT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
#else |
|
|
|
|
|
|
|
if (instance_id == 0) |
|
|
|
|
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
@ -1952,6 +1937,7 @@ void set_fx_params(void) |
|
|
|
|
|
|
|
|
|
|
|
master_mixer_r.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
master_mixer_r.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
master_mixer_l.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
master_mixer_l.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef SGTL5000_AUDIO_ENHANCE |
|
|
|
#ifdef SGTL5000_AUDIO_ENHANCE |
|
|
|
sgtl5000_1.eqBands(mapfloat(configuration.fx.eq_bass, EQ_BASS_MIN, EQ_BASS_MAX, -1.0, 1.0), mapfloat(configuration.fx.eq_treble, EQ_TREBLE_MIN, EQ_TREBLE_MAX, -1.0, 1.0)); |
|
|
|
sgtl5000_1.eqBands(mapfloat(configuration.fx.eq_bass, EQ_BASS_MIN, EQ_BASS_MAX, -1.0, 1.0), mapfloat(configuration.fx.eq_treble, EQ_TREBLE_MIN, EQ_TREBLE_MAX, -1.0, 1.0)); |
|
|
@ -1966,6 +1952,7 @@ void set_voiceconfig_params(uint8_t instance_id) |
|
|
|
microdexed_peak_mixer.gain(instance_id, 1.0); |
|
|
|
microdexed_peak_mixer.gain(instance_id, 1.0); |
|
|
|
|
|
|
|
|
|
|
|
// Controller
|
|
|
|
// Controller
|
|
|
|
|
|
|
|
MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); |
|
|
|
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); |
|
|
|
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); |
|
|
|
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); |
|
|
|
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); |
|
|
|
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); |
|
|
|
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); |
|
|
@ -1974,7 +1961,6 @@ void set_voiceconfig_params(uint8_t instance_id) |
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
MicroDexed[instance_id]->setOPAll(configuration.dexed[instance_id].op_enabled); |
|
|
|
MicroDexed[instance_id]->setOPAll(configuration.dexed[instance_id].op_enabled); |
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); |
|
|
|
|
|
|
|
MicroDexed[instance_id]->setMonoMode(configuration.sys.mono); |
|
|
|
MicroDexed[instance_id]->setMonoMode(configuration.sys.mono); |
|
|
|
|
|
|
|
|
|
|
|
// Dexed output level
|
|
|
|
// Dexed output level
|
|
|
@ -2388,7 +2374,6 @@ void show_configuration(void) |
|
|
|
Serial.print(F(" Transpose ")); Serial.println(configuration.dexed[instance_id].transpose, DEC); |
|
|
|
Serial.print(F(" Transpose ")); Serial.println(configuration.dexed[instance_id].transpose, DEC); |
|
|
|
Serial.print(F(" Tune ")); Serial.println(configuration.dexed[instance_id].tune, DEC); |
|
|
|
Serial.print(F(" Tune ")); Serial.println(configuration.dexed[instance_id].tune, DEC); |
|
|
|
Serial.print(F(" Polyphony ")); Serial.println(configuration.dexed[instance_id].polyphony, DEC); |
|
|
|
Serial.print(F(" Polyphony ")); Serial.println(configuration.dexed[instance_id].polyphony, DEC); |
|
|
|
Serial.print(F(" Engine ")); Serial.println(configuration.dexed[instance_id].engine, DEC); |
|
|
|
|
|
|
|
Serial.print(F(" Mono/Poly ")); Serial.println(configuration.dexed[instance_id].monopoly, DEC); |
|
|
|
Serial.print(F(" Mono/Poly ")); Serial.println(configuration.dexed[instance_id].monopoly, DEC); |
|
|
|
Serial.print(F(" Note Refresh ")); Serial.println(configuration.dexed[instance_id].note_refresh, DEC); |
|
|
|
Serial.print(F(" Note Refresh ")); Serial.println(configuration.dexed[instance_id].note_refresh, DEC); |
|
|
|
Serial.print(F(" Pitchbend Range ")); Serial.println(configuration.dexed[instance_id].pb_range, DEC); |
|
|
|
Serial.print(F(" Pitchbend Range ")); Serial.println(configuration.dexed[instance_id].pb_range, DEC); |
|
|
|