Several small fixes.

pull/32/head
Holger Wirtz 5 years ago
parent 69ce71436e
commit c53a30dcdd
  1. 20
      MicroDexed.ino
  2. 4
      UI.hpp
  3. 2
      dexed.cpp
  4. 6
      dexed_sd.cpp
  5. 6
      dexed_sd.h

@ -1360,6 +1360,11 @@ void initial_values_from_eeprom(bool init)
{ {
uint32_t _m_; uint32_t _m_;
if (init == true)
init_configuration();
else
{
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, _marker_), _m_); EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, _marker_), _m_);
if (_m_ != EEPROM_MARKER) if (_m_ != EEPROM_MARKER)
{ {
@ -1370,10 +1375,6 @@ void initial_values_from_eeprom(bool init)
configuration._marker_ = EEPROM_MARKER; configuration._marker_ = EEPROM_MARKER;
} }
if (init == true)
init_configuration();
else
{
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Loading inital system data from EEPROM.")); Serial.println(F("Loading inital system data from EEPROM."));
#endif #endif
@ -1390,6 +1391,12 @@ void initial_values_from_eeprom(bool init)
show_configuration(); show_configuration();
#endif #endif
#ifdef DEBUG
Serial.println(F("OK, loaded!"));
#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++)
@ -1398,13 +1405,8 @@ 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
Serial.println(F("OK, loaded!"));
#endif
}
#ifdef DEBUG #ifdef DEBUG
show_configuration(); show_configuration();
#endif #endif

@ -1434,8 +1434,8 @@ void UI_func_reverb_send(uint8_t param)
lcd_display_bar_int("Reverb Send", configuration.fx.reverb_send[selected_instance_id], 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false); lcd_display_bar_int("Reverb Send", configuration.fx.reverb_send[selected_instance_id], 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false);
reverb_mixer_r.gain(selected_instance_id, pseudo_log_curve(configuration.fx.reverb_send[selected_instance_id] / 100.0)); reverb_mixer_r.gain(selected_instance_id, pseudo_log_curve(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)));
reverb_mixer_l.gain(selected_instance_id, pseudo_log_curve(configuration.fx.reverb_send[selected_instance_id] / 100.0)); reverb_mixer_l.gain(selected_instance_id, pseudo_log_curve(mapfloat(configuration.fx.reverb_send[selected_instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)));
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********

@ -150,7 +150,7 @@ void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
{ {
//sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9)) / 0x8000; //sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9)) / 0x8000;
//sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 5, 24, 9)) / 0x8000; //sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j] >> 5, 24, 9)) / 0x8000;
sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j], 32, 14)) / 0x8000; sumbuf[i + j] += static_cast<float>(signed_saturate_rshift(audiobuf.get()[j], 32, 13)) / 0x8000;
//sumbuf[i + j] += static_cast<float>(audiobuf.get()[j] / 0x8000); //sumbuf[i + j] += static_cast<float>(audiobuf.get()[j] / 0x8000);
audiobuf.get()[j] = 0; audiobuf.get()[j] = 0;
} }

@ -344,7 +344,7 @@ bool save_sd_bank(const char* bank_filename, uint8_t* data)
/****************************************************************************** /******************************************************************************
SD VOICECONFIG SD VOICECONFIG
******************************************************************************/ ******************************************************************************/
bool load_sd_voiceconfig(uint8_t vc, uint8_t instance_id) bool load_sd_voiceconfig(int8_t vc, uint8_t instance_id)
{ {
if (vc < 0) if (vc < 0)
return (false); return (false);
@ -444,7 +444,7 @@ bool save_sd_voiceconfig(uint8_t vc, uint8_t instance_id)
/****************************************************************************** /******************************************************************************
SD FX SD FX
******************************************************************************/ ******************************************************************************/
bool load_sd_fx(uint8_t fx) bool load_sd_fx(int8_t fx)
{ {
if (fx < 0) if (fx < 0)
return (false); return (false);
@ -543,7 +543,7 @@ bool save_sd_fx(uint8_t fx)
/****************************************************************************** /******************************************************************************
SD PERFORMANCE SD PERFORMANCE
******************************************************************************/ ******************************************************************************/
bool load_sd_performance(uint8_t p) bool load_sd_performance(int8_t p)
{ {
if (p < 0) if (p < 0)
return (false); return (false);

@ -53,13 +53,13 @@ bool get_sd_voice(File sysex, uint8_t voice_number, uint8_t* data);
bool put_sd_voice(File sysex, uint8_t voice_number, uint8_t* data); bool put_sd_voice(File sysex, uint8_t voice_number, uint8_t* data);
bool save_sd_bank(const char* bank_filename, uint8_t* data); bool save_sd_bank(const char* bank_filename, uint8_t* data);
bool load_sd_voiceconfig(uint8_t vc, uint8_t instance_id); bool load_sd_voiceconfig(int8_t vc, uint8_t instance_id);
bool save_sd_voiceconfig(uint8_t vc, uint8_t instance_id); bool save_sd_voiceconfig(uint8_t vc, uint8_t instance_id);
bool load_sd_fx(uint8_t fx); bool load_sd_fx(int8_t fx);
bool save_sd_fx(uint8_t fx); bool save_sd_fx(uint8_t fx);
bool load_sd_performance(uint8_t p); bool load_sd_performance(int8_t p);
bool save_sd_performance(uint8_t p); bool save_sd_performance(uint8_t p);
bool get_sd_data(File sysex, uint8_t format, uint8_t* conf); bool get_sd_data(File sysex, uint8_t format, uint8_t* conf);

Loading…
Cancel
Save