Repository navigation
How It Works
Most visualizers feel laggy because of how they listen and analyze. This one:
-
Reads each hardware audio buffer directly with
AVAudioSinkNode(or a Core Audio process tap for app audio) and asks Core Audio for 128-frame buffers (about 2.7 ms). The commoninstallTapapproach delivers audio in 100–400 ms chunks. - Tracks bass sample by sample using a 4th-order 140 Hz low-pass filter and an envelope follower with a 1 ms attack. Logo motion never waits for an FFT window to fill. The FFT is only used for drawing spectrum bars.
- Jumps instantly on a hit and only smooths the release. On each detected beat, part of the logo's squash, bounce, slide and wobble is applied on that very frame, and stiff, damped springs carry the follow-through, so the motion peaks on the kick instead of a few frames later.
- Renders at the display's refresh rate, up to 120 Hz on ProMotion. It reads the newest audio values right before each frame and uses only two drawables to avoid an extra frame of queueing.
On Windows the same design uses WASAPI in shared mode, and the capture thread is registered with MMCSS ("Pro Audio") so it isn't starved. Microphones and line-ins use IAudioClient3 to ask for the smallest period on that input only. System audio is loopback capture of the output the PC is already playing: the mix format, and the engine's normal period (about 10 ms). Dropocalypse does not open a playback stream and does not change that output's period or format, so other programs keep playing. Rendering uses a flip-model Direct3D 11 swap chain with a frame-latency waitable object and a maximum latency of one frame.
On Linux it listens through PulseAudio (or PipeWire's PulseAudio service) in 5 ms fragments, records the output's monitor for what the computer is playing, and draws with OpenGL 3.3 using the same shaders, ported to GLSL.
On macOS 14.2+, Dropocalypse creates a Core Audio process tap (CATapDescription) for the chosen app's processes (helper processes such as a browser's renderers are folded in), or a global tap for all Mac audio that excludes itself. The tap is wrapped in a private aggregate device and read with an IOProc on the HAL's real-time thread, so latency stays at one small hardware buffer. It watches for the app starting or stopping audio and for output-device changes, and rebuilds the tap when needed.
Every frame goes through the same three steps on every platform (Metal on Mac, Direct3D 11 on Windows, OpenGL 3.3 on Linux):
-
Feedback warp: last frame's image is zoomed, rotated, warped, mirrored or kaleidoscoped, color-shifted and faded into a pair of ping-pong
rgba16Floattextures. This is what makes MilkDrop-style trails and tunnels. - Shapes: each style draws waveforms, spectrum bars, particles, ridges, grids or the tesseract as triangles: an additive batch for glowing light, plus an alpha-blended batch for solid shapes such as the Outrun sun.
- Composite and logo: the feedback image is presented with vignette and beat flash, then the logo is drawn on top with its spring-driven transform, glow, tint and optional trails fed back into the feedback texture.
Scenes are plain parameter sets (zoom, rotation, warp, decay, mirror, colors and a wave style), so switching styles is a 2.5-second crossfade between two sets of numbers.
The logo's pulse, squash, bounce, slide and wobble are stiff, damped springs. Beat onsets (bass jumping above its recent average by the Beat threshold, with a refractory period) give the springs a kick, while the bass envelope drives the continuous pulse.
| Mac | Windows | Linux | |
|---|---|---|---|
| Language | Swift, SwiftUI + AppKit | C++17, Win32 + Dear ImGui | C++17, GLFW + Dear ImGui |
| Audio | AVAudioEngine sink node, Core Audio process taps | WASAPI shared mode; loopback capture for system audio | PulseAudio / PipeWire; the output's monitor for system audio |
| Graphics | Metal (shaders compiled at launch) | Direct3D 11, flip-model swap chain | OpenGL 3.3 (GLSL port of the shaders) |
| Recording | AVAssetWriter | Media Foundation | ffmpeg |
| Settings | UserDefaults | %APPDATA%\Dropocalypse\settings.ini |
~/.config/dropocalypse/settings.ini |
Dropocalypse is free and open source (MIT). Download · Discussions · Report a bug · ❤️ Sponsor
Using it
- Installation
- Quick Start
- Audio Sources
- Styles
- Your Logo and Motion
- Controls and Settings
- Keyboard Shortcuts
Shows and help
Developers
Project