🌍 Public
Viewing a saved revision (read-only)
6ddbfc1ace994d7e979782da67b8cbba
Tone.js - "Mary Had a Little Lamb"
This example plays the melody “Mary Had a Little Lamb” using the Tone.js library for Web Audio. It displays a Play button and a hidden “Playing” paragraph, toggled by button clicks. The code schedules individual notes with `Tone.Part` and `Tone.Transport`, using a polyphonic synth (`Tone.PolySynth`) to trigger note pairs and single notes at precise timing positions. The note sequence is hardcoded as an array of time–note pairs, based on the book "JavaScript Crash Course" by Nick Morgan.
AI-generated description