Controlling effect parameters.

Status
Not open for further replies.

ellis

Member
Hi all, I'm working on an audio effects controller for guitar. I have made everything and have decent sound reproduction out of my amp. I'm now at the stage of adding effects, however I am unable to control effect parameters such as the 'freeverb' example shown below. I can use any values for room size and damping but get the same sound; I'd guess the parameters to be maxed out by the sound I get.

I've looked at examples and searched various forums but cannot find anything to help me. It's annoying me because I know it's probably something really obvious.

One other quick query I have is with the audio output. I'm using dac output which gives 0-1.2v swing but I want to use 3.3v since I experienced less noise when just using adc->dac at 3.3v(no audio lib). I've tried 'analogReference(EXTERNAL);' but it results in no audio output and still 0.6v measured nominal out of the dac.

I'm a mechanical engineer so this is all new stuff to me. Thanks for any help with my issues.


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

// inputs/sources -> processing -> outputs
AudioInputAnalog       input_signal(A0);
AudioEffectFreeverb        freeverb1; 
AudioOutputAnalog        dac;
//AudioOutputUSB           usb1;



//AudioConnection patchCord1(input_signal, dac);
AudioConnection          patchCord1(input_signal, freeverb1);
AudioConnection          patchCord2(freeverb1, dac);
//AudioConnection          patchCord3(input_signal, 0, usb1, 1);



void setup() {
Serial.begin(9600);
AudioMemory(12);

analogReference(INTERNAL);

freeverb1.roomsize(0.2);
freeverb1.damping(0.5);

}

void loop() {

}
 
The audio design web page says this about freeverb:
Freeverb mono consumes about 21% of the CPU time on Teensy 3.2 and requires about 22K of RAM.
The "22K of RAM" suggests that you need to allocate more memory for it. Try:
Code:
AudioMemory(64);

Which Teensy are you using?

Pete
 
I've just dug into the code and the vast majority of that 22k is statically allocated, so increasing AudioMemory is unlikely to help.
If I get time today, I'll play around with your code.

Pete
 
When using the analog pins with the Audio library, the Audio library code pretty much takes full control of the analog hardware, so calling analogReference() probably does not do anything. Your code isn't actually changing the roomsize or damping... if you are recompiling and reflashing to change those values, you might just not be able to tell the difference? Perhaps try using potentiometers to change the values at run time? Also, the analog output is rather lowfi, it might help to use a codec (audio shield for example).
 
I've just dug into the code and the vast majority of that 22k is statically allocated, so increasing AudioMemory is unlikely to help.
If I get time today, I'll play around with your code.

Pete

Thanks for getting back to me Pete. I tried increasing memory but you're right It had no effect. I'm using a teensy 3.2 (no audio shield) but I'm thinking of getting a more updated version for future projects and such.
 
When using the analog pins with the Audio library, the Audio library code pretty much takes full control of the analog hardware, so calling analogReference() probably does not do anything. Your code isn't actually changing the roomsize or damping... if you are recompiling and reflashing to change those values, you might just not be able to tell the difference? Perhaps try using potentiometers to change the values at run time? Also, the analog output is rather lowfi, it might help to use a codec (audio shield for example).

The analogReferance() term is mentioned in the adc section of the audio gui design tool. It says use 'INTERNAL' for 1v2 and 'EXTERNAL' for 3v3. Not sure why I cant get it to work.

As for the freeverb parameters I have tried all kinds of values, it only takes a few seconds to upload the code so I can hear the notes quickly and they're all the same. I assume values are stuck on max since I can choose 0.01 roomsize (out of 1.0) but it always sounds like I'm playing in a cathedral
 
Status
Not open for further replies.
Back
Top