For added fun, here's the synth layout in the design tool:
the last 4 taps in the delay aren't used... audio memory set to 200. The delay feedback loop seems clunky wrt memory but this sounds OK with randomly generated tonal values in various musical keys and modes.
// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=129.5,250.25000286102295
AudioInputI2S i2s1; //xy=144.75,431
AudioEffectEnvelope envelope1; //xy=186,298
AudioSynthKarplusStrong string1; //xy=347.5,369.5
AudioMixer4 mixer1; //xy=385,286
AudioEffectDelay delay1; //xy=508,294
AudioSynthWaveform lfo1; //xy=625,133
AudioSynthWaveform lfo2; //xy=637,177
AudioMixer4 mixer2; //xy=650,267
AudioMixer4 mixer3; //xy=652,336
AudioMixer4 mixer4; //xy=819,298
AudioMixer4 mixer5; //xy=822.7500114440918,395.25000762939453
AudioFilterLadder filter1; //xy=871,153
AudioAnalyzeFFT1024 fft1024_1; //xy=956.25,452.5
AudioOutputI2S i2s2; //xy=971.5,392
AudioConnection patchCord1(sine1, envelope1);
AudioConnection patchCord2(i2s1, 0, mixer1, 2);
AudioConnection patchCord3(i2s1, 0, mixer5, 2);
AudioConnection patchCord4(envelope1, 0, mixer5, 1);
AudioConnection patchCord5(envelope1, 0, mixer1, 1);
AudioConnection patchCord6(string1, 0, mixer1, 3);
AudioConnection patchCord7(mixer1, delay1);
AudioConnection patchCord8(delay1, 0, mixer2, 0);
AudioConnection patchCord9(delay1, 1, mixer2, 1);
AudioConnection patchCord10(delay1, 2, mixer2, 2);
AudioConnection patchCord11(delay1, 3, mixer2, 3);
AudioConnection patchCord12(delay1, 4, mixer3, 0);
AudioConnection patchCord13(delay1, 5, mixer3, 1);
AudioConnection patchCord14(delay1, 6, mixer3, 2);
AudioConnection patchCord15(delay1, 7, mixer3, 3);
AudioConnection patchCord16(lfo1, 0, filter1, 1);
AudioConnection patchCord17(lfo2, 0, filter1, 2);
AudioConnection patchCord18(mixer2, 0, mixer4, 0);
AudioConnection patchCord19(mixer3, 0, mixer4, 1);
AudioConnection patchCord20(mixer4, 0, filter1, 0);
AudioConnection patchCord21(mixer4, 0, mixer5, 0);
AudioConnection patchCord22(mixer5, 0, i2s2, 0);
AudioConnection patchCord23(mixer5, 0, i2s2, 1);
AudioConnection patchCord24(mixer5, fft1024_1);
AudioConnection patchCord25(filter1, 0, mixer1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=528.7222366333008,467.8174514770508
// GUItool: end automatically generated code
I get line audio input if I switch to RMS instead of FFT, but unfortunately it's just nothing or screaming feedback if I multiply it by more than 3.5 or so (mixed so that it bypasses the synth and goes to output with everything else zeroed out...). This has always worked with an electret mic as input but since this synth has an internal speaker it would just feed back. Putting this synth on a shelf for now as I'm not getting anywhere and I've put too much time into it at the moment.
This code shows the RMS in blue on my 7 LEDs anyway; maybe do a nice blackbody temperature fade if I'm stuck with RMS...
Code:
void displayRMS()
{
if (rms1.available())
{
uint8_t RMSval = rms1.read() * 10.0;
RMSval = constrain(RMSval, 1, 7);
Serial.println(RMSval);
for (LEDcounter = 1; LEDcounter <= 8; LEDcounter++)
{
leds[LEDcounter] = CHSV(0, 0, 0);
// leds[0] = CHSV(0, 255, 255);
if (LEDcounter == NUM_LEDS)
{
leds[RMSval] = CHSV(255, 255, 255);
FastLED.show();
}
}
}
}