Proposed: Sonic Symphony: Crafting Melodies with Machine Intelligence

The Blueprint

  • Status: proposed
  • Masterminds: V-Sekai, fire
  • Keywords: Music, AI, GPT-3, Python, Generation

The Backdrop

As we navigate the 21st century, technology has become an inseparable part of our existence. It’s been making waves in the realm of music too. One such wave is the use of artificial intelligence (AI) to craft melodies. This blueprint proposes a method for creating music using computer algorithms.

The Challenge

The mission is to create music using computer programs.

The Strategy

One promising strategy is to employ .ABC files. These files have proven effective in generating outputs with AI models like GPT-3. The .ABC files carry data in the header section, such as the key signature, tempo, and time signature, which can be incorporated into the prompt.

Alternatively, we could leverage AI models to script for us. For instance, we could ask for a Python script that composes the chromatic 7th intervals from C to B in eighth notes. The output format could be something user-friendly like Lilypond or MusicXML.

Here’s a sneak peek at a Python script:

def generate_chromatic_seventh_intervals():
    notes = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
    intervals = []

    for i in range(len(notes)):
        seventh_interval = (i + 10) % len(notes)
        intervals.append((notes[i], notes[seventh_interval]))

    return intervals

print(generate_chromatic_seventh_intervals())

Another feasible strategy might be to use AI models to generate Lilypond syntax. Lilypond is a robust and adaptable tool for engraving tasks of all kinds, including sheet music, complex notation, vocal music, etc. Here is an example of a simple Lilypond syntax:

\relative c' {
  c4 d e f |
  g a b c |
}

This code will compose a sequence of eighth notes from C to C.

The Road Not Taken

During the journey to find a solution, several paths were explored and abandoned for various reasons:

  1. Using MIDI files: While MIDI files are a common choice for music creation, they were left behind due to their complexity and the challenge in crafting them programmatically.

  2. Using MusicXML: Despite MusicXML being a comprehensive and widely supported format, it was abandoned due to its lengthy and intricate structure, which makes it tough to craft programmatically.

  3. Using other music notation software: Other music notation software like Finale and Sibelius were considered but left behind due to their proprietary nature and lack of support for the programmatic generation of music.

The Upside

  • This approach will pave the way for easier music creation.
  • It will sidestep the limitations posed by the intricate structure of MusicXML.

The Downside

  • There may be some hurdles when using AI models to generate Lilypond syntax.
  • Training small transformers to output syntactically correct .ABC files might pose a challenge.

Further Reading