I'm working a Teensy 3.6 based synth using the audio library and I'm getting unwanted signal noise when I use a waveform object to modify a filter object's frequency via its second input.
The noise is introduced when the modifying waveform's amplitude is anything greater than zero.
Repro Steps:
1. Run the sketch. I'm using Teensyduino 1.48 & Arduino 1.8.10
2. I'm using an amplified speaker turned up high, but the noise is still perceptible when using standard apple earbuds.
3. The hardware is a Teensy 3.6 with a PJRC PT8211 audio kit. https://www.pjrc.com/store/pt8211_kit.html
4. The only wiring is the PT8211 board connected via pin headers directly on top of the Teensy.
5. For comparison, comment out line 29 and uncomment line 35. This sets the modifying waveform's amplitude to zero for a clean signal. You should only hear nice pink(?) noise.
*notes
• The primary waveform isn't running, this is so you don't blow out your ears or your speakers. The errant noise is happening regardless of wanted noise.
• The library is awesome. All the noise issues I've run into so far have been my fault or noted issues and fairly easy to diagnose, but this one has me stumped.
The noise is introduced when the modifying waveform's amplitude is anything greater than zero.
Repro Steps:
1. Run the sketch. I'm using Teensyduino 1.48 & Arduino 1.8.10
2. I'm using an amplified speaker turned up high, but the noise is still perceptible when using standard apple earbuds.
3. The hardware is a Teensy 3.6 with a PJRC PT8211 audio kit. https://www.pjrc.com/store/pt8211_kit.html
4. The only wiring is the PT8211 board connected via pin headers directly on top of the Teensy.
5. For comparison, comment out line 29 and uncomment line 35. This sets the modifying waveform's amplitude to zero for a clean signal. You should only hear nice pink(?) noise.
*notes
• The primary waveform isn't running, this is so you don't blow out your ears or your speakers. The errant noise is happening regardless of wanted noise.
• The library is awesome. All the noise issues I've run into so far have been my fault or noted issues and fairly easy to diagnose, but this one has me stumped.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform oscA1; //xy=733,436
AudioSynthWaveform lfoA1; //xy=735,467
AudioFilterStateVariable filter1; //xy=917,441
AudioMixer4 mixer1; //xy=1081,448
AudioOutputPT8211 PT8211; //xy=1245,445
AudioConnection patchCord1(oscA1, 0, filter1, 0);
AudioConnection patchCord2(lfoA1, 0, filter1, 1);
AudioConnection patchCord3(filter1, 0, mixer1, 0);
AudioConnection patchCord4(filter1, 1, mixer1, 1);
AudioConnection patchCord5(filter1, 2, mixer1, 2);
AudioConnection patchCord6(mixer1, 0, PT8211, 0);
AudioConnection patchCord7(mixer1, 0, PT8211, 1);
// GUItool: end automatically generated code
void setup() {
Serial.begin(115200);
AudioMemory(50);
//oscA1.begin(1, 440, WAVEFORM_SAWTOOTH);
// noise
lfoA1.begin(1,3,WAVEFORM_SINE);
// the noise is the same regardless of amplitude. anything over .01 makes it happen
// lfoA1.begin(.05,3,WAVEFORM_SINE);
//no noise
// lfoA1.begin(0,3,WAVEFORM_SINE);
mixer1.gain(0,1);
mixer1.gain(1,0);
mixer1.gain(2,0);
mixer1.gain(3,0);
}
void loop() {
}