Markov melody generator

The folk-tune generators of the 2010s learned melodies from thousands of tunes. This one learns from the melody you play and continues it; the order and temperature knobs decide how much it copies and how much it wanders. Everything runs in this page: nothing you play, load, or generate leaves your browser.

Play a melody

Play with the keys above, or with the computer keyboard: a s d f g h j k for the white notes C4 to C5, w e t y u for the black notes in between, and o l ; p for four extra notes in the octave above. How long you hold a key sets its duration: short, medium, or long.

Generate a continuation

Higher orders copy longer stretches of the melody; with a short melody most contexts have only one continuation, so temperature has less to act on. Start at order 1 to hear the knob, then raise the order to hear copying.

Higher orders copy longer stretches of what you played; low temperature repeats phrases almost verbatim, high temperature wanders further from them.

Playback
Play some notes, or load the example, to get started.
played    generated

What to notice: at low temperature and a high order, the generator tends to copy whole phrases back at you, because it has only ever seen one thing follow that exact context; raise the temperature, or lower the order, and it wanders further from what you played.