Skip to content

Repository files navigation

Oscilloscope

CI

A single-screen SceneryStack simulation of a bench oscilloscope. Feed it a synthetic signal from the built-in function generator or live microphone audio, and watch the waveform sweep across a phosphor-green CRT graticule. Built with Vite 8, TypeScript 7, and Biome 2.

Features

  • CRT display — 10 × 8 graticule, dual-channel traces, CRT intensity / focus / beam find, optional persistence afterglow
  • Function generator — sine / square / triangle / sawtooth / pulse / noise with amplitude, DC offset, duty cycle, and OUT B phase; patched to CH1/CH2 over BNC cables
  • Microphone source — live audio via the Web Audio API (graceful fallback when unavailable or permission is denied)
  • Vertical — CH1 / CH2 volts/div, position, AC-DC-GND coupling, invert, probe ×1/×10, on/off, plus CH1±CH2 math
  • Horizontal — time/div, position, ×10 magnify, delayed sweep (off / intensified / delayed), Y-T / X-Y / FFT display modes
  • Trigger — source CH1/CH2/LINE/EXT, level (draggable marker), slope, auto/normal/single, holdoff; Run/Stop, Single, Autoset
  • Measurements — live freq / period / Vpp / Vrms / Vmax / Vmin / duty / rise / fall / mean / phase, plus draggable Δt / 1÷Δt / ΔV cursors (toggle in Preferences → Simulation)
  • Lab & export — guided lab presets, CSV / PNG export
  • Full Interactive Description accessibility (screen summary, live details, PDOM order, keyboard help)
  • English, Spanish, and French localization via StringManager
  • Default and projector color profiles
  • Progressive Web App (installable, offline-capable)

Quick Start

npm install
npm run icons    # generate PNG icons from public/icons/icon.svg
npm start        # dev server → http://localhost:5173

The microphone source requires a browser that grants microphone permission over a secure (HTTPS or localhost) origin. Without it, the audio trace is a flat line and the status line explains why.

Scripts

Command Description
npm start / npm run dev Start Vite dev server
npm run build Type-check + production build → dist/
npm run preview Preview the production build locally
npm test Run Vitest unit tests (includes memory-leak suite)
npm run test:fuzz Optional Playwright fuzz smoke (?fuzz, default 15s)
npm run test:fuzz:quick Shorter fuzz smoke (10s)
npm run check TypeScript type check
npm run lint Biome lint check
npm run format Auto-format all files
npm run fix Lint + auto-fix
npm run icons Regenerate PNG icons from public/icons/icon.svg
npm run clean Remove dist/

New sims start at version: "0.0.0" in package.json. Bump only when cutting a release (for example npm version patch and a matching git tag). Keep name in kebab-case; it is separate from the SceneryStack sim identifier in src/init.ts.

Tech Stack

Tool Version Purpose
SceneryStack ^3.0.0 Simulation framework
Vite ^8 Build tool + dev server
TypeScript ^7 Type-safe JavaScript
Biome ^2.5 Linting + formatting
vite-plugin-pwa ^1 PWA + service worker

License

GNU Affero General Public License v3.0 — see OpenPhysics org license.

Contributing

See OpenPhysics contributing guidelines. Report bugs via GitHub Issues; use org issue templates.

About

Single-screen SceneryStack bench oscilloscope. Display a synthetic function-generator signal or live microphone audio on a phosphor-green CRT graticule, with two channels, triggering, X-Y and FFT modes, measurement cursors, and live auto-measurements.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages