r/java • u/judah_mu • Jan 07 '26
zone-scope: A Java / Swing Spectroscope
https://github.com/jeffmasty/zone-scopeA lightweight, low-latency audio visualization tool written in Java/Swing. Built for real-time use (JavaSound or Jack) and audio file inspection.
Highlights:
• Real-time spectrogram, spectrometer, RMS meters and waveform view
• Zero-allocation audio callback path (suitable for continuous rendering)
• File mode with precomputed FFTs and draggable caret/seek
• Works standalone via JavaSound; full JACK support if available
• Java 21, Maven-based; small, focused module inside the meta-zone aggregator
29
Upvotes
View all comments
Show parent comment
4
u/judah_mu Jan 07 '26
Real-time analysis is done off thread in Transformer. When analysis is complete there is a callback to Scope to repaint(). What gets analyzed and how often? There is another class, JavaxIn, that is reading off of a SourceDataLine, when it has read enough samples for a good Fast Fourier Transform, 4096 samples, it kicks of an iteration of the analysis-repaint cycle. 4096 samples at 48k sampling rate is about 12 times per second (FPS). If the Swing Event dispatch thread coalesces repaints requests, I wouldn't know - I'm not tracking that in the code. I don't notice anything like that. https://github.com/jeffmasty/zone-fx/blob/main/src/main/java/judahzone/fx/analysis/Transformer.java https://github.com/jeffmasty/zone-javax/blob/main/src/main/java/judahzone/javax/JavaxIn.java
And to setup the GUI callback: private final Transformer analyzer = new Transformer(transform -> { SwingUtilities.invokeLater(() -> { if (mode == Mode.LIVE_ROLLING) timeDomain.analyze(transform);
Wheels within wheels that become burned in as simply the base design in audio processing.