Synchronized recording and playback of audio, CPU Requirements, Time Stretching, x86, DSP, Android Version Support, Beat Detection
Our audio developer community emails us questions. We've answered them and made them public so you too can get the most utility out of Superpowered. Feel free to email us anytime at hello@superpowered.com with your questions.
Question 1: CPU Requirements for time stretching?
I had some questions about your Superpowered SDK in the context of a wearable fitness device. What I want to know is the CPU requirements for running Superpowered, assuming that the library is performing continuous time stretching with a stretch ratio between 0.5 and 2.0. Will it work on an Intel Edison (Dual-core, 500Mhz)?
Superpowered ‘runs’ on Intel but isn't optimized for x86. More precisely, right now, Superpowered for x86 has all optimizations except the hand-tuned x86 Assembly code, so it likely runs 4x less efficiently than it should were it to be optimized for x86.
Superpowered time stretching can run on processors as slow as 500 Mhz ARM processors with SIMD instructions (NEON).
Question 2: Intel Edison, X86 and SIMD?
Thanks. It sounds like Superpowered optimizations make a huge difference then.
I appreciate the CPU estimate for time-stretching. Is 500 Mhz the minimum requirement for an ARM processor?
The Intel Edison includes an Intel Atom processor Z34XX Series (“Silvermont”). The dual-core Intel Atom processor operates at 500 Mhz, with an additional 100 Mhz Intel Quark core. The Quark can be used to process sensor input in a low-power state, but for our application we'd be running with the Atom processor active while doing any time-stretching.
According to Intel,
Intel® Atom™ Processor Z34xx Series is the next generation 22 nm SoC product targeted for the smartphone market segment. The SoC contains dual IA-32 cores operating at 500 MHz. The architecture includes 2-wide instruction decode and Out Of Order Execution with 1 MB cache shared between the two CPU cores. It includes Intel SIMD Extensions 2, 3, 4 (SSE2, SSE3, SSE4.1/4.2).
Since the Edison supports SIMD, would this make a difference?
In theory it would be powerful enough to run Superpowered right? The Atom is comparable to an ARM Cortex-A9, I’d imagine.
Currently, Superpowered for x86 doesn't contain the optimized x86 Assembly code, so it doesn't fully utilize SIMD. The compiler does have some optimizations, but that's all.
We’re sure it would be performant if we decided to port it to Intel SIMD Assembly code, but we don’t know if it would run on an Atom at 500 Mhz in it's current state.
Please note however, that our time stretching library uses the lowest amount of CPU compared to other solutions on the market, even lacking optimizations for x86. Give it a try.
Question 3: Synchronized recording and playback of audio tracks on Android?
I'm not sure if the Superpowered SDK can help me, but perhaps you can help me understand the capabilities better. I'm looking for something that will help me synchronize recording and playback of audio tracks on Android - similar to what you would need in a multi-track audio recorder.
I need to record one track while playing back another track (e.g. a metronome/click) and then replay both tracks in sync. For this purpose, the total latency is not that important as long as I can measure the difference between recording and playback latency so the tracks can be synchronized.
Does Superpowered SDK have any APIs for this purpose?
The Java Audio SDK has this capability through the "Mixer" class, but I was unable to find any equivalent functionality through the standard Android libraries or Superpowered. Please let me know if you can provide any guidance on this. My project is currently an experiment, but I hope to turn it into a commercial application at some point.
You’re in luck. The SuperpoweredAdvancedAudioPlayer's play() method has a "synchronised" flag. It will start playback synced to a master tempo and beatgrid you set in the process() method. An example can be found in the cross example project. (The example project is for iOS, but all Superpowered code is cross-platform).
Question 4: Music visualizer using Polar FFT or Bandpass Filter?
Peeked at the examples and read up a ton. Killer API.
How might I use Superpowered to code a music visualizer using the Polar FFT? The example seems to show a benchmark again Core Audio but I'm unclear on how so would process the magnitudes and specifically how I would average all the magnitudes into say 16 or 32 bands.
You don't need the polar FFT just to show a simple music visualiser. Use the SuperpoweredBandpassFilterbank, which is much simpler to use, you get the magnitudes at the bands you set and it uses significantly less CPU too.
Question 5: DSP and Superpowered Coding Paradigm?
A couple of questions:
Is Superpowered designed to use just with Superpowered DSP effects and sample player/manipulator?
Is Superpowered easy to use as a base setup for having audio working and do all my dsp for synthesis in plain C?
(So that I can have all sound stuff completely independent of the platform.)
You can easily insert your own code into the audio flow. The Superpowered Audio SDK doesn't have or need any "connection abstraction".
Simple floating point buffers are passed on every place. So you can work with them as you see fit and use your own code too.
The API is pure C++ and cross-platform. The same code can be used for iOS or Android.
Question 6: Audio Stream Limits?
With Superpowered Audio Player, is there a hard limit to how many audio streams there can be?
Not at all! The only constraint is your CPU, you can have as many instances as your CPU can handle.
Question 7: Real time beat detection?
I’ve run your demo in Xcode, and it’s impressive.
Right now I’m developing an audio app in Swift with iOS 8 and the new AVFoundation, and it’s a learning experience (mostly good).
My one big challenge is finding real time beat detection. I have found several libraries that do it offline, but on-the-fly would be better. Is Superpowered doing anything in that realm?
Currently, our SDK has an offline bpm detector only, because it's more precise.
Question 8: Minimal Android Version Support?
I’m developing some app for android and investigate to use you nice sdk. I have some question. What is minimal version of Android you support?
You can target level 11 and up, Superpowered covers 98% of all active devices.
Question 9: C++ Audio Libraries
When we're evaluating C++ Audio Libraries like Superpowered Audio - how should we evaluate them for quality?
Great question. Check out C++ Audio Library Options (2018) and how to evaluate them here.