New Reverbs and Delay for the standard AudioLib (int16_t)

Thank you Pio for putting the all this together.

I had the same question as greyman previously, but just used two instances of the regular reverb as a placeholder for the plate reverb, then substituted the appropriate reverb in the wiring section. I also used the older version because it was easier to control with just six knobs, vs. the 24 odd buttons and knobs needed for the newer version. I plan on doing a new version with a display and rotary encoder to get past that hurdle.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "effect_platervbstereo.h"

AudioInputI2S            i2s1;
//AudioEffectFreeverb      freeverb2;
//AudioEffectFreeverb      freeverb1;
AudioEffectPlateReverb   reverb;  //single plate reverb (stero) replace 2 freeverbs (mono)
AudioMixer4              mixer1;

AudioOutputI2S           i2s2;
AudioConnection          patchCord1(i2s1, 0, reverb, 0);  //uncomment for plate reverb
AudioConnection          patchCord2(i2s1, 0, reverb, 1);  //uncomment for plate reverb
//AudioConnection          patchCord1(i2s1, 0, freeverb1, 0);  comment for plate reverb
//AudioConnection          patchCord2(i2s1, 0, freeverb2, 1);  comment for plate reverb
AudioConnection          patchCord3(i2s1, 0, mixer1, 2);
AudioConnection          patchCord4(reverb, 0, mixer1, 0);  //uncomment for plate reverb
AudioConnection          patchCord5(reverb, 1, mixer1, 1);  //uncomment for plate reverb
//AudioConnection          patchCord4(freeverb1, 0, mixer1, 0);  comment for plate reverb
//AudioConnection          patchCord5(freeverb2, 1, mixer1, 1);  comment for plate reverb
AudioConnection          patchCord6(mixer1, 0, i2s2, 0);
AudioControlSGTL5000     sgtl5000_1;

This substitution method is no longer necessary since there is a version of the audio layout tool on the hexeguitar github.

I put this in a homemade amp, and it sounds great.
 
Thank you Pio for putting the all this together.

I had the same question as greyman previously, but just used two instances of the regular reverb as a placeholder for the plate reverb, then substituted the appropriate reverb in the wiring section. I also used the older version because it was easier to control with just six knobs, vs. the 24 odd buttons and knobs needed for the newer version. I plan on doing a new version with a display and rotary encoder to get past that hurdle.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "effect_platervbstereo.h"

AudioInputI2S            i2s1;
//AudioEffectFreeverb      freeverb2;
//AudioEffectFreeverb      freeverb1;
AudioEffectPlateReverb   reverb;  //single plate reverb (stero) replace 2 freeverbs (mono)
AudioMixer4              mixer1;

AudioOutputI2S           i2s2;
AudioConnection          patchCord1(i2s1, 0, reverb, 0);  //uncomment for plate reverb
AudioConnection          patchCord2(i2s1, 0, reverb, 1);  //uncomment for plate reverb
//AudioConnection          patchCord1(i2s1, 0, freeverb1, 0);  comment for plate reverb
//AudioConnection          patchCord2(i2s1, 0, freeverb2, 1);  comment for plate reverb
AudioConnection          patchCord3(i2s1, 0, mixer1, 2);
AudioConnection          patchCord4(reverb, 0, mixer1, 0);  //uncomment for plate reverb
AudioConnection          patchCord5(reverb, 1, mixer1, 1);  //uncomment for plate reverb
//AudioConnection          patchCord4(freeverb1, 0, mixer1, 0);  comment for plate reverb
//AudioConnection          patchCord5(freeverb2, 1, mixer1, 1);  comment for plate reverb
AudioConnection          patchCord6(mixer1, 0, i2s2, 0);
AudioControlSGTL5000     sgtl5000_1;

This substitution method is no longer necessary since there is a version of the audio layout tool on the hexeguitar github.

I put this in a homemade amp, and it sounds great
 
Thanks for the post, but it's not how to implement the library in code I'm worried about - I have the GUI tool for that.
It's how to add the effects to the libs I'm unsure about. I've never installed third party libs before.
 
Scroll down to the Manual Installation section and follow the steps.
Works with the IDE v2, too:
ard_lib.png
 
Thanks for the post, but it's not how to implement the library in code I'm worried about - I have the GUI tool for that.
It's how to add the effects to the libs I'm unsure about. I've never installed third party libs before.
Since I used the older t40fx library, I manually added the "effect_platervbstereo.h" and "effect_platervbstereo.cpp" to the arduino project folder to access them.

Here is the full sketch in case you want to see what I did.
I basically copied as much of the t40fx plate reverb example as I could.
I'm hopefully providing the final, working copy. I didn't keep dedicated backups before starting the the GUI version, unfortunately.

C++:
/*
building plate reverb from scratch, attempting to use pjrc audio tool
to make symbolic framkework, then replace plate reverb for the auto
generated reverb symbols.
Uses hexeguitar plate reverb library (older one) due ease of control
with fewer pots. https://github.com/hexeguitar/t40fx/tree/main/Hx_PlateReverb
Note, I did not utilize bypass or lowpass due to limited pot spot availablity
on the amp at the time.
To use these libraries, just place the "effect_platervbstereo.h" and
"effect_platervbstereo.cpp" in the same folder as the main .ino file.
*/

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "effect_platervbstereo.h"

AudioInputI2S            i2s1;
//AudioEffectFreeverb      freeverb2;
//AudioEffectFreeverb      freeverb1;
AudioEffectPlateReverb   reverb;  //single plate reverb (stero) replace 2 freeverbs (mono)
AudioMixer4              mixer1;  //left output mixer
AudioMixer4              mixer2;  //right output mixer
AudioOutputI2S           i2s2;

//Line in to reverb
AudioConnection          patchCord1(i2s1, 0, reverb, 0);
AudioConnection          patchCord2(i2s1, 0, reverb, 1);

//left
AudioConnection          patchCord3(i2s1, 0, mixer1, 1);
AudioConnection          patchCord4(reverb, 0, mixer1, 0);

//right
AudioConnection          patchCord5(i2s1, 0, mixer2, 1);
AudioConnection          patchCord6(reverb, 1, mixer2, 0);

//stereo output
AudioConnection          patchCord7(mixer1, 0, i2s2, 0);
AudioConnection          patchCord8(mixer2, 0, i2s2, 1);
AudioControlSGTL5000     sgtl5000_1;

//control pots
#define pot1            A10 //size
#define pot2            A11 //lodamp
#define pot3            A12 //hidamp
#define pot4            A13 //diffusion
#define pot5            A14 //Left mix
#define pot6            A15 //Right mix

void setup() {
//  Serial.begin (9600);
  // put your setup code here, to run once:
  AudioMemory(12);

  sgtl5000_1.enable();
  sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
  //sgtl5000_1.lineInLevel(10, 10);           //was in plate reverb sample file
  //sgtl5000_1.adcHighPassFilterDisable();    // ditto

  // reverb.size(1.0);       // max reverb length
  // reverb.lowpass(0.3);    // sets the reverb master lowpass filter
  // reverb.lodamp(0.1);     // amount of low end loss in the reverb tail
  // reverb.hidamp(0.2);     // amount of treble loss in the reverb tail
  // reverb.diffusion(1.0);  // 1.0 is the detault setting, lower it to create more "echoey" reverb


}

void loop() {
  // read pot levels
  float knob1 = (float)analogRead(pot1) / 1023.0;  // size
  float knob2 = (float)analogRead(pot2) / 1023.0;  // lowpass
  float knob3 = (float)analogRead(pot3) / 1023.0;  // hidamp
  float knob4 = (float)analogRead(pot4) / 1023.0;  // diffusio
  float knob5 = (float)analogRead(pot5) / 1023.0;  // L mix
  float knob6 = (float)analogRead(pot6) / 1023.0;  // R mix

  mixer1.gain(0, knob5);
  mixer1.gain(1, 1.0 - knob5);
  mixer1.gain(2, 0);
  mixer1.gain(3, 0);

  mixer2.gain(0, knob6);
  mixer2.gain(1, 1.0 - knob6);
  mixer2.gain(2, 0);
  mixer2.gain(3, 0);

  reverb.size(knob1);
  reverb.lodamp(knob2);
  reverb.hidamp(knob3);
  reverb.diffusion(knob4);

  // Serial.print("Size: ");
  // Serial.print(knob1 * 100);
  // Serial.print("%, lowpass: ");
  // Serial.print(knob2 * 100);
  // Serial.print("%, lodamp: ");
  // Serial.print(knob3 * 100);
  // Serial.print("%, hidamp: ");
  // Serial.print(knob4 * 100);
  // Serial.print("%, diffusion: ");
  // Serial.print(knob5 * 100);
  // Serial.print("%, DryMix: ");
  // Serial.print(knob6 * 100);
  // Serial.print("%");
}
 
Up and running on my multi synth sequencer, and sounds very lush. Not sure why the shimmer does not have much of a tail to it, but I've found that using reverb pitch shift gives me the shimmer effect I was after so not a dealbreaker :)

Many Thanks to Pio for producing such a quality reverb plugin for the audio library, and for the help in setting it up :)
 
  • Like
Reactions: Pio
Back
Top