GOL-Midi Semesterprojekt

Concept

In this project I wanted to revisit my first-semester project about generating sound using cellular automata. Instead of synthesizing the sound directly from the state of the cellular automata, I wanted to take advantage of using the MIDIMusical Instruments Digital Interface see also →OSC-capabilities of the ATmega32U4 microcontroller and design a custom PCB for an Arduino Micro shield which controlls the simulation. The state of the simulation is then send as MIDIMusical Instruments Digital Interface see also →OSC over the USB-C port of the Arduino, which can then be used as a MIDIMusical Instruments Digital Interface see also →OSC-controller. For the design of the PCB I wanted to take a procedural approach aswell while keeping it simple but taking advantage of all the layers available. The custom PCB controlls the speed and rules used in the one-dimensional automata. To visualize the automate an 8x8 LEDLight-emitting diode matrix is used.

All rules.png


Schematic

To keep the controls simple, the only inputs used are two potentiometers and a button. for the LEDLight-emitting diode matrix a preassebled 8x8 matrix with a MAX7219 controller are mounted through the back to make it shine through the PCB. Thus five holes have to be added for the five pins of the MAX7219 have to be added. Schematic.PNG


PCB

For the general PCB shape I wanted to use the retro-look of old hand-held game-consoles in combination with a texture that was generated by cellular automata. After a rough layout in PCBnew, I went to Inkscape, traced an old GameBoy and began to make outlines for the edge-cuts and silkscreen layer. After importing the general shape, I layouted all the mounting holes and pins and began to wire everything on the backside of the PCB. I left a window in the mask-layer, where the LEDLight-emitting diode matrix is going to be mounted to and surrounded every component with a symbolic outline in the silkscreen-layer. Pcb new.PNG


Generation

To fill the general outline with texture, a 1-dimensional cellular automata was used with random inputs and the infamous rule 30. I upscaled the resulting texture and imported it into Inkscape. The texture was then masked to exclude the immediate surroundings of the components. It was then once used for the silkscreen (just around the screen) and once for the front copper for the rest of the PCB. Rule30.png


Final Design

3d-back.png 3d-front.png


Programming

Simulation

To efficiently simulate the 8-Bit automata the state of the cell and it's neighbours are interpreted as 3-Bit numbers that are then looked up in two arrays. One for the rules whether a cell is created and one for whether the cell should die. Rules for the automata can be changed using the shield.

MIDIMusical Instruments Digital Interface see also →OSC

To send the state of the simulation using MIDIMusical Instruments Digital Interface see also →OSC the library MIDIUSB (https://github.com/arduino-libraries/MIDIUSB) was used. The state of the simulation is mapped to chrods of a selected scale that are hardcoded in memory and can be send all at once or as an arpeggio. To map to the scales the state of the automata is interpreted as an 8-Bit number that is then mapped to the tone. The speed or time of the interval is controlled by the shield.


Parts

Besides the PCB the following parts are necessary:

  • 2 Potentiometer
  • Button 6mm
  • MAX7219 8x8 LEDLight-emitting diode Matrix-Modul
  • Arduino Micro

Build

PCB Arts -L.E.K Build.jpgPCB Arts -L.E.K Build 2.jpg

Due to an error I did on the left potentionmeter (missing connection). I was not able to follow my planned design and had to improvise. To the same functionality as planned, I replaced the one potentiometer left with another button, giving me two buttons to work with. I sadly had to use cables for the LEDLight-emitting diode Matrix and parts of the buttons, due to my GND and 5V+ beeing all connected to each other. The combination of lines and cables however works as intended.

Ezgif-6-ba2d047897d0.gif Ezgif-6-46dbab99ab2a.gif (GIFs, click to play)


Usage

To use the build just plug it in using a micro-USB cable and enable it in the DAWDigital audio workstation – combination of hardware and software to create music and sound digitally as a Midi-Device (named Arduino Micro). Since the build only has two buttons (left and right) for many functionalities, alls buttons have multiple uses and combinations:

  • Click Left (Down, Up under 200ms): Next Chord
  • Hold Right & Click Left (Hold first): Previous Chord
  • Click Right (Down, Up under 200ms): Next Cellular Automata Rule (0-255 wraps around)
  • Hold Left & Click Right (Hold first): Previous Cellular Automata Rule (0-255 wraps around)
  • Hold Left (Longer than 500ms): Increase BPMBeats per minute
  • Hold Right (Longer than 500ms): Decrease BPMBeats per minute
  • Hold Left & Hold Right (Longer than 500ms): Start/Stop playing
  • Hold Left & Hold Right (Longer than 2000ms): Reset everything

Demonstration


Further Reading:

Elementary Cellular Automaton