Skip to content

Add morse code translator at /morse#161

Open
ianalloway wants to merge 1 commit into
mainfrom
claude/morse-code-729tge
Open

Add morse code translator at /morse#161
ianalloway wants to merge 1 commit into
mainfrom
claude/morse-code-729tge

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Summary

  • Adds /morse — a two-way morse translator with authentic Web Audio playback
  • src/features/morse/morse.ts: full ITU table (letters, digits, punctuation), encode/decode, morse auto-detection, a dit-unit timing scheduler, and a MorsePlayer driving an oscillator gain envelope
  • src/pages/Morse.tsx: two-panel translator with direction auto-detect, WPM (5–35) and tone (400–1000 Hz) sliders, play/stop, copy
  • src/App.tsx: lazy-loaded /morse route with SEO metadata

How it works

  • Typing text encodes to morse; pasting something made only of ./-// auto-switches to decoding (badge in the header shows the active direction)
  • Playback follows standard spacing — dit 1 unit, dah 3, intra-letter gap 1, letter gap 3, word gap 7 — with dit length from the PARIS standard (1.2s ÷ WPM)
  • A single oscillator's gain is scheduled per tone with 4ms attack/release ramps, so there are no clicks between symbols
  • AudioContext is created lazily on first play and resumed defensively; disposed on unmount
  • Engine verified by a scripted test pass: encode/decode round-trip, schedule offsets (letter gap at +4, word gap at +8), PARIS timing

Test plan

  • Load /morse — "hello world" pre-encoded in the output panel
  • Play — hears dits/dahs with correct rhythm; stop cuts it off
  • WPM slider changes speed; tone slider changes pitch
  • Paste ... --- ... — auto-detects and decodes to "sos"
  • Round trip: encode → copy → paste back → original text
  • Punctuation and digits translate both ways
  • Playing works for both text input (plays the encoding) and morse input (plays it directly)
  • Navigating away mid-playback stops audio cleanly

Generated by Claude Code

Full ITU table with digits and punctuation; encode/decode with
direction auto-detected (input of only dots/dashes/slashes is treated
as morse). Playback builds a timing schedule in dit units (dit 1,
dah 3, letter gap 3, word gap 7) and drives a single oscillator's gain
envelope through Web Audio with 4ms attack/release ramps to avoid
clicks; dit length follows the PARIS standard (1.2s / wpm). WPM and
tone-frequency sliders, play/stop, copy. Engine verified with a
scripted test pass (round-trip, schedule offsets, PARIS timing).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgEKRuVdor8KhaiPkv38aQ
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ian-web-forge Ready Ready Preview, Comment Jul 19, 2026 4:30am

@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for ianalloway ready!

Name Link
🔨 Latest commit d871e82
🔍 Latest deploy log https://app.netlify.com/projects/ianalloway/deploys/6a5c52f02447c2000866e336
😎 Deploy Preview https://deploy-preview-161--ianalloway.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ianalloway
ianalloway marked this pull request as ready for review July 19, 2026 04:32
Copilot AI review requested due to automatic review settings July 19, 2026 04:32
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants