SD Card WAV files and DSP effects...

Status
Not open for further replies.

mubase

Member
Hi all. I am new to this Forum so Hi from London (UK) :)

I have a question regarding the Teensy and it's audio library which I was turned on to by Headroom at the Arduino Forum. I have an idea for a sound art exhibition I have been asked to contribute to that involves playing wav files of pieces of sound art i have created from an SD card and while they are playing, have a bunch of sensors that can change the parameters of the sound in real time. For example, using an LDR or IR movement detector to change the pitch or speed of the wav file being played or adding reverb etc...
Wuld the Teensy and its audio library be capable of playing wav files from an SD card and do DSP operations on the file in real time???

Thanks.
Steve (mubase.)
 
the audio library is pretty good at streaming (several) wav files from SD. as to real time dsp, that will depend on what your expectations are, i'd say. there's a few effects and filters available already (see http://www.pjrc.com/teensy/gui/ ); generally speaking though there's a limited amount of RAM and CPU available, so anything RAM and/or CPU intensive, like reverbs, delays etc will be possible only to some extent.

the pitch *or* speed thing came up repeatedly, it's not currently supported and somebody else (dsp-savvy) would have to chime in re: is it possible at all (according to the interwebs, it (phase vocoder, 75% overlap) can be pulled off w/ a stm32f4, so it might just be possible; i don't know).

edit: oh, and just to be clear -- the audio library is awesome. but (as drjohn says) if you need quick results and low power/small size isn't among your requirements, there's other options that might serve you better. something raspberry pi-ish + puredata/sc/csound/whatever comes to mind, too.
 
Last edited:
The "it depends" answer: it depends on what effects you want to use and how many tracks you will be treating. Mono/stereo/bitrate play some role, too. SD card quality is an annoying confounder.

The audio library is just days out of Beta, so the limits are not really defined. It is awesome and a huge step forward, but if you have short term deliverables it may not be the basket in which to place all of your eggs.

Getting a rackmount sampler that has effects, fun filters and horsepower to spare and controlling it via MIDI with an Arduino / MIDI shield / breakout board combo would take less time and be museum / gallery level durable. Plus you'd get a lot more time to spend on the sensors and their presentation.
 
Today there are a small number of DSP effects available, but reverb isn't one of them (yet). It's on my to-do list....

Many of the DSP operations take surprisingly little CPU time. Reading data from the SD card over SPI bus actually consumes quite a bit of time per stream. The library has CPU time reporting, so you can print to the serial monitor to get an idea of how much of the CPU resource you're consuming.

Not all SD cards are created equal. The SanDisk Ultra works much better than most of the cheaper cards. The library has a speed test example that can give you a good benchmark of how well your card works with the Arduino SD library.

Ultimately, the best thing you can do is simply give it a try and see (hear) if it works for your needs. The good news is Teensy is very affordable, especially compared to rack-mount samplers and professional gear, so it's not much of a financial risk to give it a try!
 
One option would be to follow the Audio adapter line-out with a digital reverb chip or module. An example would be NemFX SC Reverb (datasheet). This can either be used as analog in/out with it's on-chip codec or, at higher quality, with an external codec. I don't think the second option is Teensy compatible though as it would need four I2S pipes: ADC to Teensy, Teensy to reverb, reverb to Teensy, Teensy to DAC.

Going for just the analog input option, a room reverb module is available for under 20USD (datasheet) which might be a fast way to get something working.
 
The "it depends" answer: it depends on what effects you want to use and how many tracks you will be treating. Mono/stereo/bitrate play some role, too. SD card quality is an annoying confounder.

Only stereo and the files will be 3 or so minutes of wav...

The device has to be small as it will be being transported to New Zealand from the UK so I would like it all to fit in a nice box with buttons to select the sample being played and sensors on the box which the listener can affect by movement of the hands or some such...
 
Status
Not open for further replies.
Back
Top