From 8259addaf634f69f20eee7c5a9d65326fe486eda Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 30 Jan 2023 10:50:41 +0100 Subject: [PATCH] Fixes after some hint from PJRC forum (https://forum.pjrc.com/threads/29276-Limits-of-delay-effect-in-audio-library) --- .../examples/AudioDelay8M/AudioDelay8M.ino | 14 ++++++++++++-- .../src/effect_delay_ext8.cpp | 19 +++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/third-party/effect_delay_ext8/examples/AudioDelay8M/AudioDelay8M.ino b/third-party/effect_delay_ext8/examples/AudioDelay8M/AudioDelay8M.ino index cd2d432..8182615 100644 --- a/third-party/effect_delay_ext8/examples/AudioDelay8M/AudioDelay8M.ino +++ b/third-party/effect_delay_ext8/examples/AudioDelay8M/AudioDelay8M.ino @@ -6,7 +6,7 @@ // GUItool: begin automatically generated code AudioSynthWaveformSine sine1; //xy=382,432 AudioAmplifier amp1; //xy=606,441 -AudioEffectDelayExternal delayExt1; //xy=770,321 +AudioEffectDelayExternal8 delayExt1(AUDIO_MEMORY8_PSRAM_8MB,20000); //xy=770,321 AudioMixer4 mixer1; //xy=983,386 AudioOutputI2S i2s1; //xy=1131,343 AudioConnection patchCord1(sine1, amp1); @@ -20,6 +20,10 @@ AudioControlSGTL5000 sgtl5000; //xy=943,541 void setup() { + Serial.begin(230400); + delay(50); + Serial.println(""); + AudioMemory(100); sgtl5000.enable(); @@ -33,18 +37,24 @@ void setup() { sgtl5000.autoVolumeDisable(); sgtl5000.surroundSoundDisable(); sgtl5000.enhanceBassDisable(); - delayExt1.delay(0,100); + delayExt1.delay(0,333); + delayExt1.delay(1,664); + delayExt1.delay(2,1000); sine1.amplitude(1.0); sine1.frequency(440); sine1.phase(0.0); mixer1.gain(0,0.5); mixer1.gain(1,1.0); amp1.gain(1.0); + + Serial.println(""); } void loop() { + Serial.print(""); amp1.gain(1.0); delay(200); amp1.gain(0.0); + Serial.println(""); delay(2000); } diff --git a/third-party/effect_delay_ext8/src/effect_delay_ext8.cpp b/third-party/effect_delay_ext8/src/effect_delay_ext8.cpp index a8ddfc7..c5b3140 100644 --- a/third-party/effect_delay_ext8/src/effect_delay_ext8.cpp +++ b/third-party/effect_delay_ext8/src/effect_delay_ext8.cpp @@ -50,10 +50,21 @@ //#define SPIRAM_CS_PIN 6 -#define SPIRAM_MOSI_PIN 11 //----------------- -#define SPIRAM_MISO_PIN 12 // for Teensy 4.1 -#define SPIRAM_SCK_PIN 13 // -#define SPIRAM_CS_PIN 36 //----------------- +//#define SPIRAM_MOSI_PIN 11 //----------------- +//#define SPIRAM_MISO_PIN 12 // for Teensy 4.1 audio board +//#define SPIRAM_SCK_PIN 13 // +//#define SPIRAM_CS_PIN 36 //----------------- + // +#define SPIRAM_MOSI_PIN 50 //----------------- https://forum.pjrc.com/attachment.php?attachmentid=20853&d=1593888859 +#define SPIRAM_MISO_PIN 54 // for Teensy 4.1 +#define SPIRAM_SCK_PIN 49 //----------------- +#define SPIRAM_CS_PIN 52 // CS??? +//#define SPIRAM_CS_PIN 36 // CS0-2 +//#define SPIRAM_CS_PIN 37 // CS0-1 +//#define SPIRAM_CS_PIN 44 // CS2 +//#define SPIRAM_CS_PIN 10 // CS0 +//#define SPIRAM_CS_PIN 0 // CS1 +//#define SPIRAM_CS_PIN 38 // CS1-0 // #define MEMBOARD_CS0_PIN 2 #define MEMBOARD_CS1_PIN 3