Pitch shift effect controlled by hand
Pitch shifting is a well-known effect in all fields related to sound processing. It changes the pitch of an incoming sound. Here we are going to implement a very cheap pitch shifter with Max 6, but we will focus on how to control this sound effect. We will control it by moving our hand over a distance sensor.
We are going to use the same circuit as the one in Chapter 6, Sense the World – Feeling with Analog Inputs.
The circuit with the sensor and the firmware
The following circuit shows the Arduino board connected to a sensor:
The firmware is almost the same too. I removed the part about the distance calculation because, indeed, we don't care about the distance itself.
The ADC of Arduino provides a resolution of 10 bits, which will give numbers from 0 to 1023. We are going to use this value to calibrate our system.
The following code is the firmware. You can find it in the Chapter12/PitchShift
folder:
int sensorPin...