Generative Music Cities
A generative code that takes input from a Midi Controller and builds modular cities depedning on the music that you play. It's a physical architectural representation of music.
produced by: Aley Baracat
Concept / Visual
In this project, I wanted to experiment with music and sound. I wanted to create a system that interprets music and builds a physical structure based on that music. The aim is to build an exhibition of generative musical cities where each city is the actual embodiement of a music piece. I started by mapping musical notes to different modular blocks and depending on the rhythm the placement of the buildings differ. In other words, the combination of pitch and rhythm are physically translated into architectural structures. An element of randomness is added within the code. Each time the output city would be different.
Technical Implementation
Everything was created by openframeworks/C++
Firstly, I developed a code that helps me easily map different modular blocks using mouse click to map the musical notes. Each buidling is a 5x5 cube matrix. I mapped 2 piano octaves (24 notes) to different cubes formations in a way that makes the structure coherent and physically printable. This part needed a lot of experimentation to make sure that the structures that are generated are free of architectural anomalies. Secondly, I connected my midi controller to the openframeworks and was able to get the input from the keys and access the velocities of the notes as well as the pitch. Then, I developed a code that maps these different pitches to different formations and depending on the tempo of the music the height of a singular building differ. The buildings are placed on a plane with also some element of randomness. Finally, these generated cities are then exported as .ply file that I then convert to a .obj file. I imported all these files into Maya and 3D printed the cities.
Future development
This project could be further developed in many different ways. First of all, I want to map all octaves of the piano to different modular structures. I want to make more variations of the structures. The velocity of the notes could be incorporated in the design of the cities. In addition to that, I can also make the sturcture depend on the sound played in midi (a piano sound would result in a different structure than an electronic sythn sound)
References
ofxMidi Library (tutorial)
https://github.com/lewislepton/openFrameworksTutorialSeries
Animated Cube of Cubes with Java and Processing
https://www.youtube.com/watch?v=iJh8dvEt03E
Simulating Elevation with Cubes and Perlin Noise
https://www.youtube.com/watch?v=H7EwbkBWnmA
Theo Papatheodorou, Workshops In Creative Coding 1
Moving RectsSource