Build a Theremin-Style Pointer Instrument with Live Waveform in One HTML File

A ready-to-paste prompt that builds a canvas theremin. Horizontal motion sets pitch, vertical motion sets volume, notes can snap to a scale, and a live oscilloscope trace shows the sound.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a senior creative developer who builds playful audio toys for the web.

Build "Aether Wand", a theremin-style instrument played on a wide canvas. Horizontal pointer position sets pitch across three octaves, from A2 (110 Hz) to A5 (880 Hz), on a logarithmic scale. Vertical position sets volume: loud at the top, silent at the bottom. Below the canvas, draw a live oscilloscope trace from an AnalyserNode so players can see how pitch, loudness and waveform change the shape of sound.

Rules:
- Sound plays while the mouse or finger is pressed. Keyboard users move a cursor with the arrow keys and toggle sound with Space. Create the AudioContext on the first press, glide frequency smoothly, keep master volume low, and show a visible mute toggle.
- Add toggle buttons for waveform (sine, triangle, sawtooth, square) and pitch mode (free glide, chromatic snap, A minor pentatonic snap). Draw the allowed notes as vertical guide lines with note labels along the bottom.
- Show a live readout of note name, cents offset, frequency and volume, plus a one-line caption explaining the current waveform.
- Use a dark navy palette with mint and amber accents, system fonts, readable contrast and visible focus rings.
- Stabilize the trace on rising zero crossings. Draw a glowing cursor trail, but turn it off under prefers-reduced-motion. Resize the canvases crisply from 360px wide upward.
- No external libraries, fonts, files, storage or network calls.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Aether Wand, a pointer-played theremin with a live waveform scope.

Press and drag across the dark pad. Moving left or right changes pitch, and moving up or down changes volume. Switch between sine, triangle, sawtooth and square to watch the trace change shape. Try Pentatonic snap to make melodies that always sound pleasant. Keyboard players use the arrow keys plus Space to hold a note. The other shortcuts are 1–4 for waveforms, S to change the pitch mode and M to mute.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Fixed pitch range, log mapping and named snap scales leave the model nothing to guess, so pitch feels musical the first time.
  • Placing the analyser before the master gain keeps the scope working while muted, and the zero-crossing trigger stops the trace from jittering.
  • Requiring an AudioContext on first press, a mute toggle and keyboard controls avoids silent-page bugs and makes the toy accessible.

Paste into ChatGPT, Claude or Gemini. Save the returned code as aether-wand.html and open it in any modern browser, or run it in the chat's preview or canvas. Headphones help you hear the waveform differences.

Common edits

  • Change the scale: replace the pentatonic degrees with major (0,2,4,5,7,9,11) or blues (0,3,5,6,7,10), or widen the range to four octaves.
  • Add a vibrato LFO or a lowpass filter controlled by a second finger or a slider for richer, more theremin-like tones.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Sound Effects & Music