|
|
|
@ -82,7 +82,7 @@ AudioMixer4 audio_thru_mixer_l; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// Drumset
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
AudioPlaySdRaw* Drum[NUM_DRUMS]; |
|
|
|
|
AudioEffectMonoStereo* drum_mono2stereo[NUM_DRUMS]; |
|
|
|
|
AudioMixer4 drum_mixer_r; |
|
|
|
@ -158,7 +158,7 @@ AudioConnection patchCord19(audio_thru_mixer_r, 0, i2s1, 0); |
|
|
|
|
AudioConnection patchCord20(audio_thru_mixer_l, 0, i2s1, 1); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
#ifdef USE_FX |
|
|
|
|
AudioConnection patchCord21(drum_mixer_r, 0, reverb_mixer_r, 2); |
|
|
|
|
AudioConnection patchCord22(drum_mixer_l, 0, reverb_mixer_l, 2); |
|
|
|
@ -173,13 +173,13 @@ AudioConnection patchCord22(drum_mixer_l, 0, master_mixer_l, 2); |
|
|
|
|
//
|
|
|
|
|
// Dynamic patching of MicroDexed objects
|
|
|
|
|
//
|
|
|
|
|
uint16_t nDynamic = 0; |
|
|
|
|
uint8_t nDynamic = 0; |
|
|
|
|
#if defined(USE_FX) && MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 17]; |
|
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 16 + NUM_DRUMS * 3 ]; |
|
|
|
|
#elif defined(USE_FX) && MOD_FILTER_OUTPUT == MOD_NO_FILTER_OUTPUT |
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 16]; |
|
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 15 + NUM_DRUMS * 3]; |
|
|
|
|
#else |
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 5]; |
|
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 4 + NUM_DRUMS * 3]; |
|
|
|
|
#endif |
|
|
|
|
void create_audio_dexed_chain(uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
@ -198,10 +198,9 @@ void create_audio_dexed_chain(uint8_t instance_id) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[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); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *modchorus[instance_id], 0); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*MicroDexed[instance_id], 0, *modchorus[instance_id], 0); //////////////////////
|
|
|
|
|
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*chorus_modulator[instance_id], 0, *modchorus_filter[instance_id], 0); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*modchorus_filter[instance_id], 0, *modchorus[instance_id], 1); |
|
|
|
@ -222,22 +221,34 @@ void create_audio_dexed_chain(uint8_t instance_id) |
|
|
|
|
#endif |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 0, master_mixer_r, instance_id); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*mono2stereo[instance_id], 1, master_mixer_l, instance_id); |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Dexed-Instance: ")); |
|
|
|
|
Serial.println(instance_id); |
|
|
|
|
Serial.print(F("Dynamic-Connection-Counter=")); |
|
|
|
|
Serial.println(nDynamic); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Dynamic patching of Drum objects
|
|
|
|
|
//
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
uint16_t nDrumDynamic = 0; |
|
|
|
|
AudioConnection* dynamicDrumConnections[NUM_DRUMS * 3]; |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
void create_audio_drum_chain(uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
Drum[instance_id] = new AudioPlaySdRaw(); |
|
|
|
|
drum_mono2stereo[instance_id] = new AudioEffectMonoStereo(); |
|
|
|
|
|
|
|
|
|
dynamicDrumConnections[nDrumDynamic++] = new AudioConnection(*Drum[instance_id], 0, *drum_mono2stereo[instance_id], 0); |
|
|
|
|
dynamicDrumConnections[nDrumDynamic++] = new AudioConnection(*drum_mono2stereo[instance_id], 0, drum_mixer_r, instance_id); |
|
|
|
|
dynamicDrumConnections[nDrumDynamic++] = new AudioConnection(*drum_mono2stereo[instance_id], 1, drum_mixer_l, instance_id); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*Drum[instance_id], 0, *drum_mono2stereo[instance_id], 0); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*drum_mono2stereo[instance_id], 0, drum_mixer_r, instance_id); |
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(*drum_mono2stereo[instance_id], 1, drum_mixer_l, instance_id); |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("Drum-Instance: ")); |
|
|
|
|
Serial.println(instance_id); |
|
|
|
|
Serial.print(F("Dynamic-Connection-Counter=")); |
|
|
|
|
Serial.println(nDynamic); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -423,7 +434,7 @@ void setup() |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
// create dynamic Drum instances
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DRUMS; instance_id++) |
|
|
|
|
{ |
|
|
|
@ -534,7 +545,7 @@ void setup() |
|
|
|
|
master_mixer_r.gain(1, 0.0); |
|
|
|
|
master_mixer_l.gain(1, 0.0); |
|
|
|
|
#endif |
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
master_mixer_r.gain(2, 1.0); |
|
|
|
|
master_mixer_l.gain(2, 1.0); |
|
|
|
|
#else |
|
|
|
@ -697,7 +708,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
static uint8_t drum_counter; |
|
|
|
|
|
|
|
|
|
// Check for Drum
|
|
|
|
@ -2040,7 +2051,7 @@ void set_fx_params(void) |
|
|
|
|
freeverb.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef NUM_DRUMS |
|
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
|
#ifdef USE_FX |
|
|
|
|
reverb_mixer_r.gain(2, 1.0); // Drums-Send
|
|
|
|
|
reverb_mixer_l.gain(2, 1.0); // Drums-Send
|
|
|
|
|