Magnetite: a self-hosted music player with meters and file analysis
Magnetite is a self-hosted music player built with Laravel. It includes audio analysis, twelve measurement-based meters and fifteen poster-style visualizers. It is licensed AGPL-3.0 and runs in Docker. The project comes
Magnetite is a self-hosted music player built with Laravel. It includes audio analysis, twelve measurement-based meters and fifteen poster-style visualizers. It is licensed AGPL-3.0 and runs in Docker.
The project comes from a liking for vintage hi-fi and its dials. The VU needles, magic eyes and LED bars are modelled on that equipment, and the readings behind them are measured from the audio.
The library
The interface has two panes, monospaced typography and one accent colour on a dark background. Folders and albums are on the left, the tracks of the selected album on the right, and the player stays at the bottom. The last line lists the keys (j k move, Enter play, A analyse, / search). Every key also has a button for touch.
Each album row shows the artist, the album and its dynamic range, and each folder shows the range of what it contains. Orange and red mark increasingly compressed recordings (DR8, DR6, DR0), so a long list shows at a glance which records keep some difference between loud and quiet passages.
Folders sort albums, here by decade and by genre, and they do not move any files. They nest up to six levels, albums can be dragged onto a folder, and z shows every album as one flat list.
The player bar prints the details of the current track:
FLAC ยท 24-bit / 48 kHz ยท DR8 (fair) ยท -22.0 LUFS
File analysis
magnetite:analyze decodes each file and stores its loudness, true peak, dynamic range, clipped peaks, highest frequency with content and effective bit depth.
The findings view lists the files with a finding in one table, worst first. The truth view (:truth) lists every file. Selecting a file shows its findings as sentences:
Clipped 496 flat-topped peaks where the waveform hit the ceiling and was cut off; that cannot be undone.
Very compressed (DR4) Almost no difference between loud and quiet: a heavily limited master.
Peaks over 0 dBTP (+1.5) Between the samples the reconstructed wave goes over full scale; some players and lossy encoders will clip it.
A graph above the findings shows the average spectrum. A lossless file created from a lossy source such as MP3 may show a sharp frequency cutoff, often around 16 or 19 kHz, and the view marks that point. The finding says "likely", because it comes from the audio alone and cannot know where the file came from.
Other findings are padded bit depth, upsampled hi-res files, digital silence, DC offset and exact duplicates. Red marks a problem, orange a warning, plain text a note.
Meters
Up to four of the twelve meters show at once, next to the player or in full screen. Each account saves its own selection.
Wide meters, VU needles, LED meters and magic eyes show the level of each channel. The loudness meter shows momentary, short-term and integrated LUFS and true peak on nixie-style digits. The K-meter, crest factor and loudness range are common readings for judging a master. The goniometer and correlation bar show the relationship between the left and right channels and help assess how a mix will translate to mono. The third-octave analyser and spectrogram show where the energy sits.
Meters use the colours of the active theme: green under Terminal, amber under Amber, cream and orange under a paper theme. c takes the colours from the cover of the playing album.
Full screen
F opens the meters full screen. Up to four panels share the window, the controls hide after three seconds without mouse movement, and Tab picks the panel that m changes. Posters are upright, so two sit side by side.
Posters
The poster designs draw on gig posters, book covers and record sleeves: flat shapes, hard edges, three or four colours, slow movement, and the artist, album and title of the playing track printed on them. The code draws its own shapes and copies no existing artwork. Audio measurements drive every shape:
- Arches, Pillars, Fan: each shape is a frequency range and grows with its energy.
- Lens: two discs, one per channel. Their overlap represents stereo correlation: a mono recording produces complete overlap, while less correlated channels show greater separation.
- Halftone, Facets: grids of dots or triangles that scroll like a spectrogram.
- Dials: four gauges for short-term loudness, true peak, correlation and dynamic range.
- Terrain: a vector workstation screen. A wireframe city on a grid is the spectrum, with panels for channel levels, clipping, stereo width, a small goniometer and loudness.
Each poster scales against the playing track's own peak, so quiet recordings do not disappear and loud masters do not saturate. Paper and ink follow the active theme, and each poster keeps its own accent colours.
Themes
A theme is one JSON file with a palette, a corner radius and a font. Nine are included: Late-night FM, Paper & ink, Vintage VU, Terminal, Tube radio, Amber, Graphite, Night and Cream & orange.
The theme studio edits a copy with a live preview on the meters. A finished theme downloads as JSON or copies to the clipboard. Themes affect presentation, not the underlying measurements.
Under the hood
The stack is Laravel 13, Livewire 4, Alpine, Tailwind 4 and Vite. The player sits in a Livewire @persist block, so the audio element and the Web Audio graph survive wire:navigate. Loudness and true peak are computed in an AudioWorklet, and the same file runs in Node for the library analysis, so the live readings and the stored numbers match. Files are served through a Range-capable stream route behind a policy, scans and analysis run on the queue, and an Android app and a terminal client in Rust use the same server.
Source
Code: github.com/zhoorta/magnetite. Read-only demo: magnetite.stackcare.pt.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.








