abbernie / tune

A web audio tuning library of microtonal and just intonation scales
171 stars 24 forks source link

is there a way to lookup notes given a frequency? #4

Open MaxPleaner opened 7 years ago

MaxPleaner commented 7 years ago

I am trying to write a tuner that can take an arbitrary frequency in hz and suggest a note for it.

I realize that the "note" suggested would be dependent on which scale I'm using. Although it'd be possible to have the user declare which scale they want to use, it'd be better if the software could check amongst multiple scales and show all the matches. This project seems like the most promising resource to do this which is why I'm asking.

abbernie commented 7 years ago

The specific frequencies of each scale degree will depend on what the root frequency of the scale is. The specific frequencies of each scale are determined by ratios relative to the root. Once you have set the root frequency (with the tune.tonicize() method), you could loop through the scale archive (in tunings.js) and return the scales that feature that frequency (or a close by one) in that particular key.

Hope that helps!

MaxPleaner commented 7 years ago

@abbernie it does help. To save memory, seems like the best thing to do would be to do that denormalization server-side (map note values to frequency keys) and use API requests from the client.