#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
//const int myInput = AUDIO_INPUT_MIC;
const int myInput = AUDIO_INPUT_LINEIN;
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=221,271
AudioMixer4 mixer1; //xy=388,160
AudioEffectDelayExternal delayExt1; //xy=528,436
AudioMixer4 mixer2; //xy=545,175
AudioOutputI2S i2s2; //xy=813,254
AudioConnection patchCord1(i2s1, 0, mixer1, 0);
AudioConnection patchCord2(i2s1, 1, mixer1, 1);
AudioConnection patchCord3(mixer1, 0, mixer2, 0);
AudioConnection patchCord4(mixer1, delayExt1);
AudioConnection patchCord5(delayExt1, 6, mixer2, 2);
AudioConnection patchCord6(delayExt1, 7, mixer1, 2);
AudioConnection patchCord7(mixer2, 0, i2s2, 0);
AudioConnection patchCord8(mixer2, 0, i2s2, 1);
AudioControlSGTL5000 audioShield;
// GUItool: end automatically generated code
int delayt;
void setup() {
AudioMemory(10);
audioShield.enable();
audioShield.volume(1);
audioShield.inputSelect(myInput);
mixer1.gain(0, 0.5);
mixer1.gain(1, 0.5);
mixer1.gain(2, 0.5);
// mix1.gain(3, 0.4);
mixer2.gain(0, 0.5);
mixer2.gain(2, 0.5);
delayExt1.delay(6, 1500);
delayExt1.delay(7, 1500);
}
void loop() {
int n = analogRead(15);
if (n != delayt) {
delayt= n;
delayExt1.delay(6, delayt*2);
delayExt1.delay(7, delayt*2);
}
int vol = analogRead(15);
delay(250);
}