Hi fellows,
I am quite a newbee with Teensy and I am experimenting the wonderful audio library... as many of you, I am building a mono synth with this lib and it sounds great (specially with the new ladder filter!!!).
I am facing a curious behaviour with both envelope and waveform generator(s). When using square and pulse waveforms, when attack/decay/relase times are short enough (5-10ms), a "plop" can be heard on each note-on/note off. This "plop" is louder if the pulse width is short. This does not happen with other waveforms (sine, sawtooth, reverse sawtooth).
It is not a "click" which has been described in some earlier thread.
I tried some different parameters such as releaseNoteOn , along with band limited waveforms which didn't change anything.
The problem may be reproduced with the code below using Teensy 4.0 and audio board.
(Sorry the result is awfull for your ears... the settings of both envelope and waveform are "optimized" to point out the problem...)
After some investigations, it appeared that adjusting the offset of the waveform to a value around (0.1) didn't solved the problem, but diminished the impact of it.
Is there something I missed ? Do you guys have seen this issue before?
I am quite a newbee with Teensy and I am experimenting the wonderful audio library... as many of you, I am building a mono synth with this lib and it sounds great (specially with the new ladder filter!!!).
I am facing a curious behaviour with both envelope and waveform generator(s). When using square and pulse waveforms, when attack/decay/relase times are short enough (5-10ms), a "plop" can be heard on each note-on/note off. This "plop" is louder if the pulse width is short. This does not happen with other waveforms (sine, sawtooth, reverse sawtooth).
It is not a "click" which has been described in some earlier thread.
I tried some different parameters such as releaseNoteOn , along with band limited waveforms which didn't change anything.
The problem may be reproduced with the code below using Teensy 4.0 and audio board.
(Sorry the result is awfull for your ears... the settings of both envelope and waveform are "optimized" to point out the problem...)
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=210,188
AudioEffectEnvelope envelope1; //xy=385,189
AudioOutputI2S i2s1; //xy=571,187
AudioConnection patchCord1(waveform1, envelope1);
AudioConnection patchCord2(envelope1, 0, i2s1, 0);
AudioConnection patchCord3(envelope1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=483,73
// GUItool: end automatically generated code
void setup() {
AudioMemory(20);
sgtl5000_1.enable();
sgtl5000_1.lineOutLevel(13);
// put your setup code here, to run once:
waveform1.begin(0.75f,880.f,WAVEFORM_BANDLIMIT_PULSE);
waveform1.pulseWidth(0.01f);
waveform1.offset(0.);
waveform1.phase(0);
envelope1.delay(0.0f);
envelope1.attack(0.0f);
envelope1.hold(0.0f);
envelope1.decay(5.0f);
envelope1.sustain(0.75f);
envelope1.release(1.0f);
envelope1.releaseNoteOn(5.0f);
}
void loop() {
// put your main code here, to run repeatedly:
envelope1.noteOn();
delay(50);
envelope1.noteOff();
delay(50);
}
After some investigations, it appeared that adjusting the offset of the waveform to a value around (0.1) didn't solved the problem, but diminished the impact of it.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=210,188
AudioEffectEnvelope envelope1; //xy=385,189
AudioOutputI2S i2s1; //xy=571,187
AudioConnection patchCord1(waveform1, envelope1);
AudioConnection patchCord2(envelope1, 0, i2s1, 0);
AudioConnection patchCord3(envelope1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=483,73
// GUItool: end automatically generated code
void setup() {
AudioMemory(20);
sgtl5000_1.enable();
sgtl5000_1.lineOutLevel(13);
// put your setup code here, to run once:
waveform1.begin(0.75f,880.f,WAVEFORM_BANDLIMIT_PULSE);
waveform1.pulseWidth(0.5f);
waveform1.offset(0.095);
waveform1.phase(0);
envelope1.delay(0.0f);
envelope1.attack(0.0f);
envelope1.hold(0.0f);
envelope1.decay(5.0f);
envelope1.sustain(0.75f);
envelope1.release(1.0f);
envelope1.releaseNoteOn(5.0f);
}
void loop() {
// put your main code here, to run repeatedly:
envelope1.noteOn();
delay(50);
envelope1.noteOff();
delay(50);
}
Is there something I missed ? Do you guys have seen this issue before?