|
|
|
@ -53,6 +53,7 @@ AudioMixer4 mixer_r; |
|
|
|
|
AudioMixer4 mixer_l; |
|
|
|
|
AudioAmplifier volume_r; |
|
|
|
|
AudioAmplifier volume_l; |
|
|
|
|
AudioAmplifier inverter; |
|
|
|
|
AudioEffectModulatedDelay modchorus_r; |
|
|
|
|
AudioEffectModulatedDelay modchorus_l; |
|
|
|
|
AudioSynthWaveform modulator; |
|
|
|
@ -63,24 +64,25 @@ AudioConnection patchCord3(queue_l, freeverb_l); |
|
|
|
|
AudioConnection patchCord4(queue_r, 0, modchorus_r, 0); |
|
|
|
|
AudioConnection patchCord5(queue_l, 0, modchorus_l, 0); |
|
|
|
|
AudioConnection patchCord6(modulator, 0, modchorus_r, 1); |
|
|
|
|
AudioConnection patchCord7(modulator, 0, modchorus_l, 1); |
|
|
|
|
AudioConnection patchCord8(queue_r, 0, mixer_r, 0); |
|
|
|
|
AudioConnection patchCord9(queue_l, 0, mixer_l, 0); |
|
|
|
|
AudioConnection patchCord10(modchorus_r, 0, mixer_r, 2); |
|
|
|
|
AudioConnection patchCord11(modchorus_l, 0, mixer_l, 2); |
|
|
|
|
AudioConnection patchCord12(freeverb_r, 0, mixer_r, 1); |
|
|
|
|
AudioConnection patchCord13(freeverb_l, 0, mixer_l, 1); |
|
|
|
|
AudioConnection patchCord14(mixer_r, volume_r); |
|
|
|
|
AudioConnection patchCord15(mixer_l, volume_l); |
|
|
|
|
AudioConnection patchCord7(modulator, inverter); |
|
|
|
|
AudioConnection patchCord8(inverter, 0, modchorus_l, 1); |
|
|
|
|
AudioConnection patchCord9(queue_r, 0, mixer_r, 0); |
|
|
|
|
AudioConnection patchCord10(queue_l, 0, mixer_l, 0); |
|
|
|
|
AudioConnection patchCord11(modchorus_r, 0, mixer_r, 2); |
|
|
|
|
AudioConnection patchCord12(modchorus_l, 0, mixer_l, 2); |
|
|
|
|
AudioConnection patchCord13(freeverb_r, 0, mixer_r, 1); |
|
|
|
|
AudioConnection patchCord14(freeverb_l, 0, mixer_l, 1); |
|
|
|
|
AudioConnection patchCord15(mixer_r, volume_r); |
|
|
|
|
AudioConnection patchCord16(mixer_l, volume_l); |
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
AudioOutputI2S i2s1; |
|
|
|
|
AudioConnection patchCord16(volume_r, 0, i2s1, 0); |
|
|
|
|
AudioConnection patchCord17(volume_l, 0, i2s1, 1); |
|
|
|
|
AudioConnection patchCord17(volume_r, 0, i2s1, 0); |
|
|
|
|
AudioConnection patchCord18(volume_l, 0, i2s1, 1); |
|
|
|
|
AudioControlSGTL5000 sgtl5000_1; |
|
|
|
|
#elif defined(TGA_AUDIO_BOARD) |
|
|
|
|
AudioOutputI2S i2s1; |
|
|
|
|
AudioConnection patchCord16(volume_r, 0, i2s1, 1); |
|
|
|
|
AudioConnection patchCord17(volume_l, 0, i2s1, 0); |
|
|
|
|
AudioConnection patchCord17(volume_r, 0, i2s1, 1); |
|
|
|
|
AudioConnection patchCord18(volume_l, 0, i2s1, 0); |
|
|
|
|
AudioControlWM8731master wm8731_1; |
|
|
|
|
#else |
|
|
|
|
AudioOutputPT8211 pt8211_1; |
|
|
|
@ -153,8 +155,8 @@ elapsedMillis cpu_mem_millis; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// Allocate the delay lines for left and right channels
|
|
|
|
|
short l_delayline[CHORUS_DELAY_LENGTH_BYTES]; |
|
|
|
|
short r_delayline[CHORUS_DELAY_LENGTH_BYTES]; |
|
|
|
|
short l_delayline[CHORUS_DELAY_LENGTH_SAMPLES]; |
|
|
|
|
short r_delayline[CHORUS_DELAY_LENGTH_SAMPLES]; |
|
|
|
|
|
|
|
|
|
//*************************************************************************************************
|
|
|
|
|
//* SETUP FUNCTION
|
|
|
|
@ -226,11 +228,11 @@ void setup() |
|
|
|
|
Serial.print(audio_block_time_us); |
|
|
|
|
Serial.println(F("us)")); |
|
|
|
|
|
|
|
|
|
if (!modchorus_r.begin(r_delayline, CHORUS_DELAY_LENGTH_BYTES)) { |
|
|
|
|
if (!modchorus_r.begin(r_delayline, CHORUS_DELAY_LENGTH_SAMPLES)) { |
|
|
|
|
Serial.println(F("AudioEffectModulatedDelay - right channel begin failed")); |
|
|
|
|
while (1); |
|
|
|
|
} |
|
|
|
|
if (!modchorus_l.begin(l_delayline, CHORUS_DELAY_LENGTH_BYTES)) { |
|
|
|
|
if (!modchorus_l.begin(l_delayline, CHORUS_DELAY_LENGTH_SAMPLES)) { |
|
|
|
|
Serial.println(F("AudioEffectModulatedDelay - left channel begin failed")); |
|
|
|
|
while (1); |
|
|
|
|
} |
|
|
|
@ -241,16 +243,15 @@ void setup() |
|
|
|
|
modulator.frequency(1.0); |
|
|
|
|
modulator.phase(0); |
|
|
|
|
modulator.offset(0.0); |
|
|
|
|
inverter.gain(-1.0); // change phase for second moduleated delay
|
|
|
|
|
|
|
|
|
|
// internal mixing of original signal(0), reverb(1) and chorus(2)
|
|
|
|
|
//mixer_r.gain(0, 1.0);
|
|
|
|
|
//mixer_l.gain(0, 1.0);
|
|
|
|
|
mixer_r.gain(0, 0.0); |
|
|
|
|
mixer_l.gain(0, 0.0); |
|
|
|
|
mixer_r.gain(1, 0.0); |
|
|
|
|
mixer_l.gain(1, 0.0); |
|
|
|
|
mixer_r.gain(2, 1.0); |
|
|
|
|
mixer_l.gain(2, 1.0); |
|
|
|
|
mixer_r.gain(0, 1.0); |
|
|
|
|
mixer_l.gain(0, 1.0); |
|
|
|
|
mixer_r.gain(1, 0.5); |
|
|
|
|
mixer_l.gain(1, 0.5); |
|
|
|
|
mixer_r.gain(2, 0.5); |
|
|
|
|
mixer_l.gain(2, 0.5); |
|
|
|
|
|
|
|
|
|
// set master volume
|
|
|
|
|
set_master_volume(master_volume); |
|
|
|
|