Granular-Granular Synthesis

by aytett21 in Circuits > Arduino

692 Views, 3 Favorites, 0 Comments

Granular-Granular Synthesis

174440134_934038030679541_7636680130382898128_n.jpg

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

Software Installation

180px-Logo_Max_8_software.png
arduino_logo_1200x630-01.png

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

Note May 4, 2021.jpg

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

Screen Shot 2021-05-10 at 18.24.48.png
167777099_3779705225412185_7634147617132331826_n.jpg
166956031_348329596594214_2613067675241145920_n.jpg

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

IMG_2709.jpg
IMG_2620.jpg
PCB example (yellow is power grey is GND and Analog Send.png
IMG_2706.jpeg
IMG_2703.jpeg
Example of button before electrical tape.png

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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

175695003_464645238141495_7676911247666779205_n.jpg
173025857_498856768159807_7201723783833524628_n.jpg
175069812_4169437173087747_7890918999885829346_n.jpg
174268883_1095176337634276_4946183967432552030_n.jpg
Glass ontop.png
Fully Done Side.png
Fully done from Back.png

After each component is connected you will need to assemble them all together inside of the 3D printed case.

  1. 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.
  2. Use a hot glue gun to connect the four quadrants. Make sure the parts are set and dry before moving to the next steps.
  3. Plan out where each sensor will be placed. Mark with sharpie.
  4. 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.
  5. 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.
  6. One by one, carefully remove the backing from each piece of stick foam before placing the respective resistor on top.
  7. Place the mic and power buttons in the buttonholes.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. Place your lamp so that it shines directly down onto the box.
  14. Pour your sand onto the acrylic sheet.
  15. You're done! Your granular-granular synthesis sandbox is ready to be connected to your computer.

Operating Instructions

Clean Picture of Synth Program.png
File Preferences Picture.png
Changing port and baud rate

Here's the link to the project files.

  1. Plug the microcontroller into the board. Open the Max patch and open Arduino. Upload the code to your board in Arduino.
  2. Make sure that the “Arduino Mega or Arduino Mega2560” Board/Processor are selected. Lastly select the proper port. On my computer it was “usbmodem14101”.
  3. 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.
  4. 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.
  5. 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.
  6. 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.