← back to work

VisionIn development

BallisticLens

A digital range instructor that lives in your phone. Physics-grounded diagnostics, acoustic timing, and coached audio feedback — all from a browser.

The problem

Shooting has no feedback loop.

Most shooters finish a string, walk to the target, squint at the grouping, and guess. Commercial shot timers tell you elapsed time — not what caused the variance. Ballistic apps exist in isolation from session data. Real coaching requires hiring an instructor and scheduling time around one.

The phone in every shooter's pocket has a microphone, a camera, a processor, and a speaker. None of that was being used.

The solution

Connect the data that's always existed.

BallisticLens closes the loop between live fire and coaching by connecting four things that have never been integrated: your hardware profile, your timing, your target, and your coaching — in a single mobile-first session workflow.

Log your build. Shoot a string with the browser shot timer running. Upload your target. The system calculates the delta between where you hit and where the physics say the round should land, diagnoses the likely cause, and delivers coached audio feedback in the voice of a lead instructor. A branded range card captures the session for review or sharing.

Anatomy

See how it actually works.

Five system diagrams trace the session loop — the acoustic shot timer, the vision pipeline, the Pejsa solver, and the coaching voice — separating measured ground truth from instrument prediction, drawn in one visual language.

Under the hood

What's actually running.

Five distinct systems, each responsible for one part of the session loop. No single component knows more than it needs to.

Acoustic shot timer

Built on the Web Audio API with a BiquadFilterNode set to 500Hz lowpass — Pocket Mode. The filter isolates the concussive pressure wave of a muzzle blast from the noise floor of a live range: brass hitting concrete, holster draws, steel impacts. Indoor echo lockout: 120ms. Outdoor: 50ms. AudioContext.suspend() fires after five minutes of silence. Split times, total string, and raw timestamps persist per session.

Computer vision pipeline

Imagick preprocessing chain: grayscale conversion → 15% contrast stretch floor → 2px Gaussian blur → candidate hole detection. Results are rendered on an HTML5 Canvas with manual tap override — the shooter confirms or corrects detections before scoring is applied. Manual confirmation is always authoritative. Every upload has EXIF and GPS metadata stripped via Imagick::stripImage() before storage. Files are renamed to SHA256-derived hashes; the storage directory is locked from public listing.

Pejsa ballistics & Shooter Delta

The Pejsa solver calculates theoretical point of impact from firearm profile data — bore-to-optic height, zero distance, muzzle velocity — so the Shooter Delta (the vector between the actual hit centroid and theoretical POI) is already corrected for mechanical offset before any coaching happens. A close-range low hit caused by sight-over-bore offset reads as a low prediction too, so it never gets mistaken for a flinch. From there a deterministic fault wheel maps the delta to its likely cause along the standard shot-analysis chart — low-left to jerking the trigger, high to heeling, and so on through all eight directions — mirrored for left-handed shooters. That mapping is an established coaching heuristic, not a physics proof, so the read is framed honestly: a probable cause from a consistent group, to be confirmed with a ball-and-dummy or dry-fire check, never a verdict on a single shot. It weighs how far to trust each read by how tight the group is — a scattered group is told to fix the grip before chasing a direction — and pairs every diagnosis with the drill that confirms it. A mid-session hardware hot-swap control lets the shooter change firearm profiles without ending the string.

Lead Instructor coaching persona

A vocabulary engine with 48+ lines organized into four tiers: Elite, Improved, Consistency, and Regression. Context-matched by Shooter Delta, split performance, experience level, target distance, and cold-start state (first shot of the day). Delivered via text-to-speech. Repetition within a session is a failure state — the system tracks what it has said. The persona is stoic, technical, and direct. It does not congratulate. It diagnoses.

Range card generation

PHP GD library renders a branded USPSA-style session card: initials-only shooter identity (no full name, no email), hardware and ammo stamps, scaled hit overlays with centroid marker, split times when available, and a QR deep-link to a shareable verification page. Cards are output as JPEG, formatted for both print and Instagram/X story dimensions. Verification links can be revoked from the history dashboard.

Stack

PHP · MySQL · PDO
Web Audio API · BiquadFilterNode
HTML5 Canvas · Imagick
Pejsa Ballistics Solver
PHP GD Library
ElevenLabs TTS
WebAuthn / Passkeys (V2)

Status

In active development.

The session loop, ballistic solver, vision pipeline, Lead Instructor TTS coaching, and range card generation are all built and running. The Shooter Delta diagnostic now reads all eight fault directions, weights each read by how tight the group is, and is covered by a pure-logic unit test. Still in active testing — UI polish and edge-case work underway. Try the live demo above, or reach out directly for a walkthrough.