Added edit symbol when editing a name for bank/voice/performance.

Enabled volume functions for drum pan again.
dev
Holger Wirtz 2 years ago
parent c297aff79f
commit c285f7767c
  1. 21
      MicroDexed.ino
  2. 11
      UI.hpp
  3. 4
      addon/tools/wav2c.sh
  4. 11
      config.h
  5. 839749
      drumset.h

@ -1001,8 +1001,9 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
//drum_mixer_r.gain(slot, (1.0 - pan) * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min/100.0f, configuration.drums.vol_max[d]/100.0f)));
//drum_mixer_l.gain(slot, pan * volume_transform(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min/100.0f, configuration.drums.vol_max[d]/100.0f)));
drum_mixer_r.gain(slot, (1.0 - pan) * mapfloat(inVelocity, 0, 127, vol_min, vol_max));
drum_mixer_l.gain(slot, pan * mapfloat(inVelocity, 0, 127, vol_min, vol_max));
drum_mixer_r.gain(slot, (1.0 - pan) * volume_transform(mapfloat(inVelocity, 0, 127, vol_min, vol_max)));
drum_mixer_l.gain(slot, pan * volume_transform(mapfloat(inVelocity, 0, 127, vol_min, vol_max)));
#ifdef USE_FX
//drum_reverb_send_mixer_r.gain(slot, (1.0 - pan) * volume_transform(reverb_send));
//drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(reverb_send));
@ -2466,18 +2467,18 @@ int8_t handle_midi_learn(int8_t note) {
return (ret_channel);
}
float midi_volume_transform(uint8_t midi_amp) {
float midi_volume_transform(uint8_t midi_in) {
#ifdef DEBUG
Serial.print(F("midi_amp="));
Serial.print(midi_amp, DEC);
Serial.print(F(" transformed_midi_amp="));
Serial.println(powf(midi_amp / 127.0, 4), 3);
Serial.printf_P(PSTR("MIDI volume transform in=%3d, out=%3.1f\n"), midi_in, powf(midi_in / 127.0, VOLUME_TRANSFORM_EXP));
#endif
return powf(midi_amp / 127.0, 4);
return powf(midi_in / 127.0, VOLUME_TRANSFORM_EXP);
}
float volume_transform(float amp) {
return powf(amp, 4);
float volume_transform(float in) {
#ifdef DEBUG
Serial.printf_P(PSTR("Volume transform in=%3.1f, out=%3.1f\n"), in, powf(in, VOLUME_TRANSFORM_EXP));
#endif
return powf(in, VOLUME_TRANSFORM_EXP);
}
uint32_t crc32(byte* calc_start, uint16_t calc_bytes) // base code from https://www.arduino.cc/en/Tutorial/EEPROMCrc

@ -73,7 +73,7 @@ extern void eeprom_update(void);
#if NUM_DRUMS > 0
#include "midinotes.h"
#include "drumset.h"
extern void get_sd_performance_name_json(uint8_t number,char* name, uint8_t len);
extern void get_sd_performance_name_json(uint8_t number, char* name, uint8_t len);
extern bool save_sd_performance_json(uint8_t p);
extern uint8_t drum_midi_channel;
//extern drum_config_t drum_config[NUM_DRUMSET_CONFIG];
@ -206,7 +206,7 @@ const uint8_t meter_bar[5][8] = {
{ B00001, B00001, B00001, B00001, B00001, B00001, B00001, B00001 }
};
const uint8_t special_chars[22][8] = {
const uint8_t special_chars[20][8] = {
{ B11111, B11011, B10011, B11011, B11011, B11011, B11011, B11111 }, // [0] 1 small invers
{ B11111, B11011, B10101, B11101, B11011, B10111, B10001, B11111 }, // [1] 2 small invers
{ B11111, B11011, B10011, B11011, B11011, B11011, B11011, B11111 }, // [2] 1 OP invers
@ -226,6 +226,7 @@ const uint8_t special_chars[22][8] = {
{ B00100, B00110, B00101, B00101, B01101, B11101, B11100, B11000 }, // [16] Note
{ B01110, B10001, B10001, B01110, B00100, B00100, B00110, B00110 }, // [17] Disabled 2nd instance symbol
{ B11111, B10001, B10111, B10001, B10111, B10111, B10111, B11111 }, // [18] Favorites Icon
{ B11111, B10001, B10111, B10001, B10111, B10001, B11111, B00000 } // [19] Edit Icon
};
enum { SCROLLBAR,
@ -5527,6 +5528,8 @@ void UI_func_set_performance_name(uint8_t param) {
static uint8_t ui_select_name_state;
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
display.createChar(0, (uint8_t*)special_chars[19]); // edit symbol
encoderDir[ENC_R].reset();
mode = 0;
display.setCursor(0, 0);
@ -5573,8 +5576,10 @@ void UI_func_set_performance_name(uint8_t param) {
display.blink();
}
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
display.noBlink();
}
@ -6267,7 +6272,7 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i
} else {
edit_mode = !edit_mode;
display.setCursor(LCD_cols - 1, 0);
display.print(F("*"));
display.write(0);
}
}

@ -108,9 +108,9 @@ typedef struct drum_config_s {
uint8_t midinote; // Triggered by note
char name[DRUM_NAME_LEN];
const uint8_t* drum_data;
char shortname[2]; // 1 char name for sequencer
char shortname[2]; // 1 char namer
uint32_t len; // number of elements in drum_data
float32_t pitch; // variable pitch per note for sequencer
float32_t pitch; // variable pitch per note
float32_t pan; // Panorama (-1.0 - +1.0)
float32_t vol_max; // max. Volume (0.0 - 1.0)
float32_t vol_min; // min. Volume (0.0 - 1.0, should be <= vol_max)

@ -99,7 +99,7 @@
#define SHOW_CPU_LOAD_MSEC 5000
//*************************************************************************************************
//* DEXED SEQUENCER, EPIANO AND EFFECTS SETTINGS
//* DEXED, EPIANO AND EFFECTS SETTINGS
//*************************************************************************************************
// Number of Dexed instances
#if defined(ARDUINO_TEENSY36)
@ -128,13 +128,6 @@
#define NUM_DRUMSET_CONFIG 19
#endif
// SEQUENCER
#define NUM_SEQ_PATTERN 24
#define NUM_SEQ_TRACKS 6
#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
#define USE_SEQUENCER
#endif
// EPIANO
#define USE_EPIANO
#ifdef USE_EPIANO
@ -343,6 +336,7 @@
#define LED_BLINK_MS 1000
#define SAVE_SYS_MS 5000
#define VOL_MAX_FLOAT 0.95
#define VOLUME_TRANSFORM_EXP 3.5
#define EEPROM_MARKER 0x4243
@ -359,7 +353,6 @@
// Teensy-3.6 settings
#if defined(ARDUINO_TEENSY36)
#undef USE_SEQUENCER
#if defined(USE_FX)
#warning>>> With enabled FX a maximum of 12 voices is possible (due to RAM and CPU limitations)
#define MAX_NOTES 12

839749
drumset.h

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