Hacker News new | ask | show | jobs
by andai 1041 days ago
> can be optimized further than what's presented in the article

Fascinating, do you have any links about this? Or more generally about the intersection of music, fractions and programming?

I found some code in Audacity that detects the notes in audio, I'll see if I can edit this comment later.

1 comments

The basic idea to optimize the algorithm (which I got from this [1] SO answer) is to recognize that you only ever update the numerator and denominator of either bound in a linear fashion. So rather than potentially repeatedly update a given bound, you alternate between the two, and use algebra to determine the multiple by which the bound should be updated.

Regarding the intersection of fractions and music, "just intonation" is the term you want to research.

[1] https://stackoverflow.com/a/45314258