Granular-Granular Synthesis
Granular-Granular Synthesis is an interactive audio experience that aims to simplify granular synthesis for those who have never heard of the concept. Using sand as an interactive medium, the system combines the haptic experience of manipulating sand with the aural experience of hearing how those physical changes affect the sound. Changing parameters such as pitch and grain, our synthesizer introduces both experienced and novice musicians to a new way of thinking about granular synthesis, and even synthesis as a whole.
Supplies
Hardware
- Arduino Mega 2560 REV3
- Power Switch Blue - 16mm
- Mic Switch White - 16mm
- Photo Resistors (Qty: 16)
- 10k Ω resistor (Qty: 16)
- 2 Pounds Natural Decorative Real Sand
- 600 Lumens Integrated LED Clamplight OR similar bright LED lamp can be positioned over the box
- 16mm drill bit (for installing buttons)
Software
Software Installation
For this project, you'll need both the Arduino IDE and Max software installed onto your computer. After they are installed you will need to download the granular synthesis max file and granular synthesis Arduino file in order to run the programs.
Arduino IDE is open-source and simple to download. Locate the appropriate file for your operating system, download it, and, if prompted, configure the initial settings. Arduino has more specific instructions for each operating system on their site.
Max is free to download but does require a license to use once installed. The website offers multiple licenses and payment options, including discounted academic licenses and subscription plans. There is a 30-day trial period, which you might consider if this is a short-term project for you. Once you've downloaded the software, follow the prompts to set up Max.
Circuit Diagram
Before you can even think about wiring your breadboard, you need a circuit diagram to reference for your project. Luckily for you, we already drew up a circuit diagram for you.
On a breadboard the concept is rather simple. From your arduino connect wires from the ground and power pins on the arduino to the ground and power rail of your bread board. Next connect one side of your photoresistor to the power rail, and one side of your resistor to ground. Then connect the remaining side of the photoresistor and resistor to an open Analog Pin. For the buttons, we connect the power rail to the buttons CT pin. Next wire the ground of the buttons to ground. Lastly, connecting the button’s +Led Pin and NO (Normally open*) Pin to Arduino Digital Pin 0 and 1 will complete the circuit diagram.
**In the code provided in section 6, the “debug” comment of the arduino code outputs the values for Pins A0-A15 and D0 and D1. This allows you to check if each component is wired correctly.
3D Printing
For this project, you'll be 3D printing the box as well as the dividers that separate each photoresistor.
We've provided the STL files for this project. Import the STL files into the Cura. Scale them by 14000 (or any size you desire). Afterwards, select 20-40% infill and print them.
Soldering
The synthesizer has four separate quadrants, each quadrant is made up of 4 PCB components connected to each other in a series. Each PCB component will have a resistor, photoresistor, and wires connected to power, ground and analog read. One of the 4 components will receive power directly from the arduino while the other will be connected to each other in a series.
- To create one quadrant you will need to break apart PCB boards into 4 separate components. For each component you will need to solder a wire to ground and power. Then attach a photoresistor and resistor to each PCB component. One side of the photoresistor should be connected to the power rail on your PCB board.Add wire to the same rail as the photoresistor, not the power rail, so you’re able to connect to the photoresistor to an analog input later. Next connect one side of the resistor to the ground rail. Photoresitor and the resistor should then be connected to each other in a series. To make sure there is a connection between components, test your connection with a voltmeter. After you’ve soldered your photoresistor, resistor, and wires. One PCB board from each quadrant will have their ground and power rails connected directly to the arduino. The rest will be connected to the power and ground rails of the previously connected component.
- After each PCB component has their individual parts soldered onto the board you will connect the power and ground wires of one PCB component to the power and ground rails of the first component connected to the arduino. The two other PCB components will have their power and ground rails connected to each other in a series. In doing so you should have a setup that has one component getting power from the arduino, then the next component connected to the power and ground rail of the previously connected component and so on until all the components are connected together in a series. At the end your quadrant should look something like this .Add photo here. After you’ve connected you components connect the photoresistor to analog PINS A0-A15 of your arduino mega. Then run the test code to make sure everything is functioning properly.
- Repeat this process three more times to create 4 quadrants total. At the end you should have 16 PCB board connected in groups of 4 with, with the power and ground of on component connected directly to arduino and the power and ground of the other components connected.
- If you are installing physical buttons to control the synth power and microphone, you will have to wire 5V from the existing grid to the CT common connection pin on the button. Next wire the ground pin of the button to the existing grid of ground’s. Lastly, connecting Digital Pin 1 -2 to the buttons +Led Pin and NO (Normally open*) Pin will close the circuit.
*This means that the circuit will be normally open when the button is not engaged, but will be closed when the button is engaged. Connecting the buttons Led in this fashion will allow us to have a fully analog connection between the button state and LED state.
We've provided code for you to use when testing your sensors. Place all three files into a folder named sensor_test before running the code.
Assembly
After each component is connected you will need to assemble them all together inside of the 3D printed case.
- Start by attaching your arduino mega to the front of the 3D printed box that will be holding your sand. You can do this by using a piece of double sided tape. Make sure that the hole in your box is underneath the arduino so you can route the wires cleanly.
- Use a hot glue gun to connect the four quadrants. Make sure the parts are set and dry before moving to the next steps.
- Plan out where each sensor will be placed. Mark with sharpie.
- Stick a piece of double-sided sticky foam on each dot. Don’t take the back off of the top side of foam, you won’t stick anything down just yet. These will keep the PCB components from moving inside the synthesizer.
- Start organizing your resistors on the grid so that the ground and power wires can be bussed and so that all the wires are generally organized and facing the same direction.
- One by one, carefully remove the backing from each piece of stick foam before placing the respective resistor on top.
- Place the mic and power buttons in the buttonholes.
- When you have placed all the pieces down, connect the wires to each other as needed and to the Mega microcontroller. Try to keep the wires organized so that box isn't cluttered with wires. You can use electrical tape to bind the wires together. If you don't have electrical tape, you can use Scotch tape, but keep in mind that Scotch tape does conduct electricity.
- Next you’ll want to connect the photoresistor to their respective analog inputs. Do this by taking the wires that you soldered to the same rail of the photoresistor; pull it to the center of your synthesizer and then through the hole that is above the arduino.
- Next you will want to drill two holes into one side of your 3D printed box. Here you will add the two buttons that will turn on the power and the microphone to the system. If you are using the buttons from the materials list you will need a 16mm drill bit.
- After the buttons are installed the next step is to add the dividers. After your dividers are added.The final steps is to add glass or plexiglass to the top of the system to keep the components separated from the sand. We used plexiglass, but suggest that you use glass, because it is easier to cut. You can get a piece of glass and a glass cutter from your local hardware store. Use the glass cutter down the dimension of the glass so that it fits inside of the system. We used an 8 by 11 inch piece, and cut it down to an 8 by 10 piece. But this could be different based on your print scaling.
- Make sure there are no gaps in the system so that sand doesn't fall into the components. You should use glue or caulk to complete the seal.
- Place your lamp so that it shines directly down onto the box.
- Pour your sand onto the acrylic sheet.
- You're done! Your granular-granular synthesis sandbox is ready to be connected to your computer.
Operating Instructions
Here's the link to the project files.
- Plug the microcontroller into the board. Open the Max patch and open Arduino. Upload the code to your board in Arduino.
- Make sure that the “Arduino Mega or Arduino Mega2560” Board/Processor are selected. Lastly select the proper port. On my computer it was “usbmodem14101”.
- Locate the arduino code within the attached folder of resources for the synth. Upload the code to the Arduino and use the Serial Plotter to check that all of the resistors are responding to changes in light/that the buttons are working.
- Next open Max and go to file preferences (Options>File Preferences). You will have to add a file path to the Resources folder in order for the granulation to work. You will need to restart Max completely for this to work.
- Lastly, open the Max Folder and take it out of presentation mode. Follow the steps in the attached video to set the Max program to read from the serial port that the arduino is attached to.
- Once it's on, you can drag an audio file into the Max program or record in using your computer's microphone and the toggle button. Play around with the system. Move all the sand to various quadrants and see how the sound is processed.
Potential Improvements
Our system has numerous potential expansions and improvements that could make the experience even more exciting for our users.
- Changing how much influence each grid has on the parameter it influences (i.e. the values of the outer rows could be more weighted than the inner rows).
-
The system can always be improved by making the photoresistor grid a “higher resolution”. Another way to improve the system is to make the light attached to the system. So that the light is always shining over the board in the same way.