Jack Live Spectrum

Jack Live Spectrum is a small (only one file) C program that runs on Linux that will display a frequency spectrum of the live streaming sound as a floating down animation. Below are some still screenshots.





This program needs QjackCtl started to properly function.
It also needs to know, which port or device to connect to. Only one port can be selected.

To compile this program, open the terminal in a folder where jack_spectrum.c is located and run:
gcc jack_spectrum.c -o jack_spectrum `pkg-config --cflags gtk+-3.0 --libs portaudio-2.0 fftw3f jack gtk+-3.0` -lpthread -lm

To run: ./jack_spectrum [ -a api (1 for jack, 2 for portaudio) ] [ -t transform (1 for FFT, 2 for CQT) ] port
Note that only one port can be selected.

To capture from audacious or zynaddsubfx, set api = 1
for example: ./jack_spectrum -t 1 -a 1 audacious:out_1
To capture from a microphone, set api = 2

When using Jack API option, you connect to the port by specifying it's string, which can be found in the QjackCtl connections window. Set API to 1 (-a 1) in command-line options.
In Portaudio API option, so far it only connects to the default microphone only. Set API to 2 (-a 2) in command-line options.
You can change the height of the window by changing value of ROWS or CQT_ROWS variables.

Information for developers:

Jack Live Spectrum uses two different algorithms to calculate frequency spectrum: FFT transform and CQT transform, which can be selected by the command line option t.
Library depencencies:
This program uses libfftw3f-dev, libportaudio2, ljack, gtk+-3.0 and lpthread.

You can download the script here

Check out my other project - Pedal Chord Sequencer.