Goniometer component

Does JUCE have a facility to produce a simple stereo phase meter (goniometer)?

I’m working with vinyl timecode and I’m looking a good way to visualise the audio to diagnose any problems.

You’ll have to roll your own, it’s not massively hard … but I ended up streaming the audio via a FIFO to the UI thread. There may be a better way…

Sorry for waking this but it’s worth a shot.
Do you mean you streamed the complete buffer to the UI-thread or did you take samples, and if so did you take them periodically (1) or with some kind of min/max-peak extraction (2)?

Complications:
(1) Peaks will often be missed.
(2) How to chose min or max?

Taking the whole buffer I guess will be very heavy to make a drawing from.

Take the whole buffer. Computers are fast.

I’ll have a go at it then when the time comes. :slightly_smiling_face:

If you have any advice on how to mimic the “fade out” of a real oscilloscope/goniometer that would be of interest too. I realize it must be a collection of line segments where the “older” ones are getting more and more transparent and then are removed but I can’t quite figure where to begin to build this.

There’s probably some super fancy way of doing it with OpenGL. I reckon @elanhickler knows a thing or two about that effect :slight_smile:

Or you could just have some kind of ring buffer of points and see if it’s fast enough rendering it as a series of paths with decreasing alpha…

you can also render pixels to a bitmap after drawing over the old stuff with a transparent rectangle (also in the bitmap) every few frames: very transparent with background color. that will make things fade out over time… unfortunately there are only 256 steps. But for a quick test it’s good enough and easily allows to draw a pixel for every sample.

1 Like

If you want things to look more fancy and get rid of not nearly-background-color pixels after fading, additionally blur the bitmap every few frames using some of the fast pixel-blur code that has been floating around the webs.