# Desktop ↔ Web Comparison: comm-community__07_driving_pulse

- **Timestamp:** 2026-06-18T14:25:13.268Z
- **Capture window:** 30000 ms

## Code
```ruby
live_loop :drums do
 sample :drum_heavy_kick, rate: 0.75
 sleep 0.5
 sample :drum_heavy_kick
 sleep 0.5
end

live_loop :synths do
 use_synth :mod_pulse
 use_synth_defaults amp: 1, mod_range: 15, cutoff: 80, pulse_width: 0.2, attack: 0.03, release: 0.6, mod_phase: 0.25, mod_invert_wave: 1
 play 30
 sleep 0.25
 play 38
 sleep 0.25
end
```

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

| Metric | Desktop SP | SonicPi.js (web) | Δ (desk − web) |
|---------------|------------------------|-------------------------|----------------|
| Duration (s) | 31.371 | 29.696 | 1.675 |
| Peak | 0.3042 | 0.2253 | 0.0789 |
| RMS | 0.0752 | 0.0456 | 0.0296 |
| Clipping (%) | 0.00 | 0.00 | 0.00 |
| Sample rate (Hz) | 48000 | 48000 | 0 |
| Channels | 2 | 2 | — |

## Verdict
### ✅ Tier 1 ✓ PITCH-MATCH — pitch-classes (octave-invariant — contour mode) identical over 235 (the musical-correctness verdict) · ⚠ 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:** ✓ PITCH-MATCH — pitch-classes (octave-invariant — contour mode) identical over 235
 - method: desktop `contour` (conf 0.98) · web `contour` (conf 0.99) · compared octave-invariant
 - desktop: `11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5`
 - web&nbsp;&nbsp;&nbsp;: `11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5,11,9,11,5`
- **1.2 Tempo (inter-onset):** ✗ desktop 0.140s · web 0.120s/note
- **1.3 Onset count:** desktop 240 · web 235 (Δ 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.61× (within 0.5–2× band)
- 3.2 Peak ratio web/desktop = 0.74×
- 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-24-32-277Z_comm-community__07_driving_pulse.wav
- **Web:** /Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/2026-06-18T14-24-33-405Z_inline_audio.wav

## Spectrogram comparison
![spectrogram comparison](/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/compare_2026-06-18T14-25-09-480Z_comm-community__07_driving_pulse_spectrogram.png)

| Metric | Value | Reading |
|---|---|---|
| L2 distance (mel-dB) | 11.10 | < 10 = very close · 10–25 = similar shape · > 25 = divergent |
| MFCC distance (timbre) | 88.65 | < 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 | 72.0 Hz | dominant frequency |
| Peak freq web | 46.0 Hz | dominant frequency |
⚠ MFCC distance 88.65 is high — **check Tier 1 first**: if pitch-track matched, this is timbre/gain (the known 0.5× + reverb tail), NOT wrong notes. Only treat as "different synth/sample chain" when Tier 1 also diverges.

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

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