Project

# Title Team Members TA Documents Sponsor
24 FastFretTrainer (FFT)
Eli Hoon
Murtaza Saifuddin
Omeed Jamali
Eric Tang proposal1.pdf
FastFretTrainer (FFT)

Team Members:
- Eli Hoon (ehoon2)
- Murtaza Saifuddin (msaifu2)
- Omeed Jamali (ojama2)

# Problem

As a beginner guitarist one of the most difficult obstacles that you face is learning the notes on the fretboard/neck of the guitar. Guitars do not have markings for each note, only some fret numbers. There are some tools online that can show you where the notes are, but this is not an effective way of learning. The best way to learn is by doing so with feedback from a system so that you are able to take corrective action and quickly fix mistakes. Learning each note on the guitar is important because it allows you to solo/improvise on a piece of music if you know the key.
The solution to this problem is FastFretTrainer (FFT). With this project, you will be able to learn notes with real-time feedback through the use of an attachment plugged into the jack of your guitar that would send data to a base station, and give visual feedback on how well you played the note and ways to improve through a computer based application. The user would be able to interact using the computer based application to interpret the feedback from the system.
# Solution

For this implementation there would be a small wireless fob that connects to the quarter-inch jack on the guitar; this fob will transmit via Bluetooth to the base station. The fob will be responsible for amplifying, converting analog to digital data, and correctly transmitting data to the base station. The computer-based application and base station will ask the guitarist to play a specific note on the guitar and connect to a computer via USB-C so that the web application can manipulate data and use a Fast Fourier Transform (FFT) to check the similarity between the note played and the expected note. The computer based app would give more detailed visual feedback, such as a scale showing how far off the played note is in the unit of cents. If time permits, we plan to add more advanced features such as several practice modes, including practicing with or without accidentals on single or multiple strings, and it could even include a chord trainer that would be able to recognize the appropriate notes in a chord to determine if the correct notes are played. As a backup and for testing purposes, we will also include a quarter-inch jack on the base station in case the Bluetooth fob is out of battery.






# Solution Components

## Battery Subsystem
The fob that communicates with the base station will be battery-powered. We are designing the fob to have an operating voltage around 3 volts. Thus we can base the DC power of the board around a CR 2032 battery. The base would be powered preferably over USB-C, but if the USB power delivery does not meet our needs we can use power from the wall through an AC-DC conversion stage.

## Amplification Subsystem
The main microcontroller we will be using is the ESP 32 (ESP32-WROOM-32D). Reason for this is that it provides many interfaces (ADC, Bluetooth, UART) that we will be using in our project. The standard amplitude for an electric guitar output is about ~100mv, thus we would like to amplify the guitar signal before analog to digital conversion so that we are able to get a clear well-sampled signal to send via Bluetooth. This subsystem would use a low pass filter to remove high-frequency noise present in the signal before amplification using the TPA4860 at a 3.3 volt operating voltage. After amplification, we will pass the signal into the ADC.

## Analog to Digital Conversion Subsystem
The electric guitar will output an analog signal which represents a sound wave that was created by the vibration of strings. Since we are using a UART/USB system to transfer data to a computer system to compute the FFT, we will need to convert the analog signal to digital. The microcontroller we selected provides an ADC chip with channels for us to enable in firmware, and from there we can transmit the data via UART/USB to the computer. Before we transmit the data via UART/USB, we will transfer the data to a different ESP microcontroller that is placed on the base station via bluetooth. The data received at the ADC will be amplified via the subsystem described above.

## Wireless Subsystem
We will be taking advantage of the Bluetooth radio capabilities of a separate ESP 32 (ESP32-WROOM-32D) to establish communications between the fob and the base station. The fob and the base station will each have their own separate ESP 32s. We will use the Arduino IDE and the ESP 32 BLE (Bluetooth Low Energy) Library for communication between the two microcontrollers. The Bluetooth transmission will be responsible for sending the sampled signal data from the fob to the base station for further processing or analysis.

## UART/USB Subsystem
We will transmit data to the computer system to compute the FFT for our program via UART/USB protocol. The ESP32-WROOM-32D microcontroller that is hosted on the base station will receive data from the microcontroller hosted on the fob (this is digital data), and from there the job is to send it to the computer system via UART/USB system. There are TXD/RXD (transmit/receive) pins on the microcontroller for UART communication, and we will be using a UART/USB bridge to convert to USB protocol and then transmit the data to the computer. We will use the FT232RL chip as a UART/USB bridge, and then we will connect the pins from the bridge (main pins are the D+/D- pins for USB) to a USB connector, and via a USB cable we will connect to the computer to transfer data. The USB connector we plan to use is USB4230-03-A. We will also be delivering power to our base station via the USB subsystem. To do so, we just need to wire the power and ground wires to the microcontroller respectively.

## LCD Subsystem

Some basic system information such as whether the system is powered on will be displayed on an LCD display on our base station. We will also display basic feedback (how many cents off the user is from the expected note) that would also be available via the computer based app. The LCD subsystem would be composed of a simple I2C LCD Display, I2C LCD Adapter, and some wires to connect pins. The display would be hooked up to the adapter and the microcontroller would send data and power the LCD through the adapter via Vcc and GPIO pins. The LCD would be programmed to show metrics delivered through the data pins with the LCD-I2C Arduino Library in C++.

## PC Subsystem

The PC Subsystem is responsible for acting as both a source of power for the base station and the main system used for data manipulation and visual feedback. The PC will also be responsible for the note selection that the user must play. The PC will be set up to enable single-string, multiple-string, and other more advanced practice modes. The PC subsystem would receive the signal from the base station via USB-C and Python scripts would be used to take the FFT via the FFT module of the SciPy library. If we encounter the issue of Python not being fast enough for data to be processed in real time, C++ could also be used with the FFTW library. Once the strongest frequency from the FFT has been found, we can compare the frequency of the played note and that of the expected note (hardcoded) via conversion to cents, a unit in music that measures note intervals. This conversion can be done via a simple formula (1200 * log base 2(f1/f2) where f1 is the played frequency and f2 is the expected) and a threshold of +/- 5 cents can be used to measure whether the note played was accurate. The PC subsystem would then send the cents to be shown back on the LCD display of the base station via the PyUSB library. The PC Subsystem will also have a local application that could be used to see more visual feedback on how close the played note is via a scale (inspired by GuitarTuna’s UI for tuning) showing the expected note in the center and the value in cents to the left or right at a distance based on the cents and whether the note was too high-pitched or too low-pitched. The UI could also be used to switch between more complex modes like chord training.


# Criterion For Success

One of our main criteria for success is that our fob is battery-powered and able to communicate with our base station and provide signals via Bluetooth from a distance of at least 5 feet. Our base station should be able to display information like whether the power is on or off on the LCD display as well as basic feedback about the played note without the screen of the computer. The computer will be attached via USB-C (which is also the power connection for the base station) and will implement several software features for added complexity. The base station should effectively communicate with the fob and receive digital signals to pass onto the local computer-based application to take the FFT and accurately compare the played note to the expected note. The application should send basic feedback back to the base station to display on the LCD and give more detailed visual feedback on the computer display such as a scale showing how off the played note was in cents. The system will support at least a single string practice mode, where individual notes are requested and then tested after the user plays to ensure accuracy. One of our group members has never played guitar before, so it would be worthwhile to test with them to see how they are performing/improving with this application.

Automatic Piano Tuner

Joseph Babbo, Colin Wallace, Riley Woodson

Automatic Piano Tuner

Featured Project

# Automatic Piano Tuner

Team Members:

- Colin Wallace (colinpw2)

- Riley Woodson (rileycw2)

- Joseph Babbo (jbabbo2)

# Problem

Piano tuning is a time-consuming and expensive process. An average piano tuning will cost in the $100 - $200 range and a piano will have to be retuned multiple times to maintain the correct pitch. Due to the strength required to alter the piano pegs it is also something that is difficult for the less physically able to accomplish.

# Solution

We hope to bring piano tuning to the masses by creating an easy to use product which will be able to automatically tune a piano by giving the key as input alongside playing the key to get the pitch differential and automatically turning the piano pegs until they reach the correct note.

# Solution Components

## Subsystem 1 - Motor Assembly

A standard tuning pin requires 8-14 nm of torque to successfully tune. We will thus need to create a motor assembly that is able to produce enough torque to rotate standard tuning pins.

## Subsystem 2 - Frequency Detector/Tuner

The device will use a microphone to gather audio measurements. Then a microprocessor processes the audio data to detect the pitch and determine the difference from the desired frequency. This can then generate instructions for the motor; direction to turn pegs and amount to turn it by.

## Subsystem 3 - User Interface/Display Panel

A small but intuitive display and button configuration can be used for this device. It will be required for the user to set the key being played using buttons on the device and reading the output of the display. As the device will tune by itself after hearing the tone, all that is required to display is the current key and octave. A couple of buttons will suffice to be able to cycle up and down keys and octaves.

## Subsystem 4 - Replaceable Battery/Power Supply

Every commercial product should use standard replaceable batteries, or provide a way for easy charging. As we want to develop a handheld device, so that the device doesn’t have to drag power wires into the piano, we will need a rechargeable battery pack.

# Criterion For Success

The aim of the Automatic Piano Tuner is to allow the user to automatically tune piano strings based on a key input alongside playing a note. We have several goals to help us meet this aim:

- Measure pitch accurately, test against known good pitches

- Motor generates enough torque to turn the pegs on a piano

- Tuner turns correctly depending on pitch

- Easy tuning of a piano by a single untrained person

Project Videos