🌍 Public
Viewing a saved revision (read-only)
560c854f2ef34cd885c7c6480c72e29d
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