Fixed T_3.6 config. I had to go down to single engine with 8 voices (and FX) or 16 voices (without FX).

pull/46/head
Holger Wirtz 3 years ago
parent 9e7f832e5d
commit 61eebb1272
  1. 40
      MicroDexed.ino
  2. 32
      config.h

@ -45,7 +45,7 @@
// Audio engines // Audio engines
AudioSynthDexed* MicroDexed[NUM_DEXED]; AudioSynthDexed* MicroDexed[NUM_DEXED];
AudioEffectDynamics* compressor[NUM_DEXED]; AudioEffectDynamics* dynamics[NUM_DEXED];
#if defined(USE_FX) #if defined(USE_FX)
AudioSynthWaveform* chorus_modulator[NUM_DEXED]; AudioSynthWaveform* chorus_modulator[NUM_DEXED];
@ -59,8 +59,6 @@ AudioEffectDelay* delay_fx[NUM_DEXED];
AudioMixer4* delay_mixer[NUM_DEXED]; AudioMixer4* delay_mixer[NUM_DEXED];
#endif #endif
AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; AudioEffectMonoStereo* mono2stereo[NUM_DEXED];
AudioEffectDynamics limiter_r;
AudioEffectDynamics limiter_l;
AudioMixer4 microdexed_peak_mixer; AudioMixer4 microdexed_peak_mixer;
AudioAnalyzePeak microdexed_peak; AudioAnalyzePeak microdexed_peak;
@ -157,16 +155,12 @@ AudioConnection patchCord18(stereo2mono, 1, usb1, 1);
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) #if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU)
AudioInputI2S i2s1in; AudioInputI2S i2s1in;
//AudioConnection patchCord19(stereo2mono, 0, audio_thru_mixer_r, 0); AudioConnection patchCord19(stereo2mono, 0, audio_thru_mixer_r, 0);
//AudioConnection patchCord20(stereo2mono, 1, audio_thru_mixer_l, 0); AudioConnection patchCord20(stereo2mono, 1, audio_thru_mixer_l, 0);
AudioConnection patchCord19(stereo2mono, 0, limiter_r, 0); AudioConnection patchCord21(i2s1in, 0, audio_thru_mixer_r, 1);
AudioConnection patchCord20(stereo2mono, 1, limiter_l, 0); AudioConnection patchCord22(i2s1in, 1, audio_thru_mixer_l, 1);
AudioConnection patchCord21(limiter_r, 0, audio_thru_mixer_r, 0); AudioConnection patchCord23(audio_thru_mixer_r, 0, i2s1, 0);
AudioConnection patchCord22(limiter_l, 0, audio_thru_mixer_l, 0); AudioConnection patchCord24(audio_thru_mixer_l, 0, i2s1, 1);
AudioConnection patchCord23(i2s1in, 0, audio_thru_mixer_r, 1);
AudioConnection patchCord24(i2s1in, 1, audio_thru_mixer_l, 1);
AudioConnection patchCord25(audio_thru_mixer_r, 0, i2s1, 0);
AudioConnection patchCord26(audio_thru_mixer_l, 0, i2s1, 1);
#endif #endif
// //
@ -183,7 +177,7 @@ AudioConnection * dynamicConnections[NUM_DEXED * 5];
void create_audio_engine_chain(uint8_t instance_id) void create_audio_engine_chain(uint8_t instance_id)
{ {
MicroDexed[instance_id] = new AudioSynthDexed(MAX_NOTES / NUM_DEXED, SAMPLE_RATE); MicroDexed[instance_id] = new AudioSynthDexed(MAX_NOTES / NUM_DEXED, SAMPLE_RATE);
compressor[instance_id] = new AudioEffectDynamics(); dynamics[instance_id] = new AudioEffectDynamics();
mono2stereo[instance_id] = new AudioEffectMonoStereo(); mono2stereo[instance_id] = new AudioEffectMonoStereo();
#if defined(USE_FX) #if defined(USE_FX)
chorus_modulator[instance_id] = new AudioSynthWaveform(); chorus_modulator[instance_id] = new AudioSynthWaveform();
@ -197,8 +191,8 @@ void create_audio_engine_chain(uint8_t instance_id)
delay_mixer[instance_id] = new AudioMixer4(); delay_mixer[instance_id] = new AudioMixer4();
#endif #endif
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *compressor[instance_id], 0); dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *dynamics[instance_id], 0);
dynamicConnections[nDynamic++] = new AudioConnection(*compressor[instance_id], 0, microdexed_peak_mixer, instance_id); dynamicConnections[nDynamic++] = new AudioConnection(*dynamics[instance_id], 0, microdexed_peak_mixer, instance_id);
#if defined(USE_FX) #if defined(USE_FX)
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *chorus_mixer[instance_id], 0); dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *chorus_mixer[instance_id], 0);
@ -525,11 +519,6 @@ void setup()
audio_thru_mixer_l.gain(3, 0.0); audio_thru_mixer_l.gain(3, 0.0);
#endif #endif
#if defined(LIMIT_THRESHOLD)
limiter_r.limit(LIMIT_THRESHOLD, LIMIT_ATTACK, LIMIT_RELEASE);
limiter_l.limit(LIMIT_THRESHOLD, LIMIT_ATTACK, LIMIT_RELEASE);
#endif
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("<setup end>")); Serial.println(F("<setup end>"));
#endif #endif
@ -1886,10 +1875,13 @@ void set_fx_params(void)
#if defined(USE_FX) #if defined(USE_FX)
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
// COMPRESSOR THRESHOLD,ATTACK,RELEASE,RATIO,KNEE_WIDTH // COMPRESSOR
#if defined(LIMIT_THRESHOLD)
dynamics[instance_id]->limit(LIMIT_THRESHOLD, LIMIT_ATTACK, LIMIT_RELEASE);
#endif
#if defined(COMP_THRESHOLD) #if defined(COMP_THRESHOLD)
compressor[instance_id]->compression(COMP_THRESHOLD, COMP_ATTACK, COMP_RELEASE, COMP_RATIO, COMP_KNEE_WIDTH); dynamics[instance_id]->compression(COMP_THRESHOLD, COMP_ATTACK, COMP_RELEASE, COMP_RATIO, COMP_KNEE_WIDTH);
compressor[instance_id]->makeupGain(COMP_MAKEUPGAIN); dynamics[instance_id]->makeupGain(COMP_MAKEUPGAIN);
#endif #endif
// CHORUS // CHORUS

@ -99,9 +99,15 @@
//* DEXED AND EFFECTS SETTINGS //* DEXED AND EFFECTS SETTINGS
//************************************************************************************************* //*************************************************************************************************
// Number of Dexed instances // Number of Dexed instances
#if defined(TEENSY3_6)
#define NUM_DEXED 1 // 1 or 2 - nothing else!
#else
#define NUM_DEXED 2 // 1 or 2 - nothing else! #define NUM_DEXED 2 // 1 or 2 - nothing else!
#endif
// FX-CHAIN ENABLE/DISABLE // FX-CHAIN ENABLE/DISABLE
#define USE_FX 1 #define USE_FX 1
// COMPRESSOR/ LIMITER // COMPRESSOR/ LIMITER
#define COMP_THRESHOLD -20.0 #define COMP_THRESHOLD -20.0
#define COMP_ATTACK 0.2 #define COMP_ATTACK 0.2
@ -109,9 +115,9 @@
#define COMP_RATIO 2.0 #define COMP_RATIO 2.0
#define COMP_KNEE_WIDTH 1.0 #define COMP_KNEE_WIDTH 1.0
#define COMP_MAKEUPGAIN 1.0 #define COMP_MAKEUPGAIN 1.0
#define LIMIT_THRESHOLD -3.0 #define LIMIT_THRESHOLD -1.0
#define LIMIT_ATTACK 0.03 #define LIMIT_ATTACK 0.03
#define LIMIT_RELEASE 0.7 #define LIMIT_RELEASE 0.2
// CHORUS parameters // CHORUS parameters
#define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(20.0)) // 20.0 ms delay buffer. #define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(20.0)) // 20.0 ms delay buffer.
@ -312,33 +318,27 @@
// Teensy-3.6 settings // Teensy-3.6 settings
#if defined(TEENSY3_6) #if defined(TEENSY3_6)
# if defined(USE_FX) # if defined(USE_FX)
# warning >>> With enabled FX only maximum of 8 voices is possible
# define MAX_NOTES 8
# else
# if F_CPU == 256000000 # if F_CPU == 256000000
# warning >>> Maximum of 16 voices.
# define MAX_NOTES 16 # define MAX_NOTES 16
# elif F_CPU == 240000000 # elif F_CPU == 240000000
# warning >>> Maximum of 14 voices. You should consider to use 256MHz overclocking to get a maximum of 16 voices
# define MAX_NOTES 14 # define MAX_NOTES 14
# elif F_CPU == 216000000 # elif F_CPU == 216000000
# warning >>> Maximum of 12 voices. You should consider to use 256MHz overclocking to get a maximum of 16 voices
# define MAX_NOTES 12 # define MAX_NOTES 12
# else # else
# warning >>> You should consider to use 256MHz overclocking to get polyphony of 16 voices <<< # warning >>> Maximum of 10 voices. You should consider to use 256MHz overclocking to get a maximum of 16 voices
# define MAX_NOTES 10 # define MAX_NOTES 10
# endif # endif
# else
# if F_CPU == 256000000
# define MAX_NOTES 18
# elif F_CPU == 240000000
# define MAX_NOTES 16
# elif F_CPU == 216000000
# define MAX_NOTES 15
# else
# define MAX_NOTES 12
# endif
# endif # endif
#endif #endif
#ifdef TEENSY3_5 #ifdef TEENSY3_5
#undef MIDI_DEVICE_USB_HOST #error >>> Not supported anymore!!!
#define MAX_NOTES 11
#undef USE_FX
#endif #endif
// MIDI // MIDI

Loading…
Cancel
Save