Feature idea: Oscilloscope (workflow for inspecting realtime audio data)

I’m trying to debug some audio processing.

I need to export say 10 seconds’ worth of processed (mono) samples, from within my audioDeviceIOCallback.

I could just preallocate 10*44100 floats, fill up the buffer & write it out when it is full (don’t really care about stalling the thread as I’ve got the data by that point).

But what is the best way to go about this? This must be a fairly common part of an audio engineer’s workflow: effectively attaching probes to various pins and inspecting the oscilloscope signal readout.

Might that might even be a desirable JUCE component? An oscilloscope that lets you record & save…

You could just do oscil.feed(dataPoint) or maybe simultaneously plot a second trace with oscil.feed(2, datapoint). Or turn on to-disk-storage with oscil.record(ON=true, file='dump.wav')

Maybe a setting that makes it start recording at a certain RMS. Maybe a graphical display window that lets you view, scroll, export.

And it would take care of threading/buffering issues.

There’s a buffer visualizer which is about 50% of what you’re after here. Feel free to improve it if you like :slight_smile:


My workflow in this case: Write the samples to a file (.wav or a plain .bin), load the file in Matlab and plot it there. In some cases I write an .m script to load the file and plot it as desired and invoke it through a simple system() call.

If you have no access to a super expensive Matlab license GNU Octave will do the job too.

1 Like

You can also use the free Scipy and Matplotlib Python libraries.

I can vouch for the buffer visualiser. Saved me a few months ago!