Experiment 2
This is the second experiment I undertook to start learning to work with Tone.js, with assistance from TonalJs as well.
In this experiment, I wanted to start attempting to make give the music some melodic sense and consistency. Once the key is decided, we set a randomly-generated melodic length then generate a fixed set of notes based on that melody. Then, we generate a set of variations (the number of which is also random) on that melody, be be played back in a loop. The ostinato bassline is a simple statement of the melody, while the top voice plays the notes of the variations, with a random rhythm.
From a sound-generation standpoint, I wanted to start experimenting with the FM synthesis capabilities of Tone.js, and to start using the fmsine and some of the LFOs and other modulators to start creating some more interesting sounds. We also randomly route the melody to one of two different delay lines.
Click the button to start a two-part generative piece of music.