Hi,
I have a Teensy 4.0 installed and working (can modify blink test example), but for now no Audio shield. Nevertheless, I would like design a program using the Audio System Design Tool and interrogate objects, such as AudioSynthWaveformModulated in order to understand better how they work and debug issues. I don't have access to an oscilloscope so I was hoping to plot the outputs using the SerialMonitor. I can view general messages printed by Serial.println() etc so the SerialMonitor is in general working I think. However when I try to use AudioAnalyzePrint object to do this, say, for a AudioSynthWaveformModulated I don't get any output. The documentation says "This object doesn't work very well and probably should not be used." and has "blah blah blah" so I'm struggling to work out how to use it. My attempt is below. If this is not recommended, is there another way to effectively get oscilloscope outputs for a given object?
I'm using USB Type "Serial" and viewing "COM5 (Teensy)" port, Arduino 1.8.16. I've picked an arbitrary output device as I didn't think this would matter (but I've tried i2s as well).
The context is: i'm trying to port some Teensy Audio algorithms to another dsp platform and am struggling to understand/build intuition about exactly how the objects work / would like a way to probe parts of the existing algorithms.
Output:
Thanks!
I have a Teensy 4.0 installed and working (can modify blink test example), but for now no Audio shield. Nevertheless, I would like design a program using the Audio System Design Tool and interrogate objects, such as AudioSynthWaveformModulated in order to understand better how they work and debug issues. I don't have access to an oscilloscope so I was hoping to plot the outputs using the SerialMonitor. I can view general messages printed by Serial.println() etc so the SerialMonitor is in general working I think. However when I try to use AudioAnalyzePrint object to do this, say, for a AudioSynthWaveformModulated I don't get any output. The documentation says "This object doesn't work very well and probably should not be used." and has "blah blah blah" so I'm struggling to work out how to use it. My attempt is below. If this is not recommended, is there another way to effectively get oscilloscope outputs for a given object?
I'm using USB Type "Serial" and viewing "COM5 (Teensy)" port, Arduino 1.8.16. I've picked an arbitrary output device as I didn't think this would matter (but I've tried i2s as well).
The context is: i'm trying to port some Teensy Audio algorithms to another dsp platform and am struggling to understand/build intuition about exactly how the objects work / would like a way to probe parts of the existing algorithms.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformModulated waveformMod1; //xy=420.1999969482422,249.1999969482422
AudioAnalyzePrint print1; //xy=629.1999969482422,434.1999969482422
AudioOutputPWM pwm1; //xy=770.1999969482422,336.1999969482422
AudioConnection patchCord1(waveformMod1, print1);
AudioConnection patchCord2(waveformMod1, pwm1);
// GUItool: end automatically generated code
// the setup routine runs once when you press reset:
void setup() {
int masterVolume = 1;
waveformMod1.begin(WAVEFORM_SQUARE);
waveformMod1.offset(1);
waveformMod1.amplitude(masterVolume);
waveformMod1.frequency(10);
Serial.begin(9600);
print1.name("debugger");
Serial.println("Beep #");
}
// the loop routine runs over and over again forever:
void loop() {
delay(500); // wait for a second
print1.trigger();
}
Output:
Code:
Beep #
trigger debugger
trigger debugger
trigger debugger
trigger debugger
trigger debugger
trigger debugger
trigger debugger
Thanks!