<< Chapter < Page Chapter >> Page >
This module contains a discussion of the main faults of the piano note detection program and how it could possibly be improved. It also suggests alternate methods that could be made into projects of their own.

Main faults and possible improvements

While this program is fairly effective, it is not perfect. Below is a detailed list of all the problems with each of the four major blocks of code, along with methods for possibly improving these faults.

    Problems with detecting note onsets

  • If a song is played fast enough, note hits will be missed, especially if they are very close to another note hit.
  • There is no way of telling when a note is released. Thus, if there were rests in the middle of a song, it would likely be viewed as the note immediately before it being held for the length of the rest. Attempting to use the negative peaks of the filtered song to find note offsets might fix this problem, but note offsets are much less defined than the onsets.
  • This only detects when a note was played, not what note was played. So if one note is being held for a long time, while shorter notes are being played, the long note appears identical to that note being played multiple times.
  • Sometimes the location of the note hit is not precisely where the note hit occurred. By looking at Figure 4 in the Detecting Note Onsets , you can see that at times, the note depression happens just before the sharp rise, rather than on it.

    Problems with finding frequencies

  • Pianos differ widely with their frequency spectra. Our thresholds were tailored to give good results for a certain piano, but songs played on different pianos did not work nearly as well.
  • The harmony and bass lines of a piano piece are usually played much softer than the melody. Therefore, they don't show up in the frequency domain very strongly and are often below the threshold we have set. Our algorithm does an excellent job of picking out the notes in the melody, though.
  • Notes can only be detected when the starts of the notes coincide. If a note is being held with faster notes being played on top of it, this algorithm will determine that the note being held is played repeatedly with every note on top of it. It is very difficult to look at the frequency spectrum to fix this.
  • Sometimes, the previous note played will still be resonating into the current note. The code will usually pick that up as another note that is being played. Using a Hamming window or another non-rectangular window could fix this problem.
  • Piano harmonics are not perfect integer multiples of the fundamental frequency due to small deviations from the ideal. Furthermore, the higher notes of a piano are tuned with the high harmonics of the lower notes, instead of being tuned to the mathematically determined frequency. This results in several missed harmonics.

    Problems with note decoding

  • If a piano is tuned differently than expected, some notes may decode wrong. Analyzing the piece as a whole to see if frequencies are always just higher or just lower than expected may help allow for the tuning of that individual piano.
  • Only a musical system based on 12 tones can be used with this implementation. Arrangements could be made to allow this program to deal with alternate systems of music.
  • Our program currently has no way of finding the key of the piece. If such an algorithm were to be created, this is the most likely place to implement it.

    Problems with finding note lengths

  • This method assumes that the song is played at a constant tempo. It does not account for any kind of speeding up or slowing down. One way to address this is to look through the song for a noticeable change in the note duration distribution with respect to time. If one is found, then the song can be divided into two parts and this method can be used separately on each part.
  • This method relies on a lengthy song to accurately determine the tempo and note lengths. Very short pieces or segments of pieces are likely to yield an incorrect tempo.
  • This assumes that the most common note is the quarter note, or the beat. This may not be correct for different time signatures, and analysis of which notes carry the emphasis might yield a clue as to the actual note lengths and tempo, as well as the time signature.
  • The output of this function is a matrix representation of sheet music. It could actually generate standard sheet music with some sort of program designed to print it.

Additional projects

One additional method of approaching this problem that we looked at but did not pursue was to look at the frequency content of the recording first, followed by the time content. This method is discussed below.

Start by taking the song, and run a band-pass filter through it that is centered around a known note frequency, such as 440 Hz. Make sure this band pass filter has a narrow enough band that it does not pass any note frequency other than the center frequency of the band. When we attempted this, it left the majority of the song at around 0, while the portion of the song in which 440 Hz was played contained the expected sharp note hit and decay. At this point it is very easy to find when the note was first played and somewhat easier to find when the note was released. Repeating this process for all 88 possible notes should yield a very accurate description of when each note was played.

The downsides of the method above are numerous. The most obvious one is that this method would take 88 times longer than our original method. Considering that our original method takes 13 seconds for a 5 second recording, the new method would take almost 20 minutes for the same recording. A full length song (around 4 minutes) would take 16 hours. The next issue is the creation of these band-pass filters. For very low frequencies, the difference in frequency between adjacent notes is very small. For the lowest frequency, 27.5 Hz, the nearest note to it is 29.14 Hz. To make a filter with enough frequency resolution to distinguish between these two frequencies requires a filter length on the order of two-thirds of a second long. Most notes are much shorter than this, considering that a quarter note at 120 beats per minute is only half a second long. This would likely cause the shape of the filtered signal to be very different from the expected sharp onset and exponential decay. In addition, this method does little to aid the problem of determining which notes are harmonics and which are actual notes played.

An alteration of this method would include filtering a note and all of its harmonics at the same time. This would reduce the amount of time needed to run the algorithm significantly. However, it does not help with the necessity of very long filters; in some cases, the filter may actually need to be longer. An additional issue this raises is that multiple filters will have the same pass-bands. For example, a frequency such as 1318.5 Hz (E6) is a harmonic of both 440 Hz (A4) and 659 Hz (E5), but A4 and E5 are not harmonics of each other. Thus, if A4 were played, it might also pick up E5 being played faintly as a result.

Questions & Answers

Three charges q_{1}=+3\mu C, q_{2}=+6\mu C and q_{3}=+8\mu C are located at (2,0)m (0,0)m and (0,3) coordinates respectively. Find the magnitude and direction acted upon q_{2} by the two other charges.Draw the correct graphical illustration of the problem above showing the direction of all forces.
Kate Reply
To solve this problem, we need to first find the net force acting on charge q_{2}. The magnitude of the force exerted by q_{1} on q_{2} is given by F=\frac{kq_{1}q_{2}}{r^{2}} where k is the Coulomb constant, q_{1} and q_{2} are the charges of the particles, and r is the distance between them.
Muhammed
What is the direction and net electric force on q_{1}= 5µC located at (0,4)r due to charges q_{2}=7mu located at (0,0)m and q_{3}=3\mu C located at (4,0)m?
Kate Reply
what is the change in momentum of a body?
Eunice Reply
what is a capacitor?
Raymond Reply
Capacitor is a separation of opposite charges using an insulator of very small dimension between them. Capacitor is used for allowing an AC (alternating current) to pass while a DC (direct current) is blocked.
Gautam
A motor travelling at 72km/m on sighting a stop sign applying the breaks such that under constant deaccelerate in the meters of 50 metres what is the magnitude of the accelerate
Maria Reply
please solve
Sharon
8m/s²
Aishat
What is Thermodynamics
Muordit
velocity can be 72 km/h in question. 72 km/h=20 m/s, v^2=2.a.x , 20^2=2.a.50, a=4 m/s^2.
Mehmet
A boat travels due east at a speed of 40meter per seconds across a river flowing due south at 30meter per seconds. what is the resultant speed of the boat
Saheed Reply
50 m/s due south east
Someone
which has a higher temperature, 1cup of boiling water or 1teapot of boiling water which can transfer more heat 1cup of boiling water or 1 teapot of boiling water explain your . answer
Ramon Reply
I believe temperature being an intensive property does not change for any amount of boiling water whereas heat being an extensive property changes with amount/size of the system.
Someone
Scratch that
Someone
temperature for any amount of water to boil at ntp is 100⁰C (it is a state function and and intensive property) and it depends both will give same amount of heat because the surface available for heat transfer is greater in case of the kettle as well as the heat stored in it but if you talk.....
Someone
about the amount of heat stored in the system then in that case since the mass of water in the kettle is greater so more energy is required to raise the temperature b/c more molecules of water are present in the kettle
Someone
definitely of physics
Haryormhidey Reply
how many start and codon
Esrael Reply
what is field
Felix Reply
physics, biology and chemistry this is my Field
ALIYU
field is a region of space under the influence of some physical properties
Collete
what is ogarnic chemistry
WISDOM Reply
determine the slope giving that 3y+ 2x-14=0
WISDOM
Another formula for Acceleration
Belty Reply
a=v/t. a=f/m a
IHUMA
innocent
Adah
pratica A on solution of hydro chloric acid,B is a solution containing 0.5000 mole ofsodium chlorid per dm³,put A in the burret and titrate 20.00 or 25.00cm³ portion of B using melting orange as the indicator. record the deside of your burret tabulate the burret reading and calculate the average volume of acid used?
Nassze Reply
how do lnternal energy measures
Esrael
Two bodies attract each other electrically. Do they both have to be charged? Answer the same question if the bodies repel one another.
JALLAH Reply
No. According to Isac Newtons law. this two bodies maybe you and the wall beside you. Attracting depends on the mass och each body and distance between them.
Dlovan
Are you really asking if two bodies have to be charged to be influenced by Coulombs Law?
Robert
like charges repel while unlike charges atttact
Raymond
What is specific heat capacity
Destiny Reply
Specific heat capacity is a measure of the amount of energy required to raise the temperature of a substance by one degree Celsius (or Kelvin). It is measured in Joules per kilogram per degree Celsius (J/kg°C).
AI-Robot
specific heat capacity is the amount of energy needed to raise the temperature of a substance by one degree Celsius or kelvin
ROKEEB
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2006. OpenStax CNX. Sep 27, 2007 Download for free at http://cnx.org/content/col10462/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?

Ask