Teaching AI to Write Melodies

This blog documents the process of teaching an AI system to generate melodies from the Skiptune database. Expect experiments, mistakes, and occasional surprises, and at the end expect melodies that sound as if a human wrote them.

  • Introducing the Skiptune AI Project

    Problem to Be Solved The Skiptune database is a database of 83,000 melodies from around the world and across several centuries.  These melodies are encoded in a special way (a pitch difference followed by a duration ratio), and we want to explore whether an AI model can learn melodic structure from this representation.   The

    Continue reading

  • When New Two-Note Patterns Are Added

    People some ask me what struck us the most while doing the Skiptune project, and the answer has consistently been the strong impression that new patterns of two consecutive notes emerge once in while at an irregular rate.  Wondering why, an hypothesis came to mind that, loosely stated, composers incorporate a new two-note pattern when

    Continue reading

  • Hashing Intro

    Hashing is a technique by which data are compressed into a fixed-size value that can be compared quickly.  Invented in the 1950s to access data stored on early computers, it allowed programmers to avoid having to search for a name sequentially, one at a time, a slow and inefficient searching strategy.   For example, if

    Continue reading

  • Fixing the “Rest” Issue

    We recognized that our coding of rests as zeroes presented searching errors relatively early, but we put off thinking about a solution off until we needed to finalize the database in preparation for machine learning. We had several options to solve it. The first was as follows: Construct another string of numbers that parallels each

    Continue reading

  • Finalizing the Database

    We’ve been putting off a needed correction to the database that we can no longer delay because training any AI model without this correction would be impossible.  When we were deciding how to encode melodies written with standard Western music notation, encoding the notes as their numerical MIDI values was an easy (and correct) decision.

    Continue reading