|
|
@ -73,6 +73,10 @@ AudioAmplifier volume_l; |
|
|
|
AudioEffectStereoMono stereo2mono; |
|
|
|
AudioEffectStereoMono stereo2mono; |
|
|
|
AudioAnalyzePeak master_peak_r; |
|
|
|
AudioAnalyzePeak master_peak_r; |
|
|
|
AudioAnalyzePeak master_peak_l; |
|
|
|
AudioAnalyzePeak master_peak_l; |
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
|
|
|
|
AudioMixer4 audio_thru_mixer_r; |
|
|
|
|
|
|
|
AudioMixer4 audio_thru_mixer_l; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Audio chain tail
|
|
|
|
// Audio chain tail
|
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
@ -98,8 +102,10 @@ AudioConnection patchCord11(stereo2mono, 0, master_peak_l, 0); |
|
|
|
// Outputs
|
|
|
|
// Outputs
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
|
|
|
|
#ifndef SGTL5000_AUDIO_THRU |
|
|
|
AudioConnection patchCord12(stereo2mono, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord12(stereo2mono, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord13(stereo2mono, 1, i2s1, 1); |
|
|
|
AudioConnection patchCord13(stereo2mono, 1, i2s1, 1); |
|
|
|
|
|
|
|
#endif |
|
|
|
AudioControlSGTL5000 sgtl5000_1; |
|
|
|
AudioControlSGTL5000 sgtl5000_1; |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
@ -130,10 +136,15 @@ AudioOutputUSB usb1; |
|
|
|
AudioConnection patchCord15(stereo2mono, 0, usb1, 0); |
|
|
|
AudioConnection patchCord15(stereo2mono, 0, usb1, 0); |
|
|
|
AudioConnection patchCord16(stereo2mono, 1, usb1, 1); |
|
|
|
AudioConnection patchCord16(stereo2mono, 1, usb1, 1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef SGTL5000_AUDIO_THRU |
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
AudioInputI2S i2s1in; |
|
|
|
AudioInputI2S i2s1in; |
|
|
|
AudioConnection patchCord17(i2s1in, 0, master_mixer_r, 2); |
|
|
|
AudioConnection patchCord17(stereo2mono, 0, audio_thru_mixer_r, 0); |
|
|
|
AudioConnection patchCord18(i2s1in, 1, master_mixer_l, 2); |
|
|
|
AudioConnection patchCord18(stereo2mono, 1, audio_thru_mixer_l, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord19(i2s1in, 0, audio_thru_mixer_r, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord20(i2s1in, 1, audio_thru_mixer_l, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord21(audio_thru_mixer_r, 0, i2s1, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord22(audio_thru_mixer_l, 0, i2s1, 1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -301,6 +312,7 @@ void setup() |
|
|
|
sgtl5000_1.audioProcessorDisable(); |
|
|
|
sgtl5000_1.audioProcessorDisable(); |
|
|
|
sgtl5000_1.audioPostProcessorEnable(); |
|
|
|
sgtl5000_1.audioPostProcessorEnable(); |
|
|
|
#ifdef SGTL5000_AUDIO_THRU |
|
|
|
#ifdef SGTL5000_AUDIO_THRU |
|
|
|
|
|
|
|
sgtl5000_1.audioPreProcessorEnable(); |
|
|
|
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN); |
|
|
|
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN); |
|
|
|
sgtl5000_1.lineInLevel(5); |
|
|
|
sgtl5000_1.lineInLevel(5); |
|
|
|
sgtl5000_1.adcHighPassFilterEnable(); |
|
|
|
sgtl5000_1.adcHighPassFilterEnable(); |
|
|
@ -472,18 +484,29 @@ void setup() |
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(0, 1.0); |
|
|
|
master_mixer_r.gain(0, 1.0); |
|
|
|
master_mixer_l.gain(0, 1.0); |
|
|
|
master_mixer_l.gain(0, 1.0); |
|
|
|
|
|
|
|
master_mixer_r.gain(1, 0.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(1, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
master_mixer_r.gain(2, 0.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(2, 0.0); |
|
|
|
|
|
|
|
master_mixer_r.gain(3, 0.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(3, 0.0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) && defined(SGTL5000_AUDIO_THRU) |
|
|
|
|
|
|
|
audio_thru_mixer_r.gain(0, 1.0); // MD signal sum
|
|
|
|
|
|
|
|
audio_thru_mixer_l.gain(0, 1.0); // MD signal sum
|
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
#ifdef TEENSY_AUDIO_BOARD |
|
|
|
#ifdef SGTL5000_AUDIO_THRU |
|
|
|
audio_thru_mixer_r.gain(1, 1.0); // I2S nput
|
|
|
|
master_mixer_r.gain(2, 1.0); // I2S Input
|
|
|
|
audio_thru_mixer_l.gain(1, 1.0); // I2S input
|
|
|
|
master_mixer_l.gain(2, 1.0); // I2S Input
|
|
|
|
|
|
|
|
#else |
|
|
|
#else |
|
|
|
master_mixer_r.gain(2, 0.0); // I2S Input
|
|
|
|
audio_thru_mixer_r.gain(1, 0.0); |
|
|
|
master_mixer_l.gain(2, 0.0); // I2S Input
|
|
|
|
audio_thru_mixer_l.gain(1, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
audio_thru_mixer_r.gain(2, 0.0); |
|
|
|
|
|
|
|
audio_thru_mixer_l.gain(2, 0.0); |
|
|
|
|
|
|
|
audio_thru_mixer_r.gain(3, 0.0); |
|
|
|
|
|
|
|
audio_thru_mixer_l.gain(3, 0.0); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
master_mixer_r.gain(3, 0.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(3, 0.0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//AudioInterrupts();
|
|
|
|
//AudioInterrupts();
|
|
|
|
|
|
|
|
|
|
|
|