Fixing audio thru for SGTL5000 Teensy audio card.

pull/32/head
Holger Wirtz 4 years ago
parent ee5e7ab6db
commit 8452f8c310
  1. 43
      MicroDexed.ino
  2. 9
      config.h
  3. BIN
      doc/manuals/Build-Manual.pdf
  4. 2
      doc/manuals/MicroDexed-User_Manual/MicroDexed-User_Manual.md

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

@ -56,7 +56,7 @@
// sed -i.orig 's/^#define USB_MIDI_SYSEX_MAX 290/#define USB_MIDI_SYSEX_MAX 4104/' /usr/local/arduino-teensy/hardware/teensy/avr/cores/teensy3/usb_midi.h
//#define USB_MIDI_SYSEX_MAX 4104
#define VERSION "1.0.5"
#define VERSION "1.0.6"
//*************************************************************************************************
//* DEVICE SETTINGS
@ -116,9 +116,10 @@
// SGTL5000
#ifdef TEENSY_AUDIO_BOARD
#define SGTL5000_AUDIO_ENHANCE 1
#define SGTL5000_AUDIO_THRU 1
//#define SGTL5000_AUDIO_THRU 1
#define SGTL5000_HEADPHONE_VOLUME 0.8
#endif
//*************************************************************************************************
//* AUDIO SOFTWARE SETTINGS
//*************************************************************************************************
@ -296,9 +297,9 @@
# endif
# else
# if F_CPU == 256000000
# define MAX_NOTES 9
# define MAX_NOTES 8
# elif F_CPU == 216000000
# define MAX_NOTES 7
# define MAX_NOTES 6
# else
# define MAX_NOTES 5
# endif

Binary file not shown.

@ -4,7 +4,7 @@ fontsize: 14pt
geometry: a4paper,margin=2cm
---
![](../../images/Logo/MicroDexed_logo_1.5mm_black_rounded.svg)
![](../../images/Logo/MicroDexed_logo_black.svg)
# MicroDexed User Manual

Loading…
Cancel
Save