This is a simple guide to build an electronic musical instrument. The MIDI notes are generated using a Raspberry Pi and a sonar sensor. Although the original Theremin is played using antennas, this one will use sonar technology as pitch control. The idea is to vary the distance between the user hand and the distance sensor, causing the pitch to change accordingly.