|
|
@ -4075,10 +4075,14 @@ void UI_func_drum_pitch(uint8_t param) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
midi_learn_mode = true; |
|
|
|
midi_learn_mode = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(tmp_name, ' ', 8); |
|
|
|
|
|
|
|
tmp_name[8] = '\0'; |
|
|
|
|
|
|
|
strncpy(tmp_name, drum_config[active_sample].name, strlen(drum_config[active_sample].name)); |
|
|
|
|
|
|
|
|
|
|
|
display.setCursor(0, 0); |
|
|
|
display.setCursor(0, 0); |
|
|
|
display.print(F("Drums Pitch")); |
|
|
|
display.print(F("Drums Pitch")); |
|
|
|
display.setCursor(1, 1); |
|
|
|
display.setCursor(1, 1); |
|
|
|
display.print(drum_config[active_sample].name); |
|
|
|
display.print(tmp_name); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
display.print(tmp_val); |
|
|
|
display.print(tmp_val); |
|
|
@ -4090,19 +4094,23 @@ void UI_func_drum_pitch(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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { |
|
|
|
if (LCDML.BT_checkDown()) { |
|
|
|
if (LCDML.BT_checkDown()) { |
|
|
|
if (display_name == true) { |
|
|
|
if (display_name == true) { |
|
|
|
active_sample = constrain(++active_sample, 0, NUM_DRUMSET_CONFIG - 1); |
|
|
|
if (active_sample < NUM_DRUMSET_CONFIG - 2) { |
|
|
|
|
|
|
|
active_sample++; |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
display.print(tmp_val); |
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
configuration.drums.pitch[active_sample] = constrain(configuration.drums.pitch[active_sample] + ENCODER[ENC_L].speed(), DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); |
|
|
|
configuration.drums.pitch[active_sample] = constrain(configuration.drums.pitch[active_sample] + ENCODER[ENC_L].speed(), DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (LCDML.BT_checkUp()) { |
|
|
|
} else if (LCDML.BT_checkUp()) { |
|
|
|
if (display_name == true) { |
|
|
|
if (display_name == true) { |
|
|
|
active_sample = constrain(--active_sample, 0, NUM_DRUMSET_CONFIG - 1); |
|
|
|
if (active_sample > 0) { |
|
|
|
|
|
|
|
active_sample--; |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
display.print(tmp_val); |
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
configuration.drums.pitch[active_sample] = constrain(configuration.drums.pitch[active_sample] - ENCODER[ENC_L].speed(), DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); |
|
|
|
configuration.drums.pitch[active_sample] = constrain(configuration.drums.pitch[active_sample] - ENCODER[ENC_L].speed(), DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); |
|
|
|
} |
|
|
|
} |
|
|
@ -4113,8 +4121,12 @@ void UI_func_drum_pitch(uint8_t param) { |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.printf("Pitch for active_sample=%d [%s]\n", active_sample, drum_config[active_sample].name); |
|
|
|
Serial.printf("Pitch for active_sample=%d [%s]\n", active_sample, drum_config[active_sample].name); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
memset(tmp_name, ' ', 8); |
|
|
|
|
|
|
|
tmp_name[8] = '\0'; |
|
|
|
|
|
|
|
strncpy(tmp_name, drum_config[active_sample].name, strlen(drum_config[active_sample].name)); |
|
|
|
|
|
|
|
|
|
|
|
display.setCursor(1, 1); |
|
|
|
display.setCursor(1, 1); |
|
|
|
display.print(drum_config[active_sample].name); |
|
|
|
display.print(tmp_name); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
display.setCursor(LCD_cols - 5, 1); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
snprintf_P(tmp_val, sizeof(tmp_val), PSTR("%4.1f"), configuration.drums.pitch[active_sample] / 10.0); |
|
|
|
display.print(tmp_val); |
|
|
|
display.print(tmp_val); |
|
|
|