TL;DR
WhatChord faced a significant challenge in efficiently ranking plausible chord names due to its non-transitive comparator. The team optimized the ranking process by questioning assumptions and reducing constant factors, leading to a more efficient algorithm.
✦ Why It Matters
Engineers can apply non-transitive ranking methods to optimize performance in complex decision-making algorithms.
Key Takeaways
Full Summary
WhatChord is an application that identifies and names musical chords in real-time as users play on a MIDI keyboard. Unlike simple dictionary lookups, it treats chord naming as a ranking problem, where multiple interpretations must be scored and ordered based on musical context.
The initial implementation revealed that ranking accounted for approximately 99% of the engine's compute time, while scoring only took about 1%. To address this, the team built a reproducible benchmark and analyzed the ranking process, discovering that the comparator used was intentionally non-transitive.
This allowed for musical overrides to take precedence over fit scores, leading to a more nuanced ranking. By optimizing the algorithm and questioning hidden requirements, the team significantly reduced the time spent on ranking, enhancing the application's responsiveness.
These improvements can lead to better user experiences in real-time music applications.
Related