user profile image

Play and hold a melody or a chord and let a deep neural network complete it for you.

Powered by the Improv RNN model by Google Magenta.

This is an experiment exploring musical human-AI interaction, implemented with Magenta.js, TensorFlow.js, and Tone.js.

See also: Neural Arpeggiator


  1. Is this actually working? I can play melodies (which is very nicely done), but they don't result in any feedback from the neural network.

  2. Hi Tim, it should be working - it should continually be generating a melodic line for as long as you hold the keys down.

  3. It is nice, I did get one melody around one key pressed and held down, I then stopped pressing the key, but your script then locked up my browser (back button had no effect) and continued to emit one long tone - same note! I had to mute the sound, my browser told me a script was slowing it down, and gave me the option to stop it, and I selected stop it - my browser was free again. You should have some predetermined fade-out of the tone, or length that any tone plays, so that your tone playing stops long before my browser "slow down" message appears.

  4. Thank you sir! It works fine with a single key but doesn't seem to "remember" the melody I'm playing to "compose" upon it. Tempo needs to be below 30 though. I forked it to add your MIDI output (from arpeggiator) to play it on my MIDI instrument ... and record the notes as MIDI.

  5. @teropa this is great, I've enjoyed playing with this pen and ended up making a YouTube video here:

    I tried to give you credit in the video and description so it's clear this is your work.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.