Problem 379. Chromatic Tuner
Given a frequency, return the number of cents difference between the given frequency and its nearest semitone (in 12-tone equal temperament with A440) as well as the semitone it is closest to (in scientific pitch notation, using # for sharp and using natural pitches whenever possible) with A440 referring to A4. Refer to the wikipedia articles below for more information.
References:
Solution Stats
Problem Comments
-
4 Comments
@bmtran: Could you please verify that the octave numbers in the semitone names are correct in the test suite? Some of them do not seem to be consistent with http://en.wikipedia.org/wiki/Scientific_pitch_notation
Cheers, VL.
sorry about that. i've fixed it to the best of my knowledge. i hope this didn't cause you too much distress.
Thanks for fixing it. No distress anymore. Cheers.
Nice problem, specially when coming from Austin, Live Music Capital of the World.
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
48978 Solvers
-
Find the alphabetic word product
3313 Solvers
-
The Hitchhiker's Guide to MATLAB
3283 Solvers
-
Construct a string from letters and counts
141 Solvers
-
Numbers with prime factors 2, 3 and 5.
469 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!