|
|
|
@ -45,7 +45,7 @@ |
|
|
|
|
|
|
|
|
|
// Audio engines
|
|
|
|
|
AudioSynthDexed* MicroDexed[NUM_DEXED]; |
|
|
|
|
AudioEffectDynamics* compressor[NUM_DEXED]; |
|
|
|
|
AudioEffectDynamics* dynamics[NUM_DEXED]; |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
AudioSynthWaveform* chorus_modulator[NUM_DEXED]; |
|
|
|
@ -59,8 +59,6 @@ AudioEffectDelay* delay_fx[NUM_DEXED]; |
|
|
|
|
AudioMixer4* delay_mixer[NUM_DEXED]; |
|
|
|
|
#endif |
|
|
|
|
AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; |
|
|
|
|
AudioEffectDynamics limiter_r; |
|
|
|
|
AudioEffectDynamics limiter_l; |
|
|
|
|
|
|
|
|
|
AudioMixer4 microdexed_peak_mixer; |
|
|
|
|
AudioAnalyzePeak microdexed_peak; |
|
|
|
@ -157,16 +155,12 @@ AudioConnection patchCord18(stereo2mono, 1, usb1, 1); |
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
|
AudioInputI2S i2s1in; |
|
|
|
|
//AudioConnection patchCord19(stereo2mono, 0, audio_thru_mixer_r, 0);
|
|
|
|
|
//AudioConnection patchCord20(stereo2mono, 1, audio_thru_mixer_l, 0);
|
|
|
|
|
AudioConnection patchCord19(stereo2mono, 0, limiter_r, 0); |
|
|
|
|
AudioConnection patchCord20(stereo2mono, 1, limiter_l, 0); |
|
|
|
|
AudioConnection patchCord21(limiter_r, 0, audio_thru_mixer_r, 0); |
|
|
|
|
AudioConnection patchCord22(limiter_l, 0, audio_thru_mixer_l, 0); |
|
|
|
|
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); |
|
|
|
|
AudioConnection patchCord19(stereo2mono, 0, audio_thru_mixer_r, 0); |
|
|
|
|
AudioConnection patchCord20(stereo2mono, 1, audio_thru_mixer_l, 0); |
|
|
|
|
AudioConnection patchCord21(i2s1in, 0, audio_thru_mixer_r, 1); |
|
|
|
|
AudioConnection patchCord22(i2s1in, 1, audio_thru_mixer_l, 1); |
|
|
|
|
AudioConnection patchCord23(audio_thru_mixer_r, 0, i2s1, 0); |
|
|
|
|
AudioConnection patchCord24(audio_thru_mixer_l, 0, i2s1, 1); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@ -183,7 +177,7 @@ AudioConnection * dynamicConnections[NUM_DEXED * 5]; |
|
|
|
|
void create_audio_engine_chain(uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
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(); |
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
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(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *compressor[instance_id], 0); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*compressor[instance_id], 0, microdexed_peak_mixer, instance_id); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *dynamics[instance_id], 0); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*dynamics[instance_id], 0, microdexed_peak_mixer, instance_id); |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
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); |
|
|
|
|
#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 |
|
|
|
|
Serial.println(F("<setup end>")); |
|
|
|
|
#endif |
|
|
|
@ -1886,10 +1875,13 @@ void set_fx_params(void) |
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
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) |
|
|
|
|
compressor[instance_id]->compression(COMP_THRESHOLD, COMP_ATTACK, COMP_RELEASE, COMP_RATIO, COMP_KNEE_WIDTH); |
|
|
|
|
compressor[instance_id]->makeupGain(COMP_MAKEUPGAIN); |
|
|
|
|
dynamics[instance_id]->compression(COMP_THRESHOLD, COMP_ATTACK, COMP_RELEASE, COMP_RATIO, COMP_KNEE_WIDTH); |
|
|
|
|
dynamics[instance_id]->makeupGain(COMP_MAKEUPGAIN); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// CHORUS
|
|
|
|
|