diff --git a/MicroDexed.ino b/MicroDexed.ino index 08ef37b..1dfaa89 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -2253,7 +2253,6 @@ void check_configuration_epiano(void) configuration.epiano.sound_intensity = constrain(configuration.epiano.sound_intensity, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX); configuration.epiano.pan = constrain(configuration.epiano.pan, EP_PANORAMA_MIN, EP_PANORAMA_MAX); configuration.epiano.velocity_sense = constrain(configuration.epiano.velocity_sense, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX); - configuration.epiano.monopoly = constrain(configuration.epiano.monopoly, EP_MONOPOLY_MIN, EP_MONOPOLY_MAX); configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel, EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX); } @@ -2356,7 +2355,6 @@ void init_configuration(void) configuration.epiano.sound_intensity = EP_SOUND_INTENSITY_DEFAULT; configuration.epiano.pan = EP_PANORAMA_DEFAULT; configuration.epiano.velocity_sense = EP_VELOCITY_SENSE_DEFAULT; - configuration.epiano.monopoly = EP_MONOPOLY_DEFAULT; configuration.epiano.midi_channel = EP_MIDI_CHANNEL_DEFAULT; eeprom_update(); diff --git a/UI.hpp b/UI.hpp index c37892d..bfab856 100644 --- a/UI.hpp +++ b/UI.hpp @@ -42,6 +42,9 @@ #include "template_mixer.hpp" #include "drumset.h" #include "sequencer.h" +#if defined (USE_EPIANO) +#include "synth_mda_epiano.h" +#endif #define _LCDML_DISP_cols LCD_cols #define _LCDML_DISP_rows LCD_rows @@ -106,6 +109,7 @@ extern AudioMixer<2> microdexed_peak_mixer; extern AudioAnalyzePeak microdexed_peak; #if defined(USE_FX) #if defined(USE_EPIANO) +extern AudioSynthEPiano ep; extern AudioMixer<4> reverb_mixer_r; extern AudioMixer<4> reverb_mixer_l; #else @@ -352,7 +356,6 @@ void UI_func_epiano_highest_note(uint8_t param); void UI_func_epiano_transpose(uint8_t param); void UI_func_epiano_polyphony(uint8_t param); void UI_func_epiano_velocity_sense(uint8_t param); -void UI_func_epiano_monopoly(uint8_t param); void UI_update_instance_icons(); bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool init); uint8_t search_accepted_char(uint8_t c); @@ -2290,99 +2293,680 @@ void UI_func_favorites(uint8_t param) } } -void UI_func_epiano_sound_intensity(uint8_t param) +void UI_func_epiano_midi_channel(uint8_t param) { - ; -} + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); -void UI_func_epiano_panorama(uint8_t param) -{ - ; -} + lcd.setCursor(0, 0); + lcd.print(F("EP MIDI Channel")); + } -void UI_func_epiano_decay(uint8_t param) -{ - ; -} + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if (LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) + configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel + ENCODER[ENC_R].speed(), EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX); + else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) + configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel - ENCODER[ENC_R].speed(), EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX); -void UI_func_epiano_release(uint8_t param) -{ - ; -} + lcd.setCursor(0, 1); + if (configuration.epiano.midi_channel == 0) + { + lcd.print(F("[OMNI]")); + } + else + { + lcd_display_int(configuration.epiano.midi_channel, 4, false, true, false); + } + } -void UI_func_epiano_hardness(uint8_t param) -{ - ; + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_treble(uint8_t param) +void UI_func_epiano_lowest_note(uint8_t param) { - ; -} + char note_name[4]; -void UI_func_epiano_stereo(uint8_t param) -{ - ; -} + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); -void UI_func_epiano_tune(uint8_t param) -{ - ; -} + getNoteName(note_name, configuration.epiano.lowest_note); + lcd.setCursor(0, 0); + lcd.print(F("EP Lowest Note")); + lcd.setCursor(0, 1); + lcd.print(F("[")); + lcd.print(note_name); + lcd.print(F("]")); + } -void UI_func_epiano_detune(uint8_t param) -{ - ; -} + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + 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.epiano.lowest_note = constrain(configuration.epiano.lowest_note + ENCODER[ENC_R].speed(), EP_LOWEST_NOTE_MIN, EP_LOWEST_NOTE_MAX); + else if (LCDML.BT_checkUp()) + configuration.epiano.lowest_note = constrain(configuration.epiano.lowest_note - ENCODER[ENC_R].speed(), EP_LOWEST_NOTE_MIN, EP_LOWEST_NOTE_MAX); + } -void UI_func_epiano_pan_tremolo(uint8_t param) -{ - ; -} + getNoteName(note_name, configuration.epiano.lowest_note); + lcd.setCursor(1, 1); + lcd.print(note_name); + } -void UI_func_epiano_pan_lfo(uint8_t param) -{ - ; + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_overdrive(uint8_t param) +void UI_func_epiano_highest_note(uint8_t param) { - ; -} + char note_name[4]; -void UI_func_epiano_midi_channel(uint8_t param) -{ - ; -} + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); -void UI_func_epiano_lowest_note(uint8_t param) -{ - ; + getNoteName(note_name, configuration.dexed[selected_instance_id].highest_note); + lcd.setCursor(0, 0); + lcd.print(F("EP Highest Note")); + lcd.setCursor(0, 1); + lcd.print(F("[")); + lcd.print(note_name); + lcd.print(F("]")); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + 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.epiano.highest_note = constrain(configuration.epiano.highest_note + ENCODER[ENC_R].speed(), EP_HIGHEST_NOTE_MIN, EP_HIGHEST_NOTE_MAX); + else if (LCDML.BT_checkUp()) + configuration.epiano.highest_note = constrain(configuration.epiano.highest_note - ENCODER[ENC_R].speed(), EP_HIGHEST_NOTE_MIN, EP_HIGHEST_NOTE_MAX); + } + + getNoteName(note_name, configuration.epiano.highest_note); + lcd.setCursor(1, 1); + lcd.print(note_name); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_highest_note(uint8_t param) +void UI_func_epiano_sound_intensity(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.sound_intensity = constrain(configuration.epiano.sound_intensity + ENCODER[ENC_R].speed(), EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 7, configuration.epiano.sound_intensity); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.sound_intensity = constrain(configuration.epiano.sound_intensity - ENCODER[ENC_R].speed(), EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 7, configuration.epiano.sound_intensity); + } + } + + lcd_display_bar_int("Voice Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, false); + ep.setVolume(mapfloat(configuration.epiano.sound_intensity, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_transpose(uint8_t param) +void UI_func_epiano_panorama(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + if (configuration.sys.mono > 0) + { + lcd.setCursor(0, 0); + lcd.print(F("EP Panorama")); + lcd.setCursor(0, 1); + lcd.print(F("MONO-disabled")); + return; + } + + lcd_special_chars(METERBAR); + lcd_display_meter_float("EP Panorama", configuration.epiano.pan, 0.05, -20.0, EP_PANORAMA_MIN, EP_PANORAMA_MAX, 1, 1, false, true, true); + } + + 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.epiano.pan + ENCODER[ENC_R].speed(), EP_PANORAMA_MIN, EP_PANORAMA_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 10, map(configuration.epiano.pan, EP_PANORAMA_MIN, EP_PANORAMA_MAX, 0, 127)); + } + else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up() && configuration.sys.mono == 0) + { + configuration.epiano.pan = constrain(configuration.epiano.pan - ENCODER[ENC_R].speed(), EP_PANORAMA_MIN, EP_PANORAMA_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 10, map(configuration.epiano.pan, EP_PANORAMA_MIN, EP_PANORAMA_MAX, 0, 127)); + } + + if (configuration.sys.mono == 0) + { + lcd_display_meter_float("EP Panorama", configuration.epiano.pan, 0.05, -20.0, EP_PANORAMA_MIN, EP_PANORAMA_MAX, 1, 1, false, true, false); + //TODO //mono2stereo[selected_instance_id]->panorama(mapfloat(configuration.dexed[selected_instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); + } + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_polyphony(uint8_t param) +void UI_func_epiano_decay(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Decay", configuration.epiano.decay, 1.0, EP_DECAY_MIN, EP_DECAY_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.decay = constrain(configuration.epiano.decay + ENCODER[ENC_R].speed(), EP_DECAY_MIN, EP_DECAY_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.decay = constrain(configuration.epiano.decay - ENCODER[ENC_R].speed(), EP_DECAY_MIN, EP_DECAY_MAX); + } + } + + lcd_display_bar_int("EPiano Decay", configuration.epiano.decay, 1.0, EP_DECAY_MIN, EP_DECAY_MAX, 3, false, false, false); + ep.setDecay(mapfloat(configuration.epiano.decay, EP_DECAY_MIN, EP_DECAY_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_velocity_sense(uint8_t param) +void UI_func_epiano_release(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Release", configuration.epiano.release, 1.0, EP_RELEASE_MIN, EP_RELEASE_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.release = constrain(configuration.epiano.release + ENCODER[ENC_R].speed(), EP_RELEASE_MIN, EP_RELEASE_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.decay = constrain(configuration.epiano.decay - ENCODER[ENC_R].speed(), EP_DECAY_MIN, EP_DECAY_MAX); + } + } + + lcd_display_bar_int("EPiano Release", configuration.epiano.release, 1.0, EP_RELEASE_MIN, EP_RELEASE_MAX, 3, false, false, false); + ep.setRelease(mapfloat(configuration.epiano.release, EP_RELEASE_MIN, EP_RELEASE_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } -void UI_func_epiano_monopoly(uint8_t param) +void UI_func_epiano_hardness(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Hardness", configuration.epiano.hardness, 1.0, EP_HARDNESS_MIN, EP_HARDNESS_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.hardness = constrain(configuration.epiano.hardness + ENCODER[ENC_R].speed(), EP_HARDNESS_MIN, EP_HARDNESS_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.hardness = constrain(configuration.epiano.hardness - ENCODER[ENC_R].speed(), EP_HARDNESS_MIN, EP_HARDNESS_MAX); + } + } + + lcd_display_bar_int("EPiano Hardness", configuration.epiano.hardness, 1.0, EP_HARDNESS_MIN, EP_HARDNESS_MAX, 3, false, false, false); + ep.setHardness(mapfloat(configuration.epiano.hardness, EP_HARDNESS_MIN, EP_HARDNESS_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_treble(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Treble", configuration.epiano.treble, 1.0, EP_TREBLE_MIN, EP_TREBLE_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.treble = constrain(configuration.epiano.treble + ENCODER[ENC_R].speed(), EP_TREBLE_MIN, EP_TREBLE_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.treble = constrain(configuration.epiano.treble - ENCODER[ENC_R].speed(), EP_TREBLE_MIN, EP_TREBLE_MAX); + } + } + + lcd_display_bar_int("EPiano Treble", configuration.epiano.treble, 1.0, EP_TREBLE_MIN, EP_TREBLE_MAX, 3, false, false, false); + ep.setTreble(mapfloat(configuration.epiano.treble, EP_TREBLE_MIN, EP_TREBLE_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_stereo(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Stereo", configuration.epiano.stereo, 1.0, EP_STEREO_MIN, EP_STEREO_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.stereo = constrain(configuration.epiano.stereo + ENCODER[ENC_R].speed(), EP_STEREO_MIN, EP_STEREO_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.stereo = constrain(configuration.epiano.stereo - ENCODER[ENC_R].speed(), EP_STEREO_MIN, EP_STEREO_MAX); + } + } + + lcd_display_bar_int("EPiano Stereo", configuration.epiano.stereo, 1.0, EP_STEREO_MIN, EP_STEREO_MAX, 3, false, false, false); + ep.setTreble(mapfloat(configuration.epiano.stereo, EP_STEREO_MIN, EP_STEREO_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_tune(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(METERBAR); + lcd_display_meter_int("EPiano Tune", configuration.epiano.tune, 1.0, -100.0, EP_TUNE_MIN, EP_TUNE_MAX, 3, false, true, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + 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.epiano.tune = constrain(configuration.epiano.tune + ENCODER[ENC_R].speed(), EP_TUNE_MIN, EP_TUNE_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 94, configuration.epiano.tune); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.tune = constrain(configuration.epiano.tune - ENCODER[ENC_R].speed(), EP_TUNE_MIN, EP_TUNE_MAX); + MD_sendControlChange(configuration.epiano.midi_channel, 94, configuration.epiano.tune); + } + } + + lcd_display_meter_int("EPiano Tune", configuration.epiano.tune, 1.0, -100.0, EP_TUNE_MIN, EP_TUNE_MAX, 3, false, true, false); + + ep.setTune((configuration.epiano.tune - 100) / 100.0); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_detune(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Detune", configuration.epiano.detune, 1.0, EP_DETUNE_MIN, EP_DETUNE_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.detune = constrain(configuration.epiano.detune + ENCODER[ENC_R].speed(), EP_DETUNE_MIN, EP_DETUNE_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.detune = constrain(configuration.epiano.detune - ENCODER[ENC_R].speed(), EP_DETUNE_MIN, EP_DETUNE_MAX); + } + } + + lcd_display_bar_int("EPiano Detune", configuration.epiano.detune, 1.0, EP_DETUNE_MIN, EP_DETUNE_MAX, 3, false, false, false); + ep.setDetune(mapfloat(configuration.epiano.detune, EP_DETUNE_MIN, EP_DETUNE_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_pan_tremolo(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano PanTrem", configuration.epiano.pan_tremolo, 1.0, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.pan_tremolo = constrain(configuration.epiano.pan_tremolo + ENCODER[ENC_R].speed(), EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.pan_tremolo = constrain(configuration.epiano.pan_tremolo - ENCODER[ENC_R].speed(), EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX); + } + } + + lcd_display_bar_int("EPiano PanTrem", configuration.epiano.pan_tremolo, 1.0, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 3, false, false, false); + ep.setPanTremolo(mapfloat(configuration.epiano.pan_tremolo, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_pan_lfo(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano PanLFO", configuration.epiano.pan_lfo, 1.0, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.pan_lfo = constrain(configuration.epiano.pan_lfo + ENCODER[ENC_R].speed(), EP_PAN_LFO_MIN, EP_PAN_LFO_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.pan_lfo = constrain(configuration.epiano.pan_lfo - ENCODER[ENC_R].speed(), EP_PAN_LFO_MIN, EP_PAN_LFO_MAX); + } + } + + lcd_display_bar_int("EPiano PanLFO", configuration.epiano.pan_lfo, 1.0, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 3, false, false, false); + ep.setPanLFO(mapfloat(configuration.epiano.pan_lfo, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_overdrive(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano Overdrive", configuration.epiano.overdrive, 1.0, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.overdrive = constrain(configuration.epiano.overdrive + ENCODER[ENC_R].speed(), EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.overdrive = constrain(configuration.epiano.overdrive - ENCODER[ENC_R].speed(), EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX); + } + } + + lcd_display_bar_int("EPiano Overdrive", configuration.epiano.overdrive, 1.0, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX, 3, false, false, false); + ep.setOverdrive(mapfloat(configuration.epiano.overdrive, EP_OVERDRIVE_MIN, EP_OVERDRIVE_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_transpose(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(METERBAR); + lcd_display_meter_int("EP Transpose", configuration.epiano.transpose, 1.0, 0.0, EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX, 2, false, true, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + 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.epiano.transpose = constrain(configuration.epiano.transpose + ENCODER[ENC_R].speed(), EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX); + else if (LCDML.BT_checkUp()) + configuration.epiano.transpose = constrain(configuration.epiano.transpose - ENCODER[ENC_R].speed(), EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX); + } + + lcd_display_meter_int("EP Transpose", configuration.dexed[selected_instance_id].transpose, 1.0, 0.0, EP_TRANSPOSE_MIN, EP_TRANSPOSE_MAX, 2, false, true, true); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_polyphony(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EP Polyphony", configuration.epiano.polyphony, 1.0, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX, 2, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + 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.epiano.polyphony = constrain(configuration.epiano.polyphony + 1, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX); + } + else if (LCDML.BT_checkUp()) + { + if (configuration.epiano.polyphony - 1 < 0) + configuration.epiano.polyphony = 0; + else + { + configuration.epiano.polyphony = constrain(configuration.epiano.polyphony - 1, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX); + } + } + } + + lcd_display_bar_int("EP Polyphony", configuration.epiano.polyphony, 1.0, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX, 2, false, false, false); + ep.setPolyphony(configuration.epiano.polyphony); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } +} + +void UI_func_epiano_velocity_sense(uint8_t param) +{ + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("EPiano VelSense", configuration.epiano.velocity_sense, 1.0, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX, 3, false, false, true); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) + { + encoderDir[ENC_R].reset(); + + if (LCDML.BT_checkDown()) + { + configuration.epiano.velocity_sense = constrain(configuration.epiano.velocity_sense + ENCODER[ENC_R].speed(), EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.epiano.velocity_sense = constrain(configuration.epiano.velocity_sense - ENCODER[ENC_R].speed(), EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX); + } + } + + lcd_display_bar_int("EPiano VelSense", configuration.epiano.velocity_sense, 1.0, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX, 3, false, false, false); + ep.setOverdrive(mapfloat(configuration.epiano.velocity_sense, EP_VELOCITY_SENSE_MIN, EP_VELOCITY_SENSE_MAX, 0, 1.0)); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + encoderDir[ENC_R].reset(); + } } void UI_func_stereo_mono(uint8_t param) diff --git a/UI_FX_T4.h b/UI_FX_T4.h index 3bdaa44..87f501f 100644 --- a/UI_FX_T4.h +++ b/UI_FX_T4.h @@ -143,29 +143,28 @@ LCDML_add(109, LCDML_0_4, 6, "Setup", NULL); LCDML_add(110, LCDML_0_4_6, 4, "Transpose", UI_func_epiano_transpose); // uint8_t transpose; LCDML_add(111, LCDML_0_4_6, 1, "Polyphony", UI_func_epiano_polyphony); // uint8_t polyphony; LCDML_add(112, LCDML_0_4_6, 2, "Vel. Sense", UI_func_epiano_velocity_sense); // uint8_t velocity_sense; -LCDML_add(113, LCDML_0_4_6, 3, "Mono/Poly", UI_func_epiano_monopoly); // uint8_t monopoly; -LCDML_add(114, LCDML_0, 5, "Sequencer", NULL); -LCDML_add(115, LCDML_0_5, 1, "Pattern Editor", UI_func_seq_pattern_editor); -LCDML_add(116, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); -LCDML_add(117, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); -LCDML_add(118, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); -LCDML_add(119, LCDML_0_5, 5, "Mute Matrix", UI_func_seq_mute_matrix); -LCDML_add(120, LCDML_0_5, 6, "Seq. Settings", NULL); -LCDML_add(121, LCDML_0_5_6, 1, "Tempo", UI_func_seq_tempo); -LCDML_add(122, LCDML_0_5_6, 2, "Seq. Length", UI_func_seq_lenght); -LCDML_add(123, LCDML_0_5_6, 3, "Track Setup", UI_func_seq_track_setup); -LCDML_add(124, LCDML_0_5_6, 4, "Seq.Disp.Style", UI_func_seq_display_style); -LCDML_add(125, LCDML_0_5_6, 5, "Dexed Assign", UI_func_dexed_assign); -LCDML_add(126, LCDML_0_5_6, 6, "Shift&Transp.", UI_func_arp_shift); -LCDML_add(127, LCDML_0_5_6, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); -LCDML_add(128, LCDML_0_5_6, 8, "ChordTrack Keys", UI_func_seq_chord_keys_ammount); -LCDML_add(129, LCDML_0_5_6, 9, "Smart Filter", UI_func_smart_filter); -LCDML_add(130, LCDML_0, 6, "System", NULL); -LCDML_add(131, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(132, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(133, LCDML_0_6, 3, "Favorites", UI_func_favorites); -LCDML_add(134, LCDML_0_6, 4, "Startup", UI_func_startup); -LCDML_add(135, LCDML_0, 7, "Info", UI_func_information); -LCDML_addAdvanced(136, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); -#define _LCDML_DISP_cnt 136 +LCDML_add(113, LCDML_0, 5, "Sequencer", NULL); +LCDML_add(114, LCDML_0_5, 1, "Pattern Editor", UI_func_seq_pattern_editor); +LCDML_add(115, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); +LCDML_add(116, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); +LCDML_add(117, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio); +LCDML_add(118, LCDML_0_5, 5, "Mute Matrix", UI_func_seq_mute_matrix); +LCDML_add(119, LCDML_0_5, 6, "Seq. Settings", NULL); +LCDML_add(120, LCDML_0_5_6, 1, "Tempo", UI_func_seq_tempo); +LCDML_add(121, LCDML_0_5_6, 2, "Seq. Length", UI_func_seq_lenght); +LCDML_add(122, LCDML_0_5_6, 3, "Track Setup", UI_func_seq_track_setup); +LCDML_add(123, LCDML_0_5_6, 4, "Seq.Disp.Style", UI_func_seq_display_style); +LCDML_add(124, LCDML_0_5_6, 5, "Dexed Assign", UI_func_dexed_assign); +LCDML_add(125, LCDML_0_5_6, 6, "Shift&Transp.", UI_func_arp_shift); +LCDML_add(126, LCDML_0_5_6, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct); +LCDML_add(127, LCDML_0_5_6, 8, "ChordTrack Keys", UI_func_seq_chord_keys_ammount); +LCDML_add(128, LCDML_0_5_6, 9, "Smart Filter", UI_func_smart_filter); +LCDML_add(129, LCDML_0, 6, "System", NULL); +LCDML_add(130, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(131, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(132, LCDML_0_6, 3, "Favorites", UI_func_favorites); +LCDML_add(133, LCDML_0_6, 4, "Startup", UI_func_startup); +LCDML_add(134, LCDML_0, 7, "Info", UI_func_information); +LCDML_addAdvanced(135, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default); +#define _LCDML_DISP_cnt 135 #endif diff --git a/config.h b/config.h index d7f5222..9bded5c 100644 --- a/config.h +++ b/config.h @@ -884,7 +884,6 @@ typedef struct epiano_s { uint8_t transpose; uint8_t sound_intensity; uint8_t pan; - uint8_t monopoly; uint8_t midi_channel; } epiano_t;