# Desktop ↔ Web Comparison: comm-in-thread-forum__29_sacramento_storm

- **Timestamp:** 2026-06-18T14:52:56.102Z
- **Capture window:** 30000 ms

## Code
```ruby
# Source: https://in-thread.sonic-pi.net/t/a-piece-from-gemini-google-a-i/9970
# Author: hitsware
# Title: A piece from Gemini (Google A.I.)
# Captured: 2026-04-24

# Randomly introduce a burst of tension
if (one_in 6)

 # Step A: The Static (396Hz, Perfect 5th)
 # Simulates the build of electrical charge
 with_fx :bitcrusher do
 use_synth :square
 play 64, release: 0.1, amp: 0.3 # Sharp, bright, stable
 sleep 0.1
 end

 # Step B: The Hail "Clean Slate" Sweep
 # Releasing the mathematical tension into microtones
 use_synth :prophet # A synth with rich harmonics

 # Play a series of 12 notes, rapidly ascending,
 # but each one is randomly detuned by up to 120 cents.
 tick_reset
 12.times do
 # Notes 60 (C) up to 71 (B), with random microtonal offsets.
 play (60 + tick), detune: rrand(-120, 120), release: 0.05, amp: 0.15
 sleep 0.0625 # Very fast 1/16th notes
 end

 # A quiet, stable release back to our fundamental
 # representing the ground covered in hail.
 use_synth :tri
 play 57, release: 10, amp: 0.2

end

# Most of the time, the storm is just building (empty space)
sleep rrand(2, 8)
```

## Stats (Level 3 — observation, not inference)

| Metric | Desktop SP | SonicPi.js (web) | Δ (desk − web) |
|---------------|------------------------|-------------------------|----------------|
| Duration (s) | 31.369 | 29.696 | 1.673 |
| Peak | 0.0000 | 0.0000 | 0.0000 |
| RMS | 0.0000 | 0.0000 | 0.0000 |
| Clipping (%) | 0.00 | 0.00 | 0.00 |
| Sample rate (Hz) | 48000 | 48000 | 0 |
| Channels | 2 | 2 | — |

## Verdict
### ⚠ Tier 1 inconclusive — ⚠ no notes detected on one/both sides · ⚠ Tier-0 SOFT: level/count aggregates unreliable (Tier 1 pitch unaffected)

### Tier 0 — Validity gates
- ✓ 0.1 Sample rate consistent (48000 Hz)
- ⚠ 0.2 Capture-window misaligned (Δ 1.67s > 0.5s) — note-count / level aggregates unreliable **(SOFT — Tier 3 + 1.3 unreliable; Tier 1 pitch still valid)**
- ◦ 0.3 equal preconditions / 0.4 lossless capture / 0.5 routing sanity — not auto-checked; ensure SP.app reset + raw-float32 + FX-bus wired 

### Tier 1 — Musical correctness (THE verdict — energy/MFCC may never override)
- **1.1 Note progression:** ⚠ no notes detected on one/both sides
 - method: desktop `onset` (conf 1) · web `onset` (conf 1)
 - desktop: ``
 - web&nbsp;&nbsp;&nbsp;: ``
- **1.2 Tempo (inter-onset):** ✗ desktop 0.000s · web 0.000s/note
- **1.3 Onset count:** desktop 0 · web 0 (Δ explained by Tier-0 window misalignment)
- ◦ 1.4 note duration / 1.5 polyphony / 1.6 determinism — not auto-tracked here (unit tests cover determinism; see /)

### Tier 3 — Level / gain (reported; NOT a musical-correctness blocker — known ~0.5× web gain-staging)
> ⚠ Tier-0 SOFT failed — these ratios span misaligned windows; treat as indicative only.
- 3.1 RMS ratio web/desktop = 0.00× (outside band — tracked separately, not a Tier-1 fail)
- 3.2 Peak ratio web/desktop = 0.00×
- 3.3 Clipping: desktop 0% · web 0% ✓ (< 1%)

### Tier 2 — Spectral / timbral (supporting only) · Tier 4 — FX/routing · Tier 5 — lifecycle
- Tier 2: see **Spectrogram comparison** section below (MFCC carries its mandatory caveat there).
- Tier 4 (FX accumulation/suppression 200ms scan, per-FX-scope energy): **not analysed** by this tool — use the FX-sweep / boundary-scan tools when FX is in scope.
- Tier 5 (Run/Stop/hot-swap, cold-start, long-run drift): **not analysed** — single capture; use `tools/test-run-stop-cycle.ts` for lifecycle.

## Source WAVs
- **Desktop:** /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/desktop-recordings/desktop_2026-06-18T14-52-16-164Z_comm-in-thread-forum__29_sacramento_storm.wav
- **Web:** /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/2026-06-18T14-52-17-373Z_inline_audio.wav

## Spectrogram comparison
![spectrogram comparison](/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/compare_2026-06-18T14-52-53-616Z_comm-in-thread-forum__29_sacramento_storm_spectrogram.png)

| Metric | Value | Reading |
|---|---|---|
| L2 distance (mel-dB) | 0.00 | < 10 = very close · 10–25 = similar shape · > 25 = divergent |
| MFCC distance (timbre) | 0.00 | < 30 = similar · 30–80 = noticeably different · > 80 = unrelated |
| ↳ MFCC caveat | — | **Tier-2 supporting only.** Confounded by the known ~0.5× web gain ratio + desktop reverb-tail length; **never overrides Tier 1** . A high MFCC with a Tier-1 PITCH-MATCH means timbre/gain, not wrong notes. |
| Frames compared | 2785 | overlapping window after length-aligning |
| Peak freq desktop | 0.0 Hz | dominant frequency |
| Peak freq web | 0.0 Hz | dominant frequency |

## Tool stdout (debug)
### Desktop
```
▶ Desktop capture (30000ms): comm-in-thread-forum__29_sacramento_storm
✓ Report: /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/desktop_2026-06-18T14-52-16-164Z_comm-in-thread-forum__29_sacramento_storm.md
✓ WAV: /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/desktop-recordings/desktop_2026-06-18T14-52-16-164Z_comm-in-thread-forum__29_sacramento_storm.wav
 31.37s · peak 0 · RMS 0 · clip 0%
```
### Web
```
Launching Chromium (headed, audio capture)...
 Running: inline (30000ms)...

Capture saved: /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/inline.md
No errors detected.
```