Added MIDI-Soft-Thru selectable from menu.

Small fixes.
pull/32/head
Holger Wirtz 5 years ago
parent 5ed8f5ee23
commit 56ba4ef351
  1. 11
      MicroDexed.ino
  2. 63
      UI.hpp
  3. 7
      config.h
  4. 881
      midi_devices.hpp

@ -313,6 +313,7 @@ void setup()
delay(2000);
}
else
initial_values_from_eeprom(false);
*/
initial_values_from_eeprom(false);
@ -360,9 +361,6 @@ void setup()
Serial.println(F("Internal DAC enabled."));
#endif
// Load values from EEPROM
//initial_values_from_eeprom(false);
// start SD card
#ifndef TEENSY4
SPI.setMOSI(SDCARD_MOSI_PIN);
@ -1296,7 +1294,9 @@ void initial_values_from_eeprom(bool init)
MicroDexed[instance_id]->doRefreshVoice();
chorus_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].chorus_send / 200.0);
chorus_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].chorus_send / 200.0);
chorus_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].chorus_send / 200.0);
delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 200.0);
delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 200.0);
delay_fb_mixer_r.gain(0, 1.0); // original signal
delay_fb_mixer_r.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
delay_fb_mixer_l.gain(0, 1.0); // original signal
@ -1348,6 +1348,7 @@ void check_configuration(void)
configuration.delay_time = constrain(configuration.delay_time, DELAY_TIME_MIN / 10, DELAY_TIME_MAX / 10);
configuration.delay_feedback = constrain(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
configuration.delay_level = constrain(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
configuration.soft_midi_thru = constrain(configuration.soft_midi_thru, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX);
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{
configuration.dexed[instance_id].midi_channel = constrain(configuration.dexed[instance_id].midi_channel, MIDI_CHANNEL_MIN, MIDI_CHANNEL_MAX);
@ -1409,6 +1410,7 @@ void init_configuration(void)
configuration.delay_time = DELAY_TIME_DEFAULT / 10;
configuration.delay_feedback = DELAY_FEEDBACK_DEFAULT;
configuration.delay_level = DELAY_LEVEL_DEFAULT;
configuration.soft_midi_thru = SOFT_MIDI_THRU_DEFAULT;
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{
configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL;
@ -1622,6 +1624,7 @@ void show_configuration(void)
Serial.print(F("Delay Time ")); Serial.println(configuration.delay_time, DEC);
Serial.print(F("Delay Feedback ")); Serial.println(configuration.delay_feedback, DEC);
Serial.print(F("Delay Level ")); Serial.println(configuration.delay_level, DEC);
Serial.print(F("Soft MIDI Thr ")); Serial.println(configuration.soft_midi_thru, DEC);
Serial.flush();
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{

@ -187,6 +187,7 @@ void UI_func_voice_selection(uint8_t param);
void UI_func_volume(uint8_t param);
void UI_func_load(uint8_t param);
void UI_func_save(uint8_t param);
void UI_func_midi_soft_thru(uint8_t param);
void UI_function_not_enabled(void);
void UI_function_not_implemented(uint8_t param);
void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign);
@ -300,8 +301,9 @@ LCDML_add(98, LCDML_0_3, 1, "Load", UI_func_load);
LCDML_add(99, LCDML_0_3, 2, "Save", UI_func_save);
LCDML_add(100, LCDML_0, 4, "System", NULL);
LCDML_add(101, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(102, LCDML_0, 5, "Info", UI_func_information);
#define _LCDML_DISP_cnt 102
LCDML_add(102, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(103, LCDML_0, 5, "Info", UI_func_information);
#define _LCDML_DISP_cnt 103
#define MENU_ID_OF_INSTANCE_2 42
#else
LCDML_add(0, LCDML_0, 1, "Setup", NULL);
@ -364,8 +366,9 @@ LCDML_add(56, LCDML_0_3, 1, "Load", UI_func_load);
LCDML_add(57, LCDML_0_3, 2, "Save", UI_func_save);
LCDML_add(58, LCDML_0, 4, "System", NULL);
LCDML_add(59, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(60, LCDML_0, 5, "Info", UI_func_information);
#define _LCDML_DISP_cnt 60
LCDML_add(60, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(61, LCDML_0, 5, "Info", UI_func_information);
#define _LCDML_DISP_cnt 61
#define MENU_ID_OF_INSTANCE_2 41
#endif
// create menu
@ -3198,6 +3201,58 @@ void UI_func_information(uint8_t param)
}
}
void UI_func_midi_soft_thru(uint8_t param)
{
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
// setup function
lcd.setCursor(0, 0);
lcd.print(F("MIDI-Soft_Thru"));
}
if (LCDML.FUNC_loop()) // ****** LOOP *********
{
if (LCDML.BT_checkEnter())
{
LCDML.FUNC_goBackToMenu();
}
else if (LCDML.BT_checkDown() || LCDML.BT_checkUp())
{
if (LCDML.BT_checkDown())
{
if (configuration.soft_midi_thru < SOFT_MIDI_THRU_MAX)
{
configuration.soft_midi_thru++;
}
}
else if (LCDML.BT_checkUp())
{
if (configuration.soft_midi_thru > SOFT_MIDI_THRU_MIN)
{
configuration.soft_midi_thru--;
}
}
}
lcd.setCursor(0, 1);
switch (configuration.soft_midi_thru)
{
case 0:
lcd.print(F("[OFF]"));
break;
case 1:
lcd.print(F("[ON ]"));
break;
}
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
// you can here reset some global vars or do nothing
eeprom_write();
}
}
void UI_func_voice_selection(uint8_t param)
{
#ifdef DEBUG

@ -71,7 +71,6 @@
//* MIDI SOFTWARE SETTINGS
//*************************************************************************************************
#define DEFAULT_MIDI_CHANNEL MIDI_CHANNEL_OMNI
#define MIDI_MERGE_THRU 1
#define SYSEXBANK_DEFAULT 0
#define SYSEXSOUND_DEFAULT 0
@ -197,7 +196,6 @@
// Internal timer
#define AUTOSTORE_MS 5000
#define VOICE_SELECTION_MS 2000
// EEPROM address
#define EEPROM_START_ADDRESS 100
@ -451,6 +449,10 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define INSTANCE_NOTE_END_MAX MIDI_B7
#define INSTANCE_NOTE_END_DEFAULT INSTANCE_NOTE_END_MAX
#define SOFT_MIDI_THRU_MIN 0
#define SOFT_MIDI_THRU_MAX 1
#define SOFT_MIDI_THRU_DEFAULT 1
//
typedef struct {
uint8_t midi_channel;
@ -502,6 +504,7 @@ typedef struct {
uint8_t delay_time;
uint8_t delay_feedback;
uint8_t delay_level;
uint8_t soft_midi_thru;
dexed_t dexed[NUM_DEXED];
} config_t;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save