All Projects → sudara → melatonin_audio_sparklines

sudara / melatonin_audio_sparklines

Licence: MIT License
Sparklines For JUCE AudioBlocks

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to melatonin audio sparklines

juceSynths
Collection of JUCE synthesisers utilising the Maximilian library.
Stars: ✭ 78 (+30%)
Mutual labels:  dsp, juce
simple-reverb
A simple reverb made with the JUCE DSP module
Stars: ✭ 43 (-28.33%)
Mutual labels:  dsp, juce
DSP-Testbench
A DSP Testbench for users of the JUCE framework
Stars: ✭ 40 (-33.33%)
Mutual labels:  dsp, juce
Bad-Circuit-Modelling
Correct modelling of incorrect circuits
Stars: ✭ 27 (-55%)
Mutual labels:  dsp, juce
DAFx19-Gamelanizer
Accompanying material for the paper 'A Real-Time Audio Effect Plug-In Inspired by the Processes of Traditional Indonesian Gamelan Music'
Stars: ✭ 33 (-45%)
Mutual labels:  dsp, juce
juce-cookbook
Collection of tutorials & resources for the C++ library JUCE
Stars: ✭ 58 (-3.33%)
Mutual labels:  dsp, juce
snestracker
Super Nintendo Entertainment System Music Software. Super Famicom Music Software
Stars: ✭ 161 (+168.33%)
Mutual labels:  dsp
lavadsp
A bunch of lavaplayer audio filters
Stars: ✭ 55 (-8.33%)
Mutual labels:  dsp
sparky
▁▂▃▅▂▇ in your shell. Groovy flavoured!
Stars: ✭ 19 (-68.33%)
Mutual labels:  sparklines
e-verest
EVEREST: e-Versatile Research Stick for peoples
Stars: ✭ 21 (-65%)
Mutual labels:  dsp
DSP-ADAU1452
Open Hardware DSP Platform ADAU145x DSP supporting ADAU1452, ADAU1451, and ADAU1450 devices
Stars: ✭ 21 (-65%)
Mutual labels:  dsp
math
Useful m-scripts for DSP (CIC, FIR, FFT, Fast convolution, Partial Filters etc.)
Stars: ✭ 15 (-75%)
Mutual labels:  dsp
dspjargon
All the jargon you need to understand the world of Digital Signal Processing.
Stars: ✭ 37 (-38.33%)
Mutual labels:  dsp
Planeverb
Project Planeverb is a CPU based real-time wave-based acoustics engine for games. It comes with an integration with the Unity Engine.
Stars: ✭ 22 (-63.33%)
Mutual labels:  dsp
PothosComms
Communications blocks and support libraries
Stars: ✭ 15 (-75%)
Mutual labels:  dsp
UA3REO-DDC-Transceiver
DDC/DUC SDR Tranceiver project
Stars: ✭ 93 (+55%)
Mutual labels:  dsp
adsb deku
✈️ Rust ADS-B decoder + tui radar application
Stars: ✭ 190 (+216.67%)
Mutual labels:  dsp
signalo
A DSP toolbox with focus on embedded environments written in Rust.
Stars: ✭ 71 (+18.33%)
Mutual labels:  dsp
airfx
Over 150 Airwindows plugins as Max/MSP externals using the Min C++ API. Contains reverbs, delays, filters, compressors, and more.
Stars: ✭ 14 (-76.67%)
Mutual labels:  dsp
SOUL-VA
The SOUL Virtual Analog Library
Stars: ✭ 45 (-25%)
Mutual labels:  dsp

Read my blog article on audio sparklines!

Melatonin Audio Sparklines

This is a C++ JUCE module that summarizes and visualizes what's in an AudioBlock.

It's nice to get a quick idea of what's happening to your JUCE audio buffers during development or tests.

Installation

Set up a git submodule in your project tracking the main branch. I usually stick mine in a modules directory.

git submodule add -b main https://github.com/sudara/melatonin_audio_sparklines modules/melatonin_audio_sparklines
git commit -m "Added melatonin_audio_sparklines submodule."

To update melatonin_audio_sparklines, you can:

git submodule update --remote --merge modules/melatonin_audio_sparklines

If you use CMake (my condolences (jk jk)), inform JUCE about the module in your CMakeLists.txt:

juce_add_module("modules/melatonin_audio_sparklines")

Include the header where needed:

#include "melatonin_audio_sparklines/melatonin_audio_sparklines.h"

JUCE Usage: printSparkline

Call melatonin::printSparkline(myAudioBlock); and under the hood, DBG will be called.

If you are lucky, you'll see a healthy looking wave (like this cutie little square wave) spat out into your console:

Block is 1 channel, 441 samples, min -0.999994, max 0.999994, 100% filled
[0⎺‾⎺x⎽_⎽]

Or a sine:

Block is 1 channel, 441 samples, min -0.999994, max 0.999994, 100% filled
[0—⎻⎺‾⎺⎻—x—⎼⎽_⎽⎼—]

You can output the sparkline in full sample-by-sample uncompressed glory with melatonin::printSparkline(myAudioBlock, false) or display it without normalization with melatonin::printSparkline(myAudioBlock, true, false).

lldb installation

Thanks to Jim Credland's existing lldb formatters I felt bold enough to jump in and figure out how to get sparklines in your lldb-driven IDE.

Put this line in a file named ~/.lldbinit (create it if necessary), pointing to sparklines.py:

command script import ~/path/to/melatonin_audio_sparklines/sparklines.py

On hover you'll get a summary:

Screenshot 2021-06-22 SineMachine – CycleNote cpp - CLion

On click you'll get sparklines and the ability to browse samples:

Screenshot 2021-06-22 SineMachine – CycleNote cpp - CLion

If you'd like to read more about this, read my post on creating lldb type summaries and children.

Feature key

Here are what the symbols mean that will show up in the sparkline

0 = true 0
x = zero crossing
E = out of bounds (below -1.0 or above 1.0)
I = Inf (Infinity, meaning you've divided by zero)
N = NaN (undefined calculation that's not INF)
S = Subnormal detected

Caveats

printSparklines was tested on VS2019 on Windows, Xcode on MacOS and CLion on Windows and MacOS.

The lldb python script was tested on MacOS CLion and Xcode only.

Xcode gotcha

If you are using Xcode exclusively, you might want to plop this somewhere

#define MELATONIN_SPARKLINE_XCODE=1

MacOS native font rendering seems to flip the height of two of the characters (⎺ vs. ‾) but it's fine in MacOS CLion, etc.

Don't like how they look?

I'm not a fan of VS2019 with the default Consolas font. Everywhere else it seems to look good! Open an issue if you can make it nicer!

Reminder: Don't leave a printSparkline call in your audio path

Not only does DBG itself allocate, but the whole name of the game is string manipulation here, so if you are sticking a printSparkline in your audio callback, expect those sweet sweet dropouts.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].