Hi Soarise!
I’m sorry that the hardware is out of stock.
The Tympan is a Teensy 4.1 inside, so running on Teensy 4.1 is no problem at all.
Running with the Teensy Audio Shield instead of the Tympan audio hardware…that’s is a little more difficult, but should work fine (though I haven’t done it myself in many years).
There are two basic approaches to getting started: (1) start from an example program from the Teensy Audio library, or (2) start from an example program from the Tympan Library.
If your main goal is to mainly use Tympan’s audio processing algorithms, I would start from one of the Tympan Library examples and adapt it for the Teensy audio hardware…
STARTING FROM TYMPAN LIBRARY EXAMPLES
There are many Tympan Library examples that you can build from. To use them without the Tympan hardware, you’ll need to remove the references to the Tympan audio hardware and, in some cases, replace them with references to the Teensy Audio hardware.
- Find the line that is like
Tympan myTympan(TympanRev::F);
and replace it with the standard Teensy line AudioControlSGTL5000 sgtl5000;
- Any time the Tympan code uses the
myTympan
to set the system volume or whatever, you’ll have to comment it out or you’ll have to replace it with corresponding call to sgtl5000
.
If this is the route that you choose to try (it’s the one that I would try), you cannot hurt anything simply by trying it out. Have no fear! Dive in!
STARTING FROM TEENSY AUDIO EXAMPLES
Alternatively, if you need to use deeper features of the Teensy audio hardware (like the SD card), you should probably start from a Teensy Audio library example. In this case, the main challenge is inserting references to the Tympan Library so that you can use its audio processing algorithms.
- At the start of a Teeny example, add
#include <Tympan_Library.h>
at the top of the *.ino file. This enables you to use any of the Tympan_Library audio processing blocks.
- When the Teensy audio objects and Teensy audio connections are created, you should swap out all of the Teensy audio lines and replace them with Tympan Library processing blocks and audio connections instead.
The reason that you want to swap from Teensy audio blocks to Tympan audio blocks is that the two libraries represent the audio data differently. The Tympan blocks represent audio using a floating-point data type whereas the Teensy Audio library uses a fixed-point data type. It is possible to mix-and-match between the two representations if you must, but you’ll need to add special conversion steps, which is annoying. Ask, if this is something that you need to do.
TL;DR
Yes, you should be able to use a Teensy 4.1 + an audio shield, but it will require a little trial-and-error debugging to get it to work the first time. Like always, Serial.println()
is your friend for debugging.