Commit graph

28 commits

Author SHA1 Message Date
Me Here
7d743c18a1 PM_K-1: appliance model — push-programming over USB-MIDI, on-device practice log, swing fix
Firmware (pico-cp/): the Pico now owns its filesystem by default (boot.py), so it can save the
practice log and write editor-pushed set lists; the drive is read-only to the computer, which also
protects the firmware. Hold button A at power-on for editor mode (drive writable; universal drag).
  - Replaced the on-screen touch buttons with an on-device PRACTICE LOG (time · BPM · duration ·
    track), newest-first, persisted to /history.json next to programs.json. Plays < 5s aren't logged;
    tap a row twice to delete it. Real timestamps once the editor syncs the clock.
  - USB-MIDI SysEx receiver: clock-set (0x01 -> RTC) and program-push (0x10 -> write programs.json,
    reload, ACK/NAK). disable autoreload so our own writes never self-restart.
  - Fixed swing: the parser was discarding the 's' flag, so /2s never swung. Now the scheduler uses a
    per-step duration with long-short (2:1, SWING_RATIO 2/3) pairs on even subdivisions, matching the
    web engine. Verified: ride:4/2s -> 266/133ms vs straight 200/200.

Editor (editor.html): requestMIDIAccess({sysex:true}); Save to device now pushes programs.json as
SysEx to the device (+ clock sync), waits for ACK, shows "Saved ✓", and falls back to downloading the
file (drag onto the drive in editor mode) when no device answers. Heartbeat also keeps the clock synced.
Web MIDI works in Chromium AND Firefox; the drag fallback covers any browser/OS incl. Safari.

Docs (pico-cp/README, info-kit, README) updated for the two modes, push programming, and the log.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 00:38:08 -05:00
Me Here
7ccc75e399 Phase 3: USB-MIDI audio — play the device through the computer's speakers
Firmware (pico-cp/code.py): on every click, send a USB-MIDI note-on per firing lane —
GM drum note by voice (SOUND_GM), velocity by level (accent/normal/ghost) — via the
default-enabled usb_midi.ports[1]. Polyphonic, so the computer plays the full groove.
New CONFIG: MIDI_ENABLED (default on), MUTE_BUZZER (silence the buzzer when using
computer audio).

Editor (editor.html): a '🎹 Device audio' toggle uses the Web MIDI API
(requestMIDIAccess) to voice incoming notes through the existing synth — Note-On ->
GM_NUM[note] / velocity-to-gain -> playInstrument(). The device is the clock; the
browser is the sound module, locked in sync. Chrome/Edge.

Verified: firmware emits the right notes (kick+hat on beat 1 of four-on-the-floor,
snare's rest skipped); editor loads clean with the toggle + handlers present. Docs
(info-kit, both READMEs) updated. The on-device buzzer/screen still work standalone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 22:40:08 -05:00
Me Here
5fc962f0c4 Phase 0: refresh README to current state; add 'kit' embed variant
README was stale (pre-dating several shipped changes). Rewrite it to match reality:
  - voices are all synthesized now (KIT_ALIAS -> 808/909); drop the VCSL samples
    narrative, the @BUILD:samples wording, and the sample credits.
  - document the lean-widget + separate info-<device>.html page model (was 'Open=Info').
  - add kit.html + all info-*.html to the Pages table; add the new src/ partials
    (header/footer/chrome/progbox/infoembed), pico/ firmware, and pico-main.py to Files/Build.
  - document the share-grammar additions: GM note numbers, Euclidean (k,n[,rot]), per-lane @<db> gain.
  - add a 'Build it (hardware)' section for the PM_K-1 Kit + MicroPython firmware.

embed.js: add the 'kit' form factor to the variant map (it previously fell back to micro),
so data-varasys-metronome="kit" embeds kit.html as the README now documents.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 21:01:40 -05:00
Me Here
5a805a292b Phase D — naming rollout: PM_x-1 purpose codes
Visible names/codes updated across all pages, the landing panes, device silk
labels, the Showcase canvas legend, and the README:
  PM_E-1 Editor · PM_T-1 Teacher · PM_S-1 Stage · PM_P-1 Practice (was Micro) ·
  PM_D-1 Display (was Showcase) · PM_C-1 Concept (was Initial).
Filenames/URLs and embed variant keys are kept as-is for backward compatibility
(existing links and embeds keep working).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 11:26:49 -05:00
Me Here
1c74100065 Restructure (2a): shared chrome on every page; merge Open=Info into one page per form factor
- Shared header/footer/chrome (src/header.html, src/footer.html, src/chrome.js)
  now on every page: editor (header above its app toolbar), player, teacher,
  stage, micro, showcase, embed. chrome.js defers to DOMContentLoaded so the
  footer version stamps regardless of placement. Player's fullscreen toggle
  relocated out of the header to a floating control.
- Open = Info: each form-factor page is self-contained — a more-detailed
  description (.about) + an expandable "Spec & BOM" (<details class="spec">,
  hidden in embed). info-*.html retired; build/deploy/README updated.

Next: teacher-style dimensioned front + top/side views + loading panels for
Stage, Micro and Showcase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 09:31:39 -05:00
Me Here
be00ebf097 Restructure (1/2): Concepts = landing with live embeds; shared chrome partials; Showcase redesign
- Concepts is now the landing (/): index.html is the form-factor gallery with the
  LIVE widget embedded in every box (editor/teacher/stage/micro/showcase/initial),
  on the shared header/footer. concepts.html retired; every "Concepts" link → /.
- New shared chrome partials src/header.html, src/footer.html, src/chrome.js
  (assembled by build.sh) + .site-foot / details.spec styles in base.css. Applied
  to the landing + showcase this pass.
- Showcase redesign per spec: the pendulum bar IS the display — each lane's
  subdivisions/accents ride along the rod as moving RGB light (all meters combined);
  transparent outside the body (no black window); a printed tempo scale on the
  vertical axis with a draggable weight to set tempo; start is an external button
  (the real unit starts when lifted from its holder).

Next pass: roll the shared header/footer onto the remaining pages (incl. the editor
header-above-toolbar), merge Open=Info into one page per form factor with the
expandable Info & BOM, and add teacher-style dimensioned views to Stage/Micro/Showcase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 09:09:51 -05:00
Me Here
17053719f1 New Stage (foot-pedal) + Showcase (RGB pendulum); fix audio/visual sync
Sync: the visual playhead now advances on a latency-compensated clock
(currentTime − outputLatency||baseLatency) so the on-screen pulse lands when the
click is HEARD, not when it's queued — previously the visual could lead the audio
by the output buffer / Bluetooth latency (up to ~a subdivision). Applied to
editor, player, teacher, and the new pages; also bound the visual queue (vq trim).
No data races: single-threaded; only the rAF draw touches vqPtr/currentStep, and
each vq entry carries the exact scheduled time of its sound.

stage.html — foot-pedal stompbox: two heavy footswitches (Tap=tempo / hold=start-
stop, Next=item / hold=prev), 1/4" expression-pedal input → tempo sweep, big
floor-readable RGB beat light + angled TFT, analog instrument pass-through.
showcase.html — pyramid display piece: an RGB-light pendulum easing to each beat
plus per-lane segment rows showing subdivisions/accents/mutes (canvas).
Both: dual USB-C (data+power and power-thru) to daisy-chain off one source.

Wired into embed.js (stage, showcase variants), build.sh, deploy.sh, the
concepts gallery + landing cards, info-stage.html (~$52) + info-showcase.html
(~$39) with BOMs, and the README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 08:40:20 -05:00
Me Here
ce6166a721 Rename "Stage" -> "Teacher" (studio/lesson console); free the Stage name
The full-feature desktop console (big TFT, arcade buttons, instrument pass-through)
is repositioned as the "Teacher" for studio desks and lessons:
- stage.html -> teacher.html, info-stage.html -> info-teacher.html (git mv)
- all links/paths, the embed variant (stage -> teacher), nav, cards, embed docs,
  README, build.sh + deploy.sh updated; deploy cleans the stale live stage files
The "Stage" name is now free for a forthcoming foot-pedal stompbox (/stage.html).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 08:16:15 -05:00
Me Here
362e1fa968 USB-C power for all devices (no batteries); separate Micro end caps; landing Philosophy
Power: standardise the whole family on a single USB-C input — drop the Micro's
2×AA and the Stage's 9V DC pedal jack (+ buck/reverse-polarity). Bring a power
bank; nothing internal to wear out. BOMs updated (Micro ≈$35, Stage ≈$56) and
all copy/cards/READMEs follow.

Micro form: detach the two end caps from the body with a gap (set-back, darker
end faces) so the TRS/USB-C jacks read as being on the ENDS of the bar, not the
front panel.

Landing: add a Philosophy section — "program on the web, play on any device"
(author once → load the program string into whichever form factor fits) and
"USB-C power everywhere — no batteries" (future-proofing rationale).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 08:00:00 -05:00
Me Here
50c4e4da32 README: reflect the landing page at / and the editor at /editor.html
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 12:20:18 -05:00
Me Here
5e5b274e4b README: document the multi-page site, page map, and embed widget
Rebrand the intro to the VARASYS PolyMeter site (PE-1 editor home + concepts +
hardware mockups + embeddable widget); add a Pages map, an Embedding section
with the drop-in snippet, the live program-string note, and refresh the Build
and Files sections for all pages + embed.js.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 12:09:45 -05:00
Me Here
b548c64d2a Share engine, seed set lists & base CSS between editor and player
Both index.html (editor) and player.html (hardware-player mockup) now pull
their common code from src/ via a new build-time include marker
(/*@BUILD:include:src/…@*/), resolved by build.sh:

  src/engine.js   — audio voices (DRUMS×30), Web Audio scheduler primitives,
                    and the share-language codec (patch/set-list encode+decode)
  src/setlists.js — SEED_SETLISTS, so the player ships the SAME default set
                    lists as the editor (player BUILTIN = SEED_SETLISTS)
  src/base.css    — reset + VARASYS brand palette + type stack

The editor inlines the CC0 acoustic samples; the player passes an empty
SAMPLES object and the shared playInstrument falls back to its synth voices,
so the device stays faithfully synth-only. Each app keeps its own state
globals, setBpm, advanceMaster/scheduler, and UI. ~400 lines of duplicated
engine code removed; the player's favicon is now the shared @BUILD:favicon@.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 15:49:35 -05:00
Me Here
632890c812 Add build step (inline assets at build); drop "mockup" from the main app
The source index.html now keeps small @BUILD:* markers instead of the
~250KB of base64 blobs (audio samples, logos, favicon), which move to
assets/. build.sh inlines them into a self-contained dist/index.html
(+ dist/player.html); deploy.sh runs the build first and serves dist/.
dist/ is git-ignored. Keeps the single-file deploy while stopping the
samples from eating the editing budget.

Also reframe the main page as the full web app (it is not a mockup —
only the play-only player.html device is): drop "Mockup" from the title,
the source comment, and the README intro; add Build/Files docs and
correct the "no build step" claim.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 15:21:28 -05:00
Me Here
811891bf5a Sample the rest of the acoustic kit from VCSL (CC0)
Add embedded CC0 one-shots for toms (stick), tambourine, cowbell,
woodblock and claves; tomMid is the low tom pitched up (VCSL has only
two toms). Now 10 sampled voices. rim, open-hat and ride stay
synthesized (no clean VCSL source), as do beep/clap/jamblock and 808/909.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 13:38:48 -05:00
Me Here
8a869f14ea README: link the Codeberg repo directly in the License (§13) section
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 13:16:06 -05:00
Me Here
dad9a666e4 Point source links at the public Codeberg repo
In-app help "Source" link and README now reference
codeberg.org/VARASYS/metronome (the public mirror) instead of the
internal git.varasys.io.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 13:04:28 -05:00
Me Here
3213c6afe4 Remove QR sharing; README accuracy pass
Drop the QR-code share button, its external-service warning banner/CSS,
and the api.qrserver.com handler — sharing is now copy/open link only, so
the app makes no external requests at all. README: remove QR references
and the Deploy section, refresh Features/sounds/dynamics/swing, list the
808/909 voices, and note which acoustic voices use CC0 samples.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 12:54:19 -05:00
Me Here
06986e83aa Embed CC0 acoustic samples (VCSL) — kick/snare/hat/crash slice
Sample-playback engine: short one-shots are embedded as base64 WAV,
decoded to AudioBuffers at audio start; playInstrument plays the sample
when present, else falls back to synthesis. First slice covers kick,
snare, closed hat and crash from the Versilian Community Sample Library
(CC0), trimmed to mono 22.05kHz/16-bit (~117KB). More acoustic voices to
follow once the quality/size is confirmed by ear. Credit added to README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 12:29:29 -05:00
Me Here
d3403df6c2 Add ghost-note dynamics level (4 levels) + help on local/sharing
Pads now cycle accent → normal → ghost → mute. Ghost is a soft hit
(gain 0.25) — added as new level value 3 so set lists already saved at
the 3-level stage (0/1/2 = mute/normal/accent) keep their meaning with
no migration. Share pattern gains a "g" char; the Purdie shuffle's snare
ghosts now use it. Ghost pads render faint with a · marker.

Help: explain that set lists/items/log live only in localStorage and how
to move or share them (Share set-list link / Share settings link /
Export-Import).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:58:33 -05:00
Me Here
766d5d40ae Per-step accent/normal/mute dynamics + swing
Pads are now 3-state instead of on/off: click cycles accent → normal →
mute. Default keeps the first step of each beat accented (the rest
normal), so existing grooves are unchanged in feel; legacy on/off masks
migrate (on-downbeats → accent, on-subs → normal).
- Audio gain is driven per step by level (accent 1.0 / normal 0.6);
  the old auto group-start accent is replaced by explicit per-step level.
- Swing: "swing 8th / swing 16th" subdivision options apply a triplet
  (2:1) long–short feel to even subdivisions (per-lane).
- Share language: pattern uses X (accent) / x (normal) / . (mute), and
  the sub token takes a trailing s for swing (e.g. ride:4/2s). The
  default-accent pattern is omitted; legacy x/. still parse.
- Demos: "Swing ride" and an accents example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:13:53 -05:00
Me Here
7a6aa1d5ba Live-performance set switching, bar-length segments, favicon
Cue/commit model for moving through a set without audible gaps:
- Arrows/Home/End/PgUp/PgDn move an amber cue cursor across set lists.
  Enter commits with a SMOOTH cutover at the next bar; Shift+Enter a
  RUDE cutover at the next beat. N/P are rude quick-steps; Esc cancels.
- One gap-free cutover (armSwitch → scheduler horizon-cap →
  performCutover) replaces the old stop()/start() switch — the audio
  clock stays continuous across every transition (manual or auto).
- Per-item bar length (b<n> patch token + Bars input) with a bar
  countdown; Continue auto-advances at the boundary (cross-list aware).
  Each segment owns its tempo/ramp and resets at the cut.
- Decouple loaded vs viewed list (loadedSL) so the playing item can
  live in a list you're not currently viewing.

Set-list panel: editable name combobox (rename in place; the ▾ menu
lists the set lists with "+ New" last), auto-growing description,
add-item row moved below the list, trimmed hint.

Add an inline SVG favicon (brand-cyan metronome on navy).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 10:31:36 -05:00
Me Here
1f957b7630 Update README: fix stale claims found in code review
- Drop the false "vendored QR library" line; state it's a single
  self-contained, zero-dependency file and document offline use.
- Fix keyboard shortcuts to match the in-app help: remove the
  non-existent R toggle, add Alt+↑/↓ (reorder), 1–9 toggles a lane.
- "GM drum voice" → synthesized; set-list items load on click (no ▶
  auto-start); QR is an external service; clarify release.sh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 09:05:34 -05:00
Me Here
87f323b782 Add GNU AGPL v3 license
LICENSE holds the verbatim AGPL-3.0 text. index.html carries the SPDX
header + notice; README gains a License section noting §13 is met by the
in-app source link (git.varasys.io/VARASYS/metronome).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:33:40 -05:00
Me Here
c2a88e5014 Reclaim Space for play/stop; narrow the keyboard focus guard
The real conflict wasn't the key: shortcuts bailed whenever ANY form
control (slider/checkbox/menu/button) had focus, and those keep focus
after use — so P/T/A/N seemed dead most of the time.

- Guard now stands down only for text-entry fields (text/number/textarea/
  contenteditable), so shortcuts work right after you touch a slider or
  checkbox.
- Space always = play/stop (preventDefault so it won't scroll, toggle a
  focused checkbox, or re-fire a focused button) — the DAW standard,
  which also fixes the original Space/checkbox conflict.
- Arrow keys still defer to a focused range slider / select.
- Legend, help overlay, README updated back to Space.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:08:37 -05:00
Me Here
9cb7c2c193 Per-step pad grid (beats × subdivision); drop confusing Sig dropdown; help: repo link + offline note
- Pad row now shows beatsPerBar × subdivision pads, each individually
  toggleable (the subdivision control sets pad resolution). Subdivision
  pads render smaller; downbeats labeled; group/beat gaps preserved.
- Mask (beatsOn) is now per-step; playhead tracks the current step.
  recomputeLane remaps on grouping/subdivision change and migrates legacy
  per-beat masks (saved data, short share patterns) by expanding across subs.
- Share language: =pattern is now per-step (len = beats × sub); short
  per-beat patterns still accepted and expanded. README updated.
- Removed the Sig time-signature preset dropdown (confusing vs subdivision).
- Help dialog: link to git.varasys.io/VARASYS/metronome + note that it's a
  single-page app you can save & run offline, but file:// won't auto-save
  the set list (export a backup).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:01:17 -05:00
Me Here
17492fdfb0 Single Save button by Tap (disabled when nothing loaded); per-entry + Clear-all history delete; bigger display text
- Move per-item 💾 out of set-list rows into one 💾 Save next to Tap; it
  overwrites the loaded item and is disabled when no item is loaded.
- History list: red ✕ on hover deletes one session; Clear all wipes
  history for the current item only.
- Bump dark-display text again (BPM 80px, timers 26px, status 19px);
  widen the display column to fit.
- README: play key Space -> P.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:45:26 -05:00
Me Here
ba752745b7 Per-lane enable (replacing mute), feature boxes, set-list continue mode, external QR
- Each meter lane has an 'enable' checkbox right after its number (default on,
  green-dim row when off); replaces the right-side 'mute'. Renamed mute→enabled
  throughout (scheduler, snapshot, share '!' flag, 1–9 keys, now-playing). Old
  saved data still loads (back-compat).
- Features area redesigned into highlighting boxes (Gap trainer / Tempo ramp /
  Timers); trainer & ramp boxes light up + un-dim when enabled.
- Set list 'Continue' mode: per-item countdown (saved in each item, 'cd' token),
  and when a playing item's countdown hits 0 it auto-loads the next — so a list
  with countdowns plays straight through.
- Removed the in-app QR (vendored qrcode.js); 'QR ↗' now opens api.qrserver.com
  with the link, behind a banner warning it's a third party (verify it decodes).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:47:16 -05:00
Me Here
5320da4325 Add QR share dialog (vendored qrcode.js) + README documenting the language
- Share menu now opens a dialog with a copyable link AND a QR code (scan to open
  on a phone); generated locally by vendored qrcode-generator (MIT). deploy.sh
  publishes qrcode.js alongside index.html.
- README documents the share language grammar, sounds, URL forms, shortcuts,
  versioning and deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 17:34:26 -05:00