Commit Graph

11 Commits

Author SHA1 Message Date
mute bbd9bb6d6b Add xToys pattern import via URL paste
- XToysPattern.cs: fetch pattern from xtoys.app API (one call), parse
  script-v3 JSON, resolve slider defaults, evaluate sine/straight steps
  to WaveFrames at 100ms resolution
- Frequency mapping: 0%=1000ms deep, 100%=10ms buzzy
- MainForm: Pattern button + input dialog, continuously enqueues pattern
  frames as a loop, Stop All cancels
- Fix: handle JSON values that are numbers vs strings (end/start fields)
- NOTES.md: xToys slider parameter intel + frequency mapping docs
2026-08-08 19:44:25 +00:00
mute ccc5093ee2 Add live audio capture via WASAPI loopback
- LiveCapture.cs: real-time WASAPI loopback capture with rolling buffer
  and continuous FFT analysis, enqueues WaveFrames at ~10Hz
- MusicAnalyzer.cs: refactored ExtractFeatures/MapPitchToPeriod/BuildWaveFrame
  as public reusable methods with sampleRate parameter
- MainForm: audio device selector (defaults to system default), Live button
  starts/stops capture, Stop All stops live too
- Adaptive normalization (running max with slow decay) for live volume changes
2026-08-08 19:20:46 +00:00
mute 933c7ede38 Move Swap to connect row, show limiter values, fix trackbar keys
- Swap checkbox moved up to the Connect/device line
- Limiter values shown as separate labels (plain, 32px wide for 3 digits)
- Trackbar keyboard: Up/PageUp/Home = increase, Down/PageDown/End = decrease
- Fix Lim B trackbar clipping (moved down to avoid overlap with Lim A)
2026-08-08 11:58:37 +00:00
mute 8b51ff19a8 Make UI event-driven, heat maps at 10Hz from tick loop
- Heat maps fed from tick loop via BeginInvoke (10Hz, one column per tick)
- BLE label updates on ConnectionChanged event (was 4Hz poll)
- Recv gauges update on StrengthChanged event (B1 notifications)
- Button states refreshed via RefreshButtonStates on all state changes
- Status timer reduced from 250ms to 1s — only music label + tray icon
- Eliminates 4Hz choppy polling
2026-08-08 11:38:05 +00:00
mute 33e289d596 Add per-channel independent limit controls
- Separate Lim A / Lim B trackbars (0-200, default 30 each)
- Separate Scale A / Scale B checkboxes (clamp vs scale per channel)
- State.SetLimitA/SetLimitB with independent LimitModeA/LimitModeB
- ConsumeTick applies per-channel limit and mode
2026-08-08 11:26:44 +00:00
mute 325022d27c Fix Send gauges showing intensity, zero when idle
- Send gauges now show waveform intensity (0-100) not strength ceiling
- State.LastIntensityA/B tracks average intensity per tick
- Zero when no pattern/stream active (was 25 due to IntensityOff 101 sentinel)
- Recv gauges unchanged (device-reported strength 0-200)
2026-08-08 11:18:01 +00:00
mute 84eba7d094 Bump version to 0.1.6, surface in form title 2026-08-08 11:07:15 +00:00
mute 612385af7f Add Send/Recv gauges, fix tick loop to consume without BLE
- Four gauges: Send A/B (commanded) and Recv A/B (device-reported)
- State.LastSentA/B tracks what would be sent after limiting
- ConsumeTick always runs; only SendB0 gated on IsConnected
- Stream queues drain correctly in dev mode (no box)
- Tray icon hot state works without BLE connected
- Removed strength text label, widened form to 420x360
2026-08-08 11:03:44 +00:00
mute 4ae5c397fd Fix crash on startup: call OnLimitChanged after _chkScale is initialized
The manual OnLimitChanged(null, EventArgs.Empty) call in the constructor
was placed before _chkScale was created, causing a NullReferenceException
because the handler reads _chkScale.Checked. Moved the call to after both
_limitBar and _chkScale are created and wired.
2026-08-08 10:55:30 +00:00
mute 44421a51e3 Implement Substation: BLE-WS bridge with music-reactive e-stim
- Renamed from CoyoteBridge to Substation (namespace, classes, UI)
- BLE connection via WinRT with graceful disconnect handling
- WebSocket server (127.0.0.1:8765) with single-client, push events
  for BLE connect/disconnect transitions
- Operator strength limiter (clamp/scale modes, default 30)
- Tray icon with 3 states: neutral/active/hot (runtime-drawn voltage glyph)
- A/B strength gauges, hide-on-minimise to tray
- Music mode: MP3 decode + FFT analysis (NAudio + FftSharp), rhythm→ch A,
  melody→ch B, pre-analyzed with synced audio playback
- Test/Stop All work without BLE connected (dev mode)
- WS device-driving commands error when BLE not connected; ping/status/
  connect always work
- TreatWarningsAsErrors, LangVersion=latest
- .gitignore, README with full API docs + attribution
2026-08-08 10:46:25 +00:00
mute 2bbdcfd9fe Initial commit 2026-08-08 10:44:35 +00:00