Random Song Generator — Tone.js Loops
Instruments
- Synth: PolySynth (triangle) plays random triads in C major; envelopes and velocities vary per event.
- Bass: MonoSynth mirrors synth roots an octave down with a punchy envelope.
- Drums: A Sampler triggers 808 kick/snare/hat samples hosted on a CDN.
Patterns
- Synth pattern: A two‑measure loop picks from major/relative minor triads at quarter‑note positions; stored so the bass can follow.
- Bass pattern: Derives from the synth roots to keep harmony aligned; note lengths and rests differ to avoid doubling.
- Drum pattern: Simple kick/snare backbeat with randomized hat fills and occasional syncopation.
Scheduling
- Each layer uses a Tone.Part; the Transport runs at 120 BPM by default. Randomization buttons rebuild and reschedule only the selected part; Reset rebuilds all.
Extensions
- Swing, humanization, effects (delay/chorus), minor/lydian modes, or chord‑scale mapping for more melodic variety.