Posts: 25
Joined: Fri Feb 03, 2012 3:26 pm
Location: Sweden
Contact: Website

Pi Zero Unicorn Hat FFT audio visualizer

Fri Mar 11, 2016 2:48 pm

I just released the code for my Unicorn Hat FFT audio visualizer! It's really cool!
It's all written in C and takes a stream input from stdin, meaning you can pipe any realtime audio stream to it.
It's only a visualizer, it won't play the audio you pipe to it.

You can watch a demo here:

Code & instructions:

I have a pi zero running in USB gadget mode, it's connected to a PC and acts as a sound card and ethernet adapter, all over one USB cable!
I might release the scripts I use later, but here is the guide I used to set up the gadget.
A tip: You want to have a USB-to-TTY cable during setting it up, because once the pi zero is in gadget mode, normal USB devices won't work (like a keyboard or USB hub).

I have the unicorn-fft start up with arecord as input source on boot. I just plug the pi into the computer and it will visualize anything that's played to it. I have tested this on Linux and OS X.
You need to make a multi-out/loopback device if you want to hear and visualize at the same time.

You can change a line in the code to make it look like this instead :)

Do you have a PiGlow but no Unicorn Hat? I have made a FFT audio visualizer for the PiGlow too!
See: viewtopic.php?f=38&t=127677

Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: Pi Zero Unicorn Hat FFT audio visualizer

Tue Mar 15, 2016 2:12 am

can we make this ncurses?

Posts: 1
Joined: Sat Jan 06, 2018 11:45 pm

Re: Pi Zero Unicorn Hat FFT audio visualizer

Sat Jan 06, 2018 11:52 pm

Do you have the python code for the unicorn hat fft audio visualizer? thank you

Return to “Graphics, sound and multimedia”