From 168eedeb8d11230f42539f9a8ea43334469ca658 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 13 Feb 2019 09:10:44 +0100 Subject: [PATCH] Fixing usage of TGA board Fixing some problems with config.h --- MicroDexed.ino | 47 ++++++++++++++++++++++++++--------------------- config.h | 28 +++++++++------------------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 23914fe..a4349df 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -54,35 +54,40 @@ AudioFilterStateVariable filter1; AudioEffectDelay delay1; AudioMixer4 mixer1; AudioMixer4 mixer2; -AudioConnection patchCord1(queue1, peak1); -AudioConnection patchCord2(queue1, 0, filter1, 0); -AudioConnection patchCord3(filter1, 0, delay1, 0); -AudioConnection patchCord4(filter1, 0, mixer1, 0); -AudioConnection patchCord5(filter1, 0, mixer2, 0); -AudioConnection patchCord6(delay1, 0, mixer1, 1); -AudioConnection patchCord7(delay1, 0, mixer2, 2); -AudioConnection patchCord8(mixer1, delay1); -AudioConnection patchCord9(queue1, 0, mixer1, 3); // for disabling the filter -AudioConnection patchCord10(mixer1, 0, mixer2, 1); -#if defined(TEENSY_AUDIO_BOARD) || defined(TGA_AUDIO_BOARD) +AudioConnection patchCord0(queue1, peak1); +AudioConnection patchCord1(queue1, 0, filter1, 0); +AudioConnection patchCord2(filter1, 0, delay1, 0); +AudioConnection patchCord3(filter1, 0, mixer1, 0); +AudioConnection patchCord4(filter1, 0, mixer2, 0); +AudioConnection patchCord5(delay1, 0, mixer1, 1); +AudioConnection patchCord6(delay1, 0, mixer2, 2); +AudioConnection patchCord7(mixer1, delay1); +AudioConnection patchCord8(queue1, 0, mixer1, 3); // for disabling the filter +AudioConnection patchCord9(mixer1, 0, mixer2, 1); +#if defined(TEENSY_AUDIO_BOARD) AudioOutputI2S i2s1; -AudioConnection patchCord11(mixer2, 0, i2s1, 0); -AudioConnection patchCord12(mixer2, 0, i2s1, 1); -#ifdef TEENSY_AUDIO_BOARD +AudioConnection patchCord110(mixer2, 0, i2s1, 0); +AudioConnection patchCord111(mixer2, 0, i2s1, 1); AudioControlSGTL5000 sgtl5000_1; -#else +#elif defined(TGA_AUDIO_BOARD) +AudioOutputI2S i2s1; +AudioAmplifier volume_r; +AudioAmplifier volume_l; +AudioConnection patchCord10(mixer2, volume_r); +AudioConnection patchCord11(mixer2, volume_l); +AudioConnection patchCord12(volume_r, 0, i2s1, 1); +AudioConnection patchCord13(volume_l, 0, i2s1, 0); AudioControlWM8731master wm8731_1; -#endif #else AudioOutputPT8211 pt8211_1; AudioAmplifier volume_master; AudioAmplifier volume_r; AudioAmplifier volume_l; -AudioConnection patchCord11(mixer2, 0, volume_master, 0); -AudioConnection patchCord12(volume_master, volume_r); -AudioConnection patchCord13(volume_master, volume_l); -AudioConnection patchCord14(volume_r, 0, pt8211_1, 0); -AudioConnection patchCord15(volume_l, 0, pt8211_1, 1); +AudioConnection patchCord10(mixer2, 0, volume_master, 0); +AudioConnection patchCord11(volume_master, volume_r); +AudioConnection patchCord12(volume_master, volume_l); +AudioConnection patchCord13(volume_r, 0, pt8211_1, 0); +AudioConnection patchCord14(volume_l, 0, pt8211_1, 1); #endif Dexed* dexed = new Dexed(SAMPLE_RATE); diff --git a/config.h b/config.h index 66ffa02..8e2bab3 100644 --- a/config.h +++ b/config.h @@ -43,7 +43,8 @@ #define MIDI_DEVICE_USB_HOST 1 // AUDIO -//#define TEENSY_AUDIO_BOARD 1 +// If nothing is defined PT8211 is used as audio output device! +#define TEENSY_AUDIO_BOARD 1 //#define TGA_AUDIO_BOARD //************************************************************************************************* @@ -171,32 +172,21 @@ #ifdef MIDI_DEVICE_USB #define USBCON 1 #endif -#if !defined(__MK66FX1M0__) // check for Teensy-3.6 -#define MAX_NOTES 11 // No? -#undef USE_ONBOARD_USB_HOST -#else -#define MAX_NOTES 16 // Yes -#endif - -// MIDI -#ifdef MIDI_DEVICE_USB -#define USBCON 1 -#endif -#if defined(__MK66FX1M0__) +#if defined(__MK66FX1M0__) // Teensy-3.6 // Teensy-3.6 settings #define MIDI_DEVICE_USB_HOST 1 +#define MAX_NOTES 16 #else // Teensy-3.5 settings #undef MIDI_DEVICE_USB_HOST -#endif -// Engine -#if defined(__MK66FX1M0__) -// Teensy-3.6 settings -#define MAX_NOTES 16 -#else #define MAX_NOTES 11 #endif +// Audio +#ifdef TGA_AUDIO_BOARD +#define REDUCE_LOUDNESS 2 +#endif + // Some optimizations #define USE_TEENSY_DSP 1 #define SUM_UP_AS_INT 1