Small fixes.

pull/112/head
Holger Wirtz 3 years ago
parent 64ad2968c7
commit 67826b21ed
  1. 63
      MicroDexed.ino
  2. 18
      UI.hpp
  3. 9
      config.h

@ -61,7 +61,9 @@ using namespace TeensyTimerTool;
// Audio engines
AudioSynthDexed* MicroDexed[NUM_DEXED];
#if defined(USE_EPIANO)
AudioSynthEPiano ep(NUM_EPIANO_VOICES);
#endif
#if defined(USE_FX)
AudioSynthWaveform* chorus_modulator[NUM_DEXED];
@ -108,11 +110,11 @@ AudioEffectFreeverbStereoFloat freeverb;
#endif
#if defined(USE_EPIANO)
AudioMixer<4> master_mixer_r;
AudioMixer<4> master_mixer_l;
#else
AudioMixer<5> master_mixer_r;
AudioMixer<5> master_mixer_l;
#else
AudioMixer<4> master_mixer_r;
AudioMixer<4> master_mixer_l;
#endif
AudioAmplifier volume_r;
AudioAmplifier volume_l;
@ -179,13 +181,13 @@ AudioConnection patchCord[] = {
#ifdef USE_PLATEREVERB
{reverb_mixer_r, 0, reverb, 0},
{reverb_mixer_l, 0, reverb, 1},
{reverb, 0, master_mixer_r, 3},
{reverb, 1, master_mixer_l, 3},
{reverb, 0, master_mixer_r, CH_REVERB},
{reverb, 1, master_mixer_l, CH_REVERB},
#else
{reverb_mixer_r, 0, freeverb, 0},
{reverb_mixer_l, 0, freeverb, 1},
{freeverb, 0, master_mixer_r, 3},
{freeverb, 1, master_mixer_l, 3},
{freeverb, 0, master_mixer_r, CH_REVERB},
{freeverb, 1, master_mixer_l, CH_REVERB},
#endif
#endif
{master_mixer_r, volume_r},
@ -236,11 +238,11 @@ AudioConnection patchCord[] = {
#ifdef USE_FX
{drum_reverb_send_mixer_r, 0, reverb_mixer_r, 2},
{drum_reverb_send_mixer_l, 0, reverb_mixer_l, 2},
{drum_mixer_r, 0, master_mixer_r, 2},
{drum_mixer_l, 0, master_mixer_l, 2},
{drum_mixer_r, 0, master_mixer_r, CH_DRUMS},
{drum_mixer_l, 0, master_mixer_l, CH_DRUMS},
#else
{drum_mixer_r, 0, master_mixer_r, 2},
{drum_mixer_l, 0, master_mixer_l, 2},
{drum_mixer_r, 0, master_mixer_r, CH_DRUMS},
{drum_mixer_l, 0, master_mixer_l, CH_DRUMS},
#endif
#endif
@ -264,8 +266,8 @@ AudioConnection patchCord[] = {
{ep_chorus_mixer_r, 0, reverb_mixer_r, 3},
{ep_chorus_mixer_l, 0, reverb_mixer_l, 3},
#else
{ep, 0, master_mixer_r, 4},
{ep, 1, master_mixer_l, 4},
{ep, 0, master_mixer_r, CH_EPIANO},
{ep, 1, master_mixer_l, CH_EPIANO},
#endif
#endif
};
@ -580,7 +582,6 @@ void setup()
// Setup EPiano
#if defined(USE_FX)
#if defined(USE_EPIANO)
// EP_CHORUS
memset(ep_delayline_r, 0, sizeof(ep_delayline_r));
if (!ep_modchorus_r.begin(ep_delayline_r, MOD_DELAY_SAMPLE_BUFFER))
@ -714,24 +715,24 @@ void setup()
master_mixer_l.gain(instance_id, VOL_MAX_FLOAT);
}
#else
master_mixer_r.gain(0, VOL_MAX_FLOAT);
master_mixer_l.gain(0, VOL_MAX_FLOAT);
master_mixer_r.gain(1, 0.0);
master_mixer_l.gain(1, 0.0);
master_mixer_r.gain(CH_DEXED1, VOL_MAX_FLOAT);
master_mixer_l.gain(CH_DEXED1, VOL_MAX_FLOAT);
master_mixer_r.gain(CH_DEXED2, 0.0);
master_mixer_l.gain(CH_DEXED2, 0.0);
#endif
master_mixer_r.gain(CH_REVERB, VOL_MAX_FLOAT);
master_mixer_l.gain(CH_REVERB, VOL_MAX_FLOAT);
#if NUM_DRUMS > 0
master_mixer_r.gain(2, VOL_MAX_FLOAT);
master_mixer_l.gain(2, VOL_MAX_FLOAT);
master_mixer_r.gain(CH_DRUMS, VOL_MAX_FLOAT);
master_mixer_l.gain(CH_DRUMS, VOL_MAX_FLOAT);
seq.drums_volume = VOL_MAX_FLOAT;
#else
master_mixer_r.gain(2, 0.0);
master_mixer_l.gain(2, 0.0);
master_mixer_r.gain(CH_DRUMS, 0.0);
master_mixer_l.gain(CH_DRUMS, 0.0);
#endif
master_mixer_r.gain(3, VOL_MAX_FLOAT);
master_mixer_l.gain(3, VOL_MAX_FLOAT);
#if defined(USE_EPIANO)
master_mixer_r.gain(4, VOL_MAX_FLOAT);
master_mixer_l.gain(4, VOL_MAX_FLOAT);
master_mixer_r.gain(CH_EPIANO, VOL_MAX_FLOAT);
master_mixer_l.gain(CH_EPIANO, VOL_MAX_FLOAT);
#endif
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU)
@ -760,6 +761,8 @@ void setup()
void loop()
{
master_mixer_r.gain(CH_EPIANO, VOL_MAX_FLOAT);
master_mixer_l.gain(CH_EPIANO, VOL_MAX_FLOAT);
// MIDI input handling
check_midi_devices();
@ -2012,8 +2015,8 @@ void init_MIDI_send_CC(void)
void set_drums_volume(float vol)
{
master_mixer_r.gain(2, vol);
master_mixer_l.gain(2, vol);
master_mixer_r.gain(CH_DRUMS, vol);
master_mixer_l.gain(CH_DRUMS, vol);
}
void set_volume(uint8_t v, uint8_t m)
{
@ -2561,8 +2564,8 @@ void set_fx_params(void)
ep_chorus_inverter.gain(-1.0);
#endif
master_mixer_r.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
master_mixer_r.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
#endif
#ifdef SGTL5000_AUDIO_ENHANCE

@ -139,11 +139,11 @@ extern AudioMixer<2> ep_delay_mixer_l;
#endif
#if defined(USE_EPIANO)
extern AudioMixer<4> master_mixer_r;
extern AudioMixer<4> master_mixer_l;
#else
extern AudioMixer<5> master_mixer_r;
extern AudioMixer<5> master_mixer_l;
#else
extern AudioMixer<4> master_mixer_r;
extern AudioMixer<4> master_mixer_l;
#endif
extern AudioEffectStereoMono stereo2mono;
extern AudioAnalyzePeak master_peak_r;
@ -1305,10 +1305,10 @@ void UI_func_reverb_level(uint8_t param)
lcd_display_bar_int("Reverb Level", configuration.fx.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, true);
//master_mixer_r.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)));
//master_mixer_l.gain(3, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)));
master_mixer_r.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain(3, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
//master_mixer_r.gain(CH_REVERB, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)));
//master_mixer_l.gain(CH_REVERB, pseudo_log_curve(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)));
master_mixer_r.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain(CH_REVERB, volume_transform(mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, VOL_MAX_FLOAT)));
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -3672,8 +3672,8 @@ void UI_func_drums_main_volume(uint8_t param)
lcd.print(displayname);
lcd.setCursor(8, 1);
lcd.print("/100");
master_mixer_r.gain (2, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain (2, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT)));
master_mixer_r.gain (CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT)));
master_mixer_l.gain (CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT)));
seq.drums_volume = mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT);
}
if (LCDML.FUNC_close()) // ****** STABLE END *********

@ -904,6 +904,15 @@ typedef struct configuration_s {
fx_t fx;
} config_t;
enum master_mixer_ports {
CH_DEXED2,
CH_DEXED1,
CH_REVERB,
CH_DRUMS,
CH_EPIANO
};
#if !defined(_MAPFLOAT)
#define _MAPFLOAT
inline float mapfloat(float val, float in_min, float in_max, float out_min, float out_max)

Loading…
Cancel
Save