Fixes for stereo panner.

Small fixes for E-Piano.
pull/112/head
Holger Wirtz 3 years ago
parent 2d2fa02afc
commit 8ac058fa60
  1. 18
      MicroDexed.ino
  2. 12
      UI.hpp
  3. 5
      config.h
  4. 2
      dexed_sd.cpp
  5. 13
      effect_stereo_panorama.cpp
  6. 3
      third-party/Synth_MDA_EPiano/src/mdaEPiano.cpp

@ -249,19 +249,13 @@ AudioConnection patchCord[] = {
#endif #endif
#if defined(USE_EPIANO) #if defined(USE_EPIANO)
//{ep, 0, ep_stereo_panorama , 0},
//{ep, 1, ep_stereo_panorama , 1},
{ep, 0, ep_stereo_panorama , 0}, {ep, 0, ep_stereo_panorama , 0},
{ep, 1, ep_stereo_panorama , 1}, {ep, 1, ep_stereo_panorama , 1},
#if defined(USE_FX) #if defined(USE_FX)
//{ep_stereo_panorama, 0, ep_chorus_mixer_r, 0}, {ep_stereo_panorama, 0, ep_chorus_mixer_r, 0},
//{ep_stereo_panorama, 1, ep_chorus_mixer_l, 0}, {ep_stereo_panorama, 1, ep_chorus_mixer_l, 0},
//{ep_stereo_panorama, 0, ep_modchorus_r, 0}, {ep_stereo_panorama, 0, ep_modchorus_r, 0},
//{ep_stereo_panorama, 1, ep_modchorus_l, 0}, {ep_stereo_panorama, 1, ep_modchorus_l, 0},
{ep, 0, ep_chorus_mixer_r, 0},
{ep, 1, ep_chorus_mixer_l, 0},
{ep, 0, ep_modchorus_r, 0},
{ep, 1, ep_modchorus_l, 0},
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT #if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT
{ep_chorus_modulator, 0, ep_modchorus_filter, 0}, {ep_chorus_modulator, 0, ep_modchorus_filter, 0},
{ep_modchorus_filter, 0, ep_modchorus_r, 1}, {ep_modchorus_filter, 0, ep_modchorus_r, 1},
@ -1065,7 +1059,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
{ {
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note)
{ {
ep.noteOn(inNumber + configuration.epiano.transpose, inVelocity); ep.noteOn(inNumber + configuration.epiano.transpose - 12, inVelocity);
#ifdef DEBUG #ifdef DEBUG
char note_name[4]; char note_name[4];
getNoteName(note_name, inNumber); getNoteName(note_name, inNumber);
@ -2346,6 +2340,7 @@ void init_configuration(void)
MicroDexed[instance_id]->ControllersRefresh(); MicroDexed[instance_id]->ControllersRefresh();
} }
#if defined(USE_EPIANO)
configuration.epiano.decay = EP_DECAY_DEFAULT; configuration.epiano.decay = EP_DECAY_DEFAULT;
configuration.epiano.release = EP_RELEASE_DEFAULT; configuration.epiano.release = EP_RELEASE_DEFAULT;
configuration.epiano.hardness = EP_HARDNESS_DEFAULT; configuration.epiano.hardness = EP_HARDNESS_DEFAULT;
@ -2365,6 +2360,7 @@ void init_configuration(void)
configuration.epiano.pan = EP_PANORAMA_DEFAULT; configuration.epiano.pan = EP_PANORAMA_DEFAULT;
configuration.epiano.velocity_sense = EP_VELOCITY_SENSE_DEFAULT; configuration.epiano.velocity_sense = EP_VELOCITY_SENSE_DEFAULT;
configuration.epiano.midi_channel = EP_MIDI_CHANNEL_DEFAULT; configuration.epiano.midi_channel = EP_MIDI_CHANNEL_DEFAULT;
#endif
eeprom_update(); eeprom_update();
} }

@ -2421,7 +2421,7 @@ void UI_func_epiano_sound_intensity(uint8_t param)
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
#if defined(USE_EPIANO) #if defined(USE_EPIANO)
lcd_display_bar_int("EP Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, true); # lcd_display_bar_int("EP Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, true);
#else #else
lcd.clear(); lcd.clear();
lcd.print("EP Disabled"); lcd.print("EP Disabled");
@ -2558,7 +2558,7 @@ void UI_func_epiano_release(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* 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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
@ -2568,7 +2568,7 @@ void UI_func_epiano_release(uint8_t param)
} }
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
{ {
configuration.epiano.decay = constrain(configuration.epiano.decay - ENCODER[ENC_R].speed(), EP_DECAY_MIN, EP_DECAY_MAX); configuration.epiano.release = constrain(configuration.epiano.release - ENCODER[ENC_R].speed(), EP_RELEASE_MIN, EP_RELEASE_MAX);
} }
} }
@ -2939,7 +2939,7 @@ void UI_func_epiano_polyphony(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* 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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
{ {
@ -2947,8 +2947,8 @@ void UI_func_epiano_polyphony(uint8_t param)
} }
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
{ {
if (configuration.epiano.polyphony - 1 < 0) if (configuration.epiano.polyphony - 1 < 1)
configuration.epiano.polyphony = 0; configuration.epiano.polyphony = 1;
else else
{ {
configuration.epiano.polyphony = constrain(configuration.epiano.polyphony - 1, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX); configuration.epiano.polyphony = constrain(configuration.epiano.polyphony - 1, EP_POLYPHONY_MIN, EP_POLYPHONY_MAX);

@ -135,11 +135,10 @@
#endif #endif
// EPIANO // EPIANO
//#define USE_EPIANO #define USE_EPIANO
#ifdef USE_EPIANO #ifdef USE_EPIANO
#define NUM_EPIANO_VOICES 16 #define NUM_EPIANO_VOICES 16
//#define DEFAULT_EP_MIDI_CHANNEL 3 #define DEFAULT_EP_MIDI_CHANNEL 3
#define DEFAULT_EP_MIDI_CHANNEL 1
#endif #endif
// CHORUS parameters // CHORUS parameters

@ -1359,6 +1359,8 @@ bool save_sd_performance_json(uint8_t number)
AudioNoInterrupts(); AudioNoInterrupts();
check_performance_directory(number);
save_sd_seq_sub_vel_json(number); save_sd_seq_sub_vel_json(number);
save_sd_seq_sub_patterns_json(number); save_sd_seq_sub_patterns_json(number);

@ -51,6 +51,9 @@ static const audio_block_t zeroblock = {
#endif #endif
#if AUDIO_BLOCK_SAMPLES > 112 #if AUDIO_BLOCK_SAMPLES > 112
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 128
#error AUDIO_BLOCK_SAMPLES > 128 is a problem for this class
#endif #endif
} }
}; };
@ -93,12 +96,12 @@ void AudioEffectStereoPanorama::update(void)
float fcos = arm_cos_f32(pan * PI / 2.0); float fcos = arm_cos_f32(pan * PI / 2.0);
int16_t* out_p[2] = {&out[0]->data[0], &out[1]->data[0]}; int16_t* out_p[2] = {&out[0]->data[0], &out[1]->data[0]};
for (uint8_t n = 0; n < AUDIO_BLOCK_SAMPLES; n++) for (uint16_t n = 0; n < AUDIO_BLOCK_SAMPLES; n++)
{ {
*out_p[0]++ = int16_t(in_f[0][n] * _pseudo_log * fsin * SHRT_MAX); out_p[0][n] = int16_t(in_f[0][n] * _pseudo_log * fsin * SHRT_MAX);
*out_p[0]++ = int16_t(in_f[0][n] * _pseudo_log * fcos * SHRT_MAX); out_p[1][n] = int16_t(in_f[1][n] * _pseudo_log * fcos * SHRT_MAX);
*out_p[1]++ = int16_t(in_f[1][n] * _pseudo_log * fcos * SHRT_MAX); out_p[0][n] = int16_t(in_f[0][n] * _pseudo_log * fcos * SHRT_MAX);
*out_p[1]++ = int16_t(in_f[1][n] * _pseudo_log * fsin * SHRT_MAX); out_p[1][n] = int16_t(in_f[1][n] * _pseudo_log * fsin * SHRT_MAX);
} }
} }

@ -284,10 +284,13 @@ void mdaEPiano::setPolyphony(uint8_t value)
if (value <= 0) if (value <= 0)
value = 1; value = 1;
resetVoices();
if(voice) if(voice)
delete(voice); delete(voice);
voice=new VOICE[value]; voice=new VOICE[value];
resetVoices();
max_polyphony = value; max_polyphony = value;
} }

Loading…
Cancel
Save