Created a program in MATLAB that analyzed Guitar tones, and plot them to the grand staff. Created a library of all possible tones on the guitar staff. Programmed a MATLAB GUI to perform a fast Fourier transform (FFT) on the selected musical tone, and plot the note in the time domain, frequency domain, and the FFT. Designed an algorithm to correctly select the input notes by using the first peak of the FFT against a sampling database. Then created plotting system to correctly plot the note to the Grand Staff.
2. The Premise
Our goal was to achieve a functional
GUI that would display sheet music from
an audio input from a guitar utilizing
what we have learned in digital signal
processing
We were able to accurately display the
46 notes of the Standard tuning guitar
scale.
3. Theory
Musical notes
are categorized
by the frequency
at which they are
played.
This can be
utilized to identify
the notes from
their frequency
response.
4. Sheet Music
Sheet music is written based off the Piano
7 full octaves; Guitar covers about 4
46 notes on the guitar used
The full octave has total of 12 notes
A-G, with sharps (#) on every note but the B and the E
5. The Audio
All 46 audio files were recorded using
Garageband.
6. The GUI
5 Buttons
3 Graphs
Numerous
Info Boxes
1 Grand Staff
7. Song Select Button
Declared global variable ‘song’
uigetfile command
Set all strings
Reset all graphs with cla command
8. Play Song Button
Declared global variables ‘song’, ‘x’, and
‘Fs’
Created if statement
Two error dialogs: loading music file and
warning to stop music
Audioread function to set x as
magnitude and Fs as frequency
Set info strings
9. Stop Song Button
If statement to check if song is playing
Error dialog to tell user music must be
playing to stop it
Set info strings
10. Analyze Button – Time Domain
Global variables ‘x’ and ‘Fs’
Calculated the length of original signal
with length(x)
Plotted x vs. 1:n/Fs
11. Analyze Button – Frequency
Plot
Used fft to transform original signal into
frequency domain
Plotted the absolute value of the fft from
0 to the Nyquist frequency with an
interval of Fs/ length of x
Found the maximum coordinates of the
plot
12. Analyze Button – Frequency
Peaks
This is the same plot, but with peaks
marked
Used findpeaks function to analyze the
absolute value of the fft.
It located any peaks greater than 500 in
magnitude
Found the minimum values for the peak
to find the true frequency
13. Analyze Button – Grand
Staff
Created Grand Staff with plot function
Utilized if, elseif, else statements to give
the ranges of the frequencies of the 46
notes
Used hold on and image function to
insert whole notes and clefs on same
display as the Grand Staff
14. Export Button
Used getframe function to take data
from grand staff axis
Used imwrite function to write the image
to the current folder as Score.jpg
15. Advancements in the Future
Multiple single notes
- Audio segmentation to determine start
and stop of each note and how many were
played in the file
- Create a for loop using how many notes
were played in the file applied to the if
statement per each segment
Chords
- Recording all combinations
- Determining new frequency
Tablature