Exploring the Possibility of Coding Music in Common Computer Languages

Can Music be Coded as Easily as Written in a Common Computer Language?

When discussing the possibility of coding music in a manner as intuitive as writing, one often points to MIDI (Musical Instrument Digital Interface) as an example. However, is MIDI truly a language, and can we effectively capture all aspects of music with it?

MIDI: A List of Instructions, Not a Full-Fledged Language

Strictly speaking, MIDI is not a language. It lacks conditional statements and is essentially a list of instructions. When it comes to representing music, MIDI excels in capturing basic data such as notes and tempo. However, it falls short in handling more complex aspects of music notation.

For instance, tempo interpretations and accented notes are partially captured by MIDI's opcodes, but this information is not easily extractable. If you were to convert MIDI data back into sheet music, the result would only show the note values and tempo, unless your interpreter is exceptionally sophisticated.

MIDI Limitations in Technical Instructions

Even with the General MIDI (GM) extension, MIDI is largely agnostic about technical details. It can identify an instrument, such as "probably a violin," but it cannot carry detailed instructions like detache or martelle.

Can We Code Music More Easily?

While MIDI has its limitations, it is possible to code music more comprehensively using a variety of computer languages and libraries. For example, Sibelius and its alternatives demonstrate that it is feasible to create music notation software. FLOSS (Free and Open Source Software) engraving libraries can be used to convert music data into a format suitable for sheet music.

These libraries typically allow you to generate MusicXML and display it in a visually appealing manner. The challenge lies in scaling these operations to handle complex and customizable musical elements. Manually writing XML for each note or chord progression can be labor-intensive and time-consuming.

Challenges in Scaling and Generalization

Scaling up and generalizing the coding of music is a complex problem with no straightforward solution. Some programmers approach this by developing an ontology of music theory as a foundation and building out concepts from there. However, others prefer using machine learning to teach algorithms about music.

Both approaches present significant challenges. Theory thinking and application in this domain are deeply complex and not fully understood. There have been some advancements in AI-driven music, but much work remains to be done. Until we have more robust solutions, the process of coding music can be quite intricate.

Final Thoughts

While we may not yet have a simple and intuitive way to code music as easily as writing text, progress is being made. Tools like MusicXML and FLOSS engraving libraries are contributing to this field. As technology advances, we may one day see a more straightforward and accessible method of capturing music in digital format.