Piano synth · gpt-4.1-mini
Output generated Cost / run $0.0073 Runtime 46.7s
Prompt for this run
Using the pre-provided tone.min.js (global Tone), build a playable piano keyboard controlled by mouse and computer keys that synthesizes notes with an ADSR envelope and visual key feedback.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
METRICS
Transcript · 4 messages
Using the pre-provided tone.min.js (global Tone), build a playable piano keyboard controlled by mouse and computer keys that synthesizes notes with an ADSR envelope and visual key feedback.
I will create a self-contained index.html with embedded CSS and JavaScript. This will use the provided tone.min.js (assumed loaded via <script src="tone.min.js"></script>) for sound synthesis. Features: - A piano keyboard spanning some range (e.g. 2 octaves from C4 to B5) - Mouse interaction: click keys to play notes - Keyboard interaction: map some computer keys to piano keys - ADSR envelope on the synthesizer - Visual feedback on keys while pressed I will build index.html now.
index.html (9984 bytes)Successfully wrote 9984 bytes to index.html
I have created a self-contained index.html that loads tone.min.js and builds a piano keyboard with two octaves (C4-B5). You can play notes using mouse clicks or computer keys. The keyboard uses an ADSR envelope on a triangle wave synth. Keys visually highlight while pressed. Keyboard mapping: - White keys: z x c v b n m , . / a s d f - Black keys: s e t y u (lower octave) and 3 4 6 7 8 (higher octave with Shift) Open index.html in a browser (with tone.min.js in the same dir) to try the playable synth piano. Let me know if you want any enhancements or changes!