diff --git a/MicroDexed.ino b/MicroDexed.ino index 1b45e52..4634cb3 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -1428,6 +1428,17 @@ bool checkMidiChannel(byte inChannel, uint8_t instance_id) return (true); } +void init_MIDI_send_CC(void) +{ + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 7, configuration.dexed[selected_instance_id].sound_intensity); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 10, configuration.dexed[selected_instance_id].pan); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 103, configuration.fx.filter_resonance[selected_instance_id]); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 104, configuration.fx.filter_cutoff[selected_instance_id]); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 105, configuration.fx.delay_time[selected_instance_id]); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 106, configuration.fx.delay_feedback[selected_instance_id]); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 107, configuration.fx.delay_level[selected_instance_id]); +} + /****************************************************************************** VOLUME HELPER ******************************************************************************/ @@ -1854,6 +1865,8 @@ void set_fx_params(void) #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)); #endif + + init_MIDI_send_CC(); } void set_voiceconfig_params(uint8_t instance_id) diff --git a/UI.hpp b/UI.hpp index cdc5adc..d5dc50c 100644 --- a/UI.hpp +++ b/UI.hpp @@ -1242,9 +1242,15 @@ void UI_func_delay_time(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) + { configuration.fx.delay_time[selected_instance_id] = constrain(configuration.fx.delay_time[selected_instance_id] + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 105, configuration.fx.delay_time[selected_instance_id]); + } else if (LCDML.BT_checkUp()) + { configuration.fx.delay_time[selected_instance_id] = constrain(configuration.fx.delay_time[selected_instance_id] - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 105, configuration.fx.delay_time[selected_instance_id]); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter()) { @@ -1298,9 +1304,15 @@ void UI_func_delay_feedback(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) + { configuration.fx.delay_feedback[selected_instance_id] = constrain(configuration.fx.delay_feedback[selected_instance_id] + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 106, configuration.fx.delay_feedback[selected_instance_id]); + } else if (LCDML.BT_checkUp()) + { configuration.fx.delay_feedback[selected_instance_id] = constrain(configuration.fx.delay_feedback[selected_instance_id] - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 106, configuration.fx.delay_feedback[selected_instance_id]); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter()) { @@ -1351,9 +1363,15 @@ void UI_func_delay_level(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) + { configuration.fx.delay_level[selected_instance_id] = constrain(configuration.fx.delay_level[selected_instance_id] + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 107, configuration.fx.delay_level[selected_instance_id]); + } else if (LCDML.BT_checkUp()) + { configuration.fx.delay_level[selected_instance_id] = constrain(configuration.fx.delay_level[selected_instance_id] - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 107, configuration.fx.delay_level[selected_instance_id]); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter()) { @@ -1462,9 +1480,15 @@ void UI_func_filter_cutoff(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) + { configuration.fx.filter_cutoff[selected_instance_id] = constrain(configuration.fx.filter_cutoff[selected_instance_id] + ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 104, configuration.fx.filter_cutoff[selected_instance_id]); + } else if (LCDML.BT_checkUp()) + { configuration.fx.filter_cutoff[selected_instance_id] = constrain(configuration.fx.filter_cutoff[selected_instance_id] - ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 104, configuration.fx.filter_cutoff[selected_instance_id]); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter()) { @@ -1515,9 +1539,15 @@ void UI_func_filter_resonance(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) + { configuration.fx.filter_resonance[selected_instance_id] = constrain(configuration.fx.filter_resonance[selected_instance_id] + ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 103, configuration.fx.filter_resonance[selected_instance_id]); + } else if (LCDML.BT_checkUp()) + { configuration.fx.filter_resonance[selected_instance_id] = constrain(configuration.fx.filter_resonance[selected_instance_id] - ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 103, configuration.fx.filter_resonance[selected_instance_id]); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter()) { @@ -1933,9 +1963,15 @@ void UI_func_panorama(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { if (LCDML.BT_checkDown() && encoderDir[ENC_R].Down() && configuration.sys.mono == 0) + { configuration.dexed[selected_instance_id].pan = constrain(configuration.dexed[selected_instance_id].pan + ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 10, configuration.dexed[selected_instance_id].pan); + } else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up() && configuration.sys.mono == 0) + { configuration.dexed[selected_instance_id].pan = constrain(configuration.dexed[selected_instance_id].pan - ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); + MD_sendControlChange(configuration.dexed[selected_instance_id].midi_channel, 10, configuration.dexed[selected_instance_id].pan); + } #if NUM_DEXED > 1 else if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) { diff --git a/doc/manuals/Build-Manual.pdf b/doc/manuals/Build-Manual.pdf index e5bb8b8..a3540c5 100644 Binary files a/doc/manuals/Build-Manual.pdf and b/doc/manuals/Build-Manual.pdf differ diff --git a/midi_devices.hpp b/midi_devices.hpp index 189be13..37024eb 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -74,7 +74,7 @@ void handleStop(void); void handleActiveSensing(void); void handleSystemReset(void); //void handleRealTimeSystem(void); -void MD_sendControlChange(byte channel, byte cc, byte value); +void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); /***************************************** MIDI_DEVICE_DIN @@ -1571,7 +1571,7 @@ void handleSystemReset_MIDI_DEVICE_USB(void) } */ #endif // MIDI_DEVICE_USB -void MD_sendControlChange(byte channel, byte cc, byte value) +void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value) { #ifdef DEBUG Serial.print(F("[MD] SendControlChange CH:"));