@seyarkai/neurosync
v0.1.0
Published
Hardware-agnostic, edge-optimized middleware SDK that transforms raw neuromuscular and neural signals (sEMG/EEG) into intentional, high-fidelity control commands. Fully local processing — zero cloud reliance.
Maintainers
Readme
Seyarkai NeuroSync
The next-gen human-computer interface. A hardware-agnostic, edge-optimized middleware SDK that transforms raw neuromuscular and neural signals (sEMG / EEG) into intentional, high-fidelity control commands for spatial computing.
Disclaimer — read first. NeuroSync is a research-grade SDK. The default signal sources are synthetic generators that simulate wearable sensor streams; real-data ingestion is supported through a documented adapter format. NeuroSync is not a medical device, is not certified for clinical, diagnostic, or safety-critical use, and decoding accuracy on real physiological signals depends entirely on your hardware, electrode placement, and per-user calibration.
What it does
raw sEMG/EEG frames ──► artifact suppression ──► Butterworth band-pass + mains notch
──► 200 ms sliding windows ──► Hudgins + spectral features ──► softmax intent classifier
──► temporal smoothing ──► `command` events ( fist / point / flex-wrist / … )- Ultra-low latency — the per-window decode path (window copy → feature extraction → classification → smoothing) runs in well under 5 ms; a CI perf test asserts p95 < 5 ms. See docs/science.md for the exact measurement methodology.
- Zero-cloud reliance — pure TypeScript, zero runtime dependencies, no network calls. Everything executes locally in the browser tab or Node process. (A C++/WASM core with the same API surface is on the research roadmap; the TS implementation is the reference.)
- Hardware-agnostic — feed any device that produces multi-channel sample frames. Ships with deterministic sEMG/EEG simulators so you can build before you have hardware.
- Per-user calibration — collect labelled windows at runtime, retrain in-process in milliseconds, export/import calibration profiles as JSON.
Install
npm install @seyarkai/neurosyncBrowser via CDN (after the package is published):
<script type="module">
import { Pipeline, SemgGenerator, SignalStream } from
"https://cdn.jsdelivr.net/npm/@seyarkai/neurosync/dist/index.js";
</script>Quickstart
import { Pipeline, SemgGenerator, SignalStream } from "@seyarkai/neurosync";
const pipeline = new Pipeline(); // sEMG, 1 kHz, 8 channels, shipped model
pipeline.on("command", (cmd) => {
console.log(cmd.gesture, cmd.confidence); // "fist" 0.97
});
// Simulated wearable (swap for your own device adapter)
const wearer = new SemgGenerator();
new SignalStream(wearer, (frame) => pipeline.push(frame)).start();
wearer.setGesture("fist"); // the simulated user clenchesFeeding real hardware instead is one method call per sample:
myDevice.onSample((values: number[], timestampMs: number) => {
pipeline.push({ t: timestampMs, channels: Float32Array.from(values) });
});Live demo
neurosync.seyarkai.com — raw vs filtered scopes, live class probabilities, a gesture-driven 3D object, latency HUD, and in-browser calibration. All processing stays in your tab.
Run it locally:
npm run demo # builds the SDK and serves the demo at http://localhost:8788Documentation
| Doc | Contents | | --- | --- | | docs/usage.md | Installation, pipeline configuration, events, simulators, real-data ingestion, calibration workflow | | docs/api-reference.md | Every public class, function, type, and event | | docs/architecture.md | Pipeline stages, module map, performance design | | docs/science.md | Filter designs, feature definitions, classifier math, latency methodology | | docs/data-format.md | Frame/CSV schemas for real-device integration | | docs/deployment.md | Production deployment: npm publishing, CI releases, CDN, demo hosting on Cloudflare Pages |
Examples
npx tsx examples/node-quickstart.ts # simulator → commands in the terminal
npx tsx examples/node-realdata-csv.ts # decode a CSV recording (real-data adapter)
# examples/browser-minimal.html # 20-line browser integrationDevelopment
npm install
npm test # vitest: DSP correctness, features, model, e2e decode, p95<5ms perf
npm run typecheck
npm run build # tsup → dist/ (ESM + CJS + .d.ts)
npm run train # regenerate the shipped default model (src/model/weights.ts)License
MIT © Seyarkai — seyarkai.com
