# Cue Composer: replication prompt

Paste this into Claude Code, Cursor, Replit, Lovable or v0.

```text
Build a self-contained index.html "Cue Composer" that writes an original soundtrack with the Web Audio API, no samples. Write scheduleTrack(ctx, out, opts) that works on both AudioContext and OfflineAudioContext. opts: style, bpm, length, drop (seconds), cues (array of seconds), seed. Instruments are all synthesized: kick (sine pitch drop 150 to 42 Hz), clap (three short bandpassed noise bursts), hats (highpassed noise), off-beat bass (triangle through a lowpass), detuned saw pads per 4-chord progression through a lowpass whose cutoff opens at the drop, a seeded square-wave arpeggio, a feedback-delay send for space, and a compressor plus master fade in and out. Before the drop: pads and soft hats only. At each cue: a bandpassed noise swell sweeping 400 to 5200 Hz that peaks exactly on the cue. Three moods: Warm house 120 bpm, Lo-fi desk 84 bpm with swing and vinyl crackle, Cinematic pulse 100 bpm with straight eighth bass. UI on dark #121110: waveform canvas with beat grid, a DROP marker and CUT markers, mood cards, sliders for tempo, length, drop and seed, a cue text field, Play/Stop with an analyser level meter, Export WAV (16-bit stereo encoder) and Copy cue JSON. Expose window.exportWavBase64(opts) for automation.
```

## Key code

```js
// Each scene cut gets a whoosh that lands exactly on the frame
cues.forEach(c => {
  const s = ctx.createBufferSource(); s.buffer = noise;
  const f = ctx.createBiquadFilter(); f.type = 'bandpass'; f.Q.value = 2.2;
  const g = ctx.createGain(), st = c - .55;
  f.frequency.setValueAtTime(400, st); f.frequency.exponentialRampToValueAtTime(5200, c);
  g.gain.setValueAtTime(.0001, st); g.gain.exponentialRampToValueAtTime(.45, c - .03);
  g.gain.exponentialRampToValueAtTime(.0001, c + .25);
  s.connect(f); f.connect(g); g.connect(comp); s.start(st); s.stop(c + .3);
});
```
