Skip to content

Instantly share code, notes, and snippets.

View calettso's full-sized avatar

Clyde Lettsome, PhD, PE, MEM calettso

View GitHub Profile
/*
File/Sketch Name: MusicalNoteDetector
Version No.: v1.0 Created 7 June, 2020
Original Author: Clyde A. Lettsome, PhD, PE, MEM
Description: This code/sketch displays the approximate frequency as well as the musical note played on an electronic keyboard or piano app. For this project, the analog output from the
sound module detector is sent to the A0 analog input of the Arduino Uno. The analog signal is sampled and quantized (digitized). Autocorrelation, weighting and tuning code is used to
find fundamental frequency using the first 3 periods. The approximate fundamental frequency is then compared to frequencies in octaves 3, 4, and 5 range to determine the closest musical