120 BPM
Craft a melody and let AI create variations!
This Interactive Music Loop Generator leverages several modern web technologies and machine learning to create a dynamic music experience:
mm.Player
: Used for sequencing and playing back musical notes in the browser. It utilizes Tone.js internally for audio synthesis.mm.MusicVAE
: A pre-trained machine learning model (Variational Autoencoder) for music. Specifically, this app uses the mel_4bar_small_q2
checkpoint, which is trained on 4-bar melodies. It takes a user-provided melody (a "primer") and generates new, similar musical sequences.mm.sequences
: Utility functions for manipulating Magenta's NoteSequence
data structure, such as cloning and quantizing sequences.mm.tf
) to run the machine learning models directly in the browser.mm.Player
. The app ensures the AudioContext is started via user interaction as required by browsers.NoteSequence
object. This object includes note pitches, start/end times (quantized steps), tempo (BPM), and quantization information (steps per quarter note).NoteSequence
can be played directly using mm.Player
.NoteSequence
objects.NoteSequence
(or a processed version of it, typically quantized to 16 steps for the mel_4bar_small_q2
model) is fed as a "primer" to the music_vae_instance.sample()
method.NoteSequence
objects that are musically similar to the input but offer variation.