Step 1: In Lab
During the lab I setup a basic breadboard input/output to demonstrate using p5 serial communication. In this demo, a potentiometer is used move a pong paddle (game created by Tong) and I added a p5 button that lights up an LED on the board. This simple demo shows communication from p5 to arduino and arduino to p5.
Step 2: Planning
For this lab I was really intrigued by the idea of an audio controller. While I love games, I’ve been fascinated by synthesis lately and so I wanted to build a simple synth in p5 and use the arduino to control it. While p5 has a great sound and synthesis library, I was finding it really hard to map the keyboard keys to midi notes. I found a fantastic example project of a p5 synth with keyboard controls though, that was actually built at a HackCU hackathon! So hats off to David and Josh who provided the framework for the synth.
Step 3: Final Project
For the final project, I heavily modified the synth that David and Josh built to control the synth envelope using four potentiometers attached to the arduino. I created a really rough wood interface to mount my potentiometers so they would be a little easier to manipulate. As you can see, it works perfectly. The P5 interface allows the user to change the shape of the oscillator (sine, triangle, etc.) which can affect the tone of the sound, while the arduino sends the potentiometer signals to p5 to manipulate the envelope. Then, whenever a note is played, my two diodes on the Arduino flash! This helps to encourage the musician and confirm that their input was received.