This work is a composition algorithm using program source code and cellular automata.
Currently, the development of digital content has created a great demand for music.
Accordingly, familiar music is created and used that perfectly conforms to existing formats. We believe that this causes a loss of musical originality, which in turn affects the works used. On the other hand, music created in fields such as contemporary music, which aims to break away from existing forms, is generally difficult to listen to. Therefore, this algorithm aimed to generate “diverse” music in new forms while following “existing forms” to some extent.

To achieve these two goals, we used the source code of the program and a cellular automaton.
Program source code is created daily for a variety of purposes and exists in large quantities. Program source codes have a common structure and individuality depending on the language, algorithm, and creator.
In addition, cellular automata can produce a variety of results while following existing formats by setting parameters appropriately.
By providing the source code of the program as an external factor of the cellular automaton, we thought that diversity could be created by drawing out the commonality and individuality of the source code, while still following the existing form to some extent.
Specifically, the cellular automaton reads the program source code and breaks it down into lines and words. It then determines harmony based on the lines and melody based on the words.

This makes it possible to generate a large amount of diverse music that strays slightly from existing formats.
The application is created using “Processing” and music can be generated using source code on the Internet by entering a URL. Please enjoy the music generated by various source codes.