Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Song with Tone.js

Public visualization

Viewing a saved revision (read-only)

301e80d812574e938b7c8d47ed92dc7b

Song with Tone.js

0 stars1🌍 Public
AAxVa 🐍 💪
Last edited Aug 9, 2026
Created on Nov 1, 2024

This example demonstrates a generative music composition built with the Tone.js library, controlled through a single Play button in the browser. It showcases how multiple synthesized instruments—drums, bass lines, chords, and a trumpet sampler—are sequenced together to form a layered song. The code constructs drum patterns using string-based sequences parsed by helper functions, schedules repeating loops with `Tone.Sequence`, and chains audio effects like `Tone.Reverb` and `Tone.Filter` to shape the sound. The trumpet samples are loaded from an external URL using `Tone.Sampler`.

AI-generated description

This example is based on the book "JavaScript Crash Course: A Hands-On, Project-Based Introduction to Programming" by Nick Morgan, No Starch Press, 2024.

Visit also my repo https://github.com/ax-va/JavaScript-Crash-Course-Morgan-2024.