Fade without clicks

Status
Not open for further replies.

jeppius

Member
How should I modify the fader object so that when a Fadeout is active, if I trigger a fadeIn it does not cause a click?
 
I'm looking at the fade effect code and I don't see how it's making a click sound. Maybe there's some case I didn't anticipate?

If you want me to look at this, you're going to need to post a (hopefully simple) program which demonstrates the click sound.
 
Something like this...

//fade click demo
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>


// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=427,353
AudioEffectFade fade1; //xy=572,352
AudioOutputI2S i2s1; //xy=759,351
AudioControlSGTL5000 audioShield;
AudioConnection patchCord1(sine1, fade1);
AudioConnection patchCord2(fade1, 0, i2s1, 0);
AudioConnection patchCord3(fade1, 0, i2s1, 1);
// GUItool: end automatically generated code


void setup() {
AudioMemory(8);
sine1.amplitude(1.0);
sine1.frequency(100.0);
audioShield.enable();
audioShield.volume(0.8);
}

void loop() {
for (int i=0;i<5;i++){
fade1.fadeIn(10);
delay(500);
fade1.fadeOut(20);
delay(200);//no clicks
}
for (int i=0;i<5;i++){
fade1.fadeIn(10);
delay(500);
fade1.fadeOut(300);
delay(100);//clicks: discontinuity of 1st derivative discontinuity?
}
for (int i=0;i<5;i++){
fade1.fadeIn(100);
delay(500);
fade1.fadeOut(1000);
delay(100);//but no clicks nor fade in here
}
}
 
Status
Not open for further replies.
Back
Top