In this project, we will make an eight key DIY piano using capacitive touch. The sound will be generated using a piezo buzzer which is in-built (in evive). We will generate 8 basic tones (Sargam)- Sa, Re, Ga, Ma, Pa, Dha, Ni, San in Hindi. You will need the frequency of each note to make a DIY Piano.
evive capacitive input, monitors the capacitance level and notifies the user if the capacitance is above threshold (touched) or below threshold (not touched). You can connect any of these things to make your piano: fruits, vegetable or aluminum foil.
Attach your objects to evive touch input channel 1 to 8.
Scratch is a graphical programming language which let you interface and control your evive with laptop. If you have not installed Scratch visit here to get full instruction on installing Scratch.
To learn about the Scratch interface, visit here.
We have developed these Scratch extensions containing special blocks through which you can control your evive in Scratch:
In Scratch, there are two modes in which you can work:
In this project we are not using any scratch feature and want to run evive independent of your computer, hence we have to work in Arduino mode.
Piezo buzzers are electrically actuated buzzers, which generate a tone or a sound of a certain frequency. In evive, there is an inbuilt piezo buzzer connected to digital pin 46. In Scratch, you have an Arduino block which plays tone. Using this block you can play notes of different beats and frequencies, using the buzzer on the selected pin.
Let us now make a small part of our piano, where you will play the ‘Sa’ note (frequency 261 Hz) whenever evive tactile switch 1 is pressed for 0.1s.
Since this requires only one switch, you do not need any extra circuit. Just connect evive to your computer using the USB cable and connect Arduino to an appropriate port. It is a very straightforward and easy script. You can check if you hear the tone when the switch is pressed.
We are going to make script in Arduino mode and upload it to evive directly. Hence we will start with evive program.
As we want to check which touch input is touched continuously, we will use forever block from Control palette.
Now we just have to check if the touch channel is touched and play tone. The full Script is given.
Upload the Arduino code in evive and play with your piano.