Dateien hochladen nach „“

pull/42/head
positionhigh 3 years ago
parent 44e92db119
commit bc5513aaaf
  1. 7
      MicroDexed.ino
  2. 38
      UI.hpp
  3. 3
      config.h
  4. 29
      synth_dexed.cpp
  5. 5
      synth_dexed.h

@ -241,13 +241,16 @@ char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
char g_bank_name[NUM_DEXED][BANK_NAME_LEN]; char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
char receive_bank_filename[FILENAME_LEN]; char receive_bank_filename[FILENAME_LEN];
uint8_t selected_instance_id = 0; uint8_t selected_instance_id = 0;
int perform_attack_mod = 0;
int perform_release_mod = 0;
#ifdef TEENSY4 #ifdef TEENSY4
#if NUM_DEXED>1 #if NUM_DEXED>1
int8_t midi_decay[NUM_DEXED] = { -1, -1}; int8_t midi_decay[NUM_DEXED] = { -1, -1};
int perform_attack_mod[NUM_DEXED] = { 0, 0};
int perform_release_mod[NUM_DEXED] = { 0, 0};
#else #else
int8_t midi_decay[NUM_DEXED] = { -1}; int8_t midi_decay[NUM_DEXED] = { -1};
int perform_attack_mod[NUM_DEXED] = { 0 };
int perform_release_mod[NUM_DEXED] = { 0 };
#endif #endif
elapsedMillis midi_decay_timer; elapsedMillis midi_decay_timer;
#endif #endif

@ -101,8 +101,8 @@ extern AudioAnalyzePeak master_peak_l;
extern char sd_string[LCD_cols + 1]; extern char sd_string[LCD_cols + 1];
extern char g_voice_name[NUM_DEXED][VOICE_NAME_LEN]; extern char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
extern char g_bank_name[NUM_DEXED][BANK_NAME_LEN]; extern char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
extern int perform_attack_mod; extern int perform_attack_mod[NUM_DEXED];
extern int perform_release_mod; extern int perform_release_mod[NUM_DEXED];
/*********************************************************************** /***********************************************************************
GLOBAL GLOBAL
************************************************************************/ ************************************************************************/
@ -3766,8 +3766,11 @@ void UI_func_voice_select(uint8_t param)
int8_t voice_tmp; int8_t voice_tmp;
// Reset Performance Modifiers to 0 after every preset change // Reset Performance Modifiers to 0 after every preset change
perform_attack_mod=0; for (uint8_t count_tmp = 0; count_tmp < NUM_DEXED; count_tmp++)
perform_release_mod=0; {
perform_attack_mod[count_tmp] = 0;
perform_release_mod[count_tmp] = 0;
}
active_perform_page = 1; active_perform_page = 1;
if (LCDML.BT_checkUp()) if (LCDML.BT_checkUp())
@ -4045,7 +4048,7 @@ void UI_func_volume(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print("Attack = "); lcd.print("Attack = ");
lcd.setCursor(13, 1); lcd.setCursor(13, 1);
sprintf(tmp, "%03d", perform_attack_mod); sprintf(tmp, "%03d", perform_attack_mod[selected_instance_id]);
lcd.print(tmp); lcd.print(tmp);
back_from_volume = 0; back_from_volume = 0;
} }
@ -4057,7 +4060,7 @@ void UI_func_volume(uint8_t param)
lcd.setCursor(11, 1); lcd.setCursor(11, 1);
lcd.print("Release = "); lcd.print("Release = ");
lcd.setCursor(13, 1); lcd.setCursor(13, 1);
sprintf(tmp, "%03d", perform_release_mod); sprintf(tmp, "%03d", perform_release_mod[selected_instance_id]);
lcd.print(tmp); lcd.print(tmp);
back_from_volume = 0; back_from_volume = 0;
} }
@ -4107,11 +4110,16 @@ void UI_func_volume(uint8_t param)
if (LCDML.BT_checkDown() ) if (LCDML.BT_checkDown() )
{ {
perform_attack_mod = constrain(perform_attack_mod + ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD); perform_attack_mod[selected_instance_id] = constrain(perform_attack_mod[selected_instance_id] + ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD);
for (uint8_t i = 0; i < 6; i++)
MicroDexed[selected_instance_id]->setRateOP(i, ATTACK, MicroDexed[selected_instance_id]->getRateOP(i, ATTACK) - perform_attack_mod[selected_instance_id] );
} }
else if (LCDML.BT_checkUp() ) else if (LCDML.BT_checkUp() )
{ {
perform_attack_mod = constrain(perform_attack_mod - ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD); perform_attack_mod[selected_instance_id] = constrain(perform_attack_mod[selected_instance_id] - ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD);
for (uint8_t i = 0; i < 6; i++)
MicroDexed[selected_instance_id]->setRateOP(i, ATTACK, MicroDexed[selected_instance_id]->getRateOP(i, ATTACK) - perform_attack_mod[selected_instance_id] );
} }
@ -4121,11 +4129,17 @@ void UI_func_volume(uint8_t param)
if (LCDML.BT_checkDown() ) if (LCDML.BT_checkDown() )
{ {
perform_release_mod = constrain(perform_release_mod + ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD); perform_release_mod[selected_instance_id] = constrain(perform_release_mod[selected_instance_id] + ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD);
for (uint8_t i = 0; i < 6; i++)
MicroDexed[selected_instance_id]->setRateOP(i, RELEASE, MicroDexed[selected_instance_id]->getRateOP(i, RELEASE) - perform_release_mod[selected_instance_id] );
} }
else if (LCDML.BT_checkUp() ) else if (LCDML.BT_checkUp() )
{ {
perform_release_mod = constrain(perform_release_mod - ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD); perform_release_mod[selected_instance_id] = constrain(perform_release_mod[selected_instance_id] - ENCODER[ENC_L].speed(), -MAX_PERF_MOD, MAX_PERF_MOD);
for (uint8_t i = 0; i < 6; i++)
MicroDexed[selected_instance_id]->setRateOP(i, RELEASE, MicroDexed[selected_instance_id]->getRateOP(i, RELEASE) - perform_release_mod[selected_instance_id] );
} }
} }
} }
@ -4146,7 +4160,7 @@ void UI_func_volume(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print("Attack = "); lcd.print("Attack = ");
lcd.setCursor(13, 1); lcd.setCursor(13, 1);
sprintf(tmp, "%03d", perform_attack_mod); sprintf(tmp, "%03d", perform_attack_mod[selected_instance_id]);
lcd.print(tmp); lcd.print(tmp);
back_from_volume = 0; back_from_volume = 0;
} }
@ -4156,7 +4170,7 @@ void UI_func_volume(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print("Release = "); lcd.print("Release = ");
lcd.setCursor(13, 1); lcd.setCursor(13, 1);
sprintf(tmp, "%03d", perform_release_mod); sprintf(tmp, "%03d", perform_release_mod[selected_instance_id]);
lcd.print(tmp); lcd.print(tmp);
back_from_volume = 0; back_from_volume = 0;
} }

@ -250,6 +250,9 @@
#define ENC_R_PIN_A 6 #define ENC_R_PIN_A 6
#define ENC_R_PIN_B 5 #define ENC_R_PIN_B 5
#define BUT_R_PIN 8 #define BUT_R_PIN 8
//#define ENC_R_PIN_A 17
//#define ENC_R_PIN_B 16
//#define BUT_R_PIN 5
#else // ARDUINO_TEENSY41 #else // ARDUINO_TEENSY41
#define ENC_R_PIN_A 24 #define ENC_R_PIN_A 24
#define ENC_R_PIN_B 5 #define ENC_R_PIN_B 5

@ -1114,6 +1114,24 @@ void Dexed::setLevelOP(uint8_t op, uint8_t step, uint8_t level)
data[(op * 21) + DEXED_OP_EG_L1 + step] = level; data[(op * 21) + DEXED_OP_EG_L1 + step] = level;
} }
uint8_t Dexed::getRateOP(uint8_t op, uint8_t step)
{
op = constrain(op, 0, 5);
step = constrain(step, 0, 3);
return (data[(op * 21) + DEXED_OP_EG_R1 + step]);
}
uint8_t Dexed::getLevelOP(uint8_t op, uint8_t step)
{
op = constrain(op, 0, 5);
step = constrain(step, 0, 3);
return (data[(op * 21) + DEXED_OP_EG_L1 + step]);
}
/* /*
// https://www.musicdsp.org/en/latest/Effects/169-compressor.html# // https://www.musicdsp.org/en/latest/Effects/169-compressor.html#
void compress void compress
@ -1351,17 +1369,6 @@ void Dx7Note::init(const uint8_t patch[156], int midinote, int velocity, int src
levels[i] = patch[off + 4 + i]; levels[i] = patch[off + 4 + i];
} }
// Live Modifiers for Attack and Release
// So far no sanity checks for <0 or similar since i have not experienced any problems without them.
// The macro itself is still work to do - finding the best working relation for most of the presets.
if (perform_attack_mod != 0 || perform_release_mod != 0)
{
rates[1] = rates[1] - perform_attack_mod;
rates[2] = rates[2] - perform_release_mod * 2;
rates[3] = rates[3] - perform_release_mod;
}
// Modifiers End
int outlevel = patch[off + 16]; int outlevel = patch[off + 16];
outlevel = Env::scaleoutlevel(outlevel); outlevel = Env::scaleoutlevel(outlevel);
int level_scaling = ScaleLevel(midinote, patch[off + 8], patch[off + 9], int level_scaling = ScaleLevel(midinote, patch[off + 8], patch[off + 9],

@ -1010,7 +1010,7 @@ enum DexedVoiceParameters {
enum ADSR { enum ADSR {
ATTACK, ATTACK,
DECAY; DECAY,
SUSTAIN, SUSTAIN,
RELEASE RELEASE
}; };
@ -1097,6 +1097,9 @@ class Dexed
void setLevelOPAllModulator(uint8_t step, uint8_t level); void setLevelOPAllModulator(uint8_t step, uint8_t level);
void setRateOP(uint8_t op, uint8_t step, uint8_t rate); void setRateOP(uint8_t op, uint8_t step, uint8_t rate);
void setLevelOP(uint8_t op, uint8_t step, uint8_t level); void setLevelOP(uint8_t op, uint8_t step, uint8_t level);
uint8_t getRateOP(uint8_t op, uint8_t step);
uint8_t getLevelOP(uint8_t op, uint8_t step);
ProcessorVoice voices[MAX_NOTES]; ProcessorVoice voices[MAX_NOTES];
Controllers controllers; Controllers controllers;

Loading…
Cancel
Save